]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: migration: Don't attempt to fall back to old-style storage migration
authorPeter Krempa <pkrempa@redhat.com>
Thu, 8 Sep 2022 10:48:47 +0000 (12:48 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 9 Sep 2022 14:10:47 +0000 (16:10 +0200)
QEMU supported the NBD server required for the new-style migration for a
long time already and when coupled with -blockdev the old style
migration doesn't even work, thus remove support for it.

This patch modifies the code to check that the destination returned data
for the NBD migration and returns an error if it did not and deletes the
fallback code paths which would not work.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_migration.c

index 995364da02757cf13e872fa210d98d869c5b2958..7dc593d49f5014b6cd248efead7be7f7fcd2ec48 100644 (file)
@@ -4817,35 +4817,28 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
     }
 
     if (storageMigration) {
-        if (mig->nbd) {
-            const char *host = "";
-            const char *tlsHostname = qemuMigrationParamsGetTLSHostname(migParams);
+        const char *host = "";
+        const char *tlsHostname = qemuMigrationParamsGetTLSHostname(migParams);
 
-            if (spec->destType == MIGRATION_DEST_HOST ||
-                spec->destType == MIGRATION_DEST_CONNECT_HOST) {
-                host = spec->dest.host.name;
-            }
-
-            if (qemuMigrationSrcNBDStorageCopy(driver, vm, mig,
-                                               host,
-                                               priv->migMaxBandwidth,
-                                               nmigrate_disks,
-                                               migrate_disks,
-                                               dconn, tlsAlias, tlsHostname,
-                                               nbdURI, flags) < 0) {
-                goto error;
-            }
-        } else {
-            /* Destination doesn't support NBD server.
-             * Fall back to previous implementation. */
-            VIR_DEBUG("Destination doesn't support NBD server "
-                      "Falling back to previous implementation.");
+        if (!mig->nbd) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("migration of non-shared disks requested but NBD is not set up"));
+            goto error;
+        }
 
-            if (flags & VIR_MIGRATE_NON_SHARED_DISK)
-                migrate_flags |= QEMU_MONITOR_MIGRATE_NON_SHARED_DISK;
+        if (spec->destType == MIGRATION_DEST_HOST ||
+            spec->destType == MIGRATION_DEST_CONNECT_HOST) {
+            host = spec->dest.host.name;
+        }
 
-            if (flags & VIR_MIGRATE_NON_SHARED_INC)
-                migrate_flags |= QEMU_MONITOR_MIGRATE_NON_SHARED_INC;
+        if (qemuMigrationSrcNBDStorageCopy(driver, vm, mig,
+                                           host,
+                                           priv->migMaxBandwidth,
+                                           nmigrate_disks,
+                                           migrate_disks,
+                                           dconn, tlsAlias, tlsHostname,
+                                           nbdURI, flags) < 0) {
+            goto error;
         }
     }