|
|
7a3408 |
From 831d540170a2be5dcf89fd406b95f0449a5bcfce Mon Sep 17 00:00:00 2001
|
|
|
7a3408 |
Message-Id: <831d540170a2be5dcf89fd406b95f0449a5bcfce@dist-git>
|
|
|
7a3408 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
7a3408 |
Date: Wed, 5 Aug 2015 17:31:38 +0200
|
|
|
7a3408 |
Subject: [PATCH] qemu: Forbid image pre-creation for non-shared storage
|
|
|
7a3408 |
migration
|
|
|
7a3408 |
|
|
|
7a3408 |
Libvirt doesn't reliably know the location of the backing chain when
|
|
|
7a3408 |
pre-creating images for non-shared migration. This isn't a problem for
|
|
|
7a3408 |
full copy, but incremental copy requires the information.
|
|
|
7a3408 |
|
|
|
7a3408 |
Forbid pre-creating the image in cases where incremental migration is
|
|
|
7a3408 |
required. This limitation can perhaps be lifted once libvirt will fully
|
|
|
7a3408 |
support loading of backing chain information from the XML.
|
|
|
7a3408 |
|
|
|
7a3408 |
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1249587
|
|
|
7a3408 |
(cherry picked from commit 6da3b694cca436fcc38247aff9d1ce8e955292a8)
|
|
|
7a3408 |
|
|
|
7a3408 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7a3408 |
---
|
|
|
7a3408 |
src/qemu/qemu_migration.c | 13 +++++++++++--
|
|
|
7a3408 |
1 file changed, 11 insertions(+), 2 deletions(-)
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
|
|
7a3408 |
index 16bb1af..cee82fa 100644
|
|
|
7a3408 |
--- a/src/qemu/qemu_migration.c
|
|
|
7a3408 |
+++ b/src/qemu/qemu_migration.c
|
|
|
7a3408 |
@@ -1613,7 +1613,8 @@ qemuMigrationPrecreateStorage(virConnectPtr conn,
|
|
|
7a3408 |
virDomainObjPtr vm,
|
|
|
7a3408 |
qemuMigrationCookieNBDPtr nbd,
|
|
|
7a3408 |
size_t nmigrate_disks,
|
|
|
7a3408 |
- const char **migrate_disks)
|
|
|
7a3408 |
+ const char **migrate_disks,
|
|
|
7a3408 |
+ bool incremental)
|
|
|
7a3408 |
{
|
|
|
7a3408 |
int ret = -1;
|
|
|
7a3408 |
size_t i = 0;
|
|
|
7a3408 |
@@ -1644,6 +1645,13 @@ qemuMigrationPrecreateStorage(virConnectPtr conn,
|
|
|
7a3408 |
continue;
|
|
|
7a3408 |
}
|
|
|
7a3408 |
|
|
|
7a3408 |
+ if (incremental) {
|
|
|
7a3408 |
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
|
|
7a3408 |
+ _("pre-creation of storage targets for incremental "
|
|
|
7a3408 |
+ "storage migration is not supported"));
|
|
|
7a3408 |
+ goto cleanup;
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+
|
|
|
7a3408 |
VIR_DEBUG("Proceeding with disk source %s", NULLSTR(diskSrcPath));
|
|
|
7a3408 |
|
|
|
7a3408 |
if (qemuMigrationPrecreateDisk(conn, disk, nbd->disks[i].capacity) < 0)
|
|
|
7a3408 |
@@ -3339,7 +3347,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
|
|
7a3408 |
}
|
|
|
7a3408 |
|
|
|
7a3408 |
if (qemuMigrationPrecreateStorage(dconn, driver, vm, mig->nbd,
|
|
|
7a3408 |
- nmigrate_disks, migrate_disks) < 0)
|
|
|
7a3408 |
+ nmigrate_disks, migrate_disks,
|
|
|
7a3408 |
+ !!(flags & VIR_MIGRATE_NON_SHARED_INC)) < 0)
|
|
|
7a3408 |
goto cleanup;
|
|
|
7a3408 |
|
|
|
7a3408 |
if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0)
|
|
|
7a3408 |
--
|
|
|
7a3408 |
2.5.0
|
|
|
7a3408 |
|