]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: migrate: Don't disallow --p2p and --migrateuri
authorCole Robinson <crobinso@redhat.com>
Tue, 28 May 2013 19:37:53 +0000 (15:37 -0400)
committerCole Robinson <crobinso@redhat.com>
Wed, 29 May 2013 16:31:00 +0000 (12:31 -0400)
Because it's a valid combination. p2p still uses a separate channel
for qemu migration, so there's value in letting the user specify a manual
migrate URI for overriding auto-port, or libvirt's FQDN lookup.

What _isn't_ allowed is --migrateuri and TUNNELLED, since there is
no separate migration channel. Disallow that instead

tools/virsh-domain.c

index 4fdf4ba2e9424f9f21df8c0dc36b5d3337cb01af..eb8688de819da05c227975b285a8c83fab88904e 100644 (file)
@@ -8306,15 +8306,15 @@ doMigrate(void *opaque)
 
     if ((flags & VIR_MIGRATE_PEER2PEER) ||
         vshCommandOptBool(cmd, "direct")) {
-        /* For peer2peer migration or direct migration we only expect one URI
-         * a libvirt URI, or a hypervisor specific URI. */
 
-        if (migrateuri != NULL) {
+        /* migrateuri doesn't make sense for tunnelled migration */
+        if (flags & VIR_MIGRATE_TUNNELLED && migrateuri != NULL) {
             vshError(ctl, "%s", _("migrate: Unexpected migrateuri for peer2peer/direct migration"));
             goto out;
         }
 
-        if (virDomainMigrateToURI2(dom, desturi, NULL, xml, flags, dname, 0) == 0)
+        if (virDomainMigrateToURI2(dom, desturi, migrateuri,
+                                   xml, flags, dname, 0) == 0)
             ret = '0';
     } else {
         /* For traditional live migration, connect to the destination host directly. */