]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: migration: error if tunnelled + storage specified
authorCole Robinson <crobinso@redhat.com>
Tue, 28 May 2013 19:27:45 +0000 (15:27 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 12 Jun 2013 20:37:55 +0000 (16:37 -0400)
Since as the code indicates it doesn't work yet, so let's be
explicit about it.
(cherry picked from commit 98bbda00cfa58c3fb73220e4a7c5d33938c0cb74)

src/qemu/qemu_migration.c

index 5840a6ba34e08bbc520d3227986cb6de6206e3df..f3b2b8730d1ca12bc72830df2ae302863d121f03 100644 (file)
@@ -1916,12 +1916,13 @@ char *qemuMigrationBegin(virQEMUDriverPtr driver,
     if (flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) &&
         virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
         /* TODO support NBD for TUNNELLED migration */
-        if (flags & VIR_MIGRATE_TUNNELLED)
-            VIR_DEBUG("NBD in tunnelled migration is currently not supported");
-        else {
-            cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
-            priv->nbdPort = 0;
+        if (flags & VIR_MIGRATE_TUNNELLED) {
+            virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
+                _("NBD in tunnelled migration is currently not supported"));
+            goto cleanup;
         }
+        cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
+        priv->nbdPort = 0;
     }
 
     if (!(mig = qemuMigrationEatCookie(driver, vm, NULL, 0, 0)))
@@ -2239,16 +2240,11 @@ done:
     if (mig->nbd &&
         flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) &&
         virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
-        /* TODO support NBD for TUNNELLED migration */
-        if (flags & VIR_MIGRATE_TUNNELLED)
-            VIR_DEBUG("NBD in tunnelled migration is currently not supported");
-        else {
-            if (qemuMigrationStartNBDServer(driver, vm, listenAddr) < 0) {
-                /* error already reported */
-                goto endjob;
-            }
-            cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
+        if (qemuMigrationStartNBDServer(driver, vm, listenAddr) < 0) {
+            /* error already reported */
+            goto endjob;
         }
+        cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
     }
 
     if (qemuMigrationBakeCookie(mig, driver, vm, cookieout,