]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
migration: remove direct migration dependency on version1 of driver
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 2 Oct 2015 07:52:44 +0000 (10:52 +0300)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 12 Oct 2015 11:30:58 +0000 (13:30 +0200)
Direct migration should work if *perform3 is present but *perform
is not. This is situation when driver migration is implemented
after new version of driver function is introduced. We should not
be forced to support old version too as its parameter space is
subspace of newer one.

src/libvirt-domain.c

index 83245fe9e770ebfc1352eb1de456623d8fb5f66a..930ff62bd51d67d970034b8ad2e60f38e95eb8af 100644 (file)
@@ -3425,16 +3425,15 @@ virDomainMigrateDirect(virDomainPtr domain,
                      NULLSTR(xmlin), flags, NULLSTR(dname), NULLSTR(uri),
                      bandwidth);
 
-    if (!domain->conn->driver->domainMigratePerform) {
-        virReportUnsupportedError();
-        return -1;
-    }
-
     /* Perform the migration.  The driver isn't supposed to return
      * until the migration is complete.
      */
     if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
                                  VIR_DRV_FEATURE_MIGRATION_V3)) {
+        if (!domain->conn->driver->domainMigratePerform3) {
+            virReportUnsupportedError();
+            return -1;
+        }
         VIR_DEBUG("Using migration protocol 3");
         /* dconn URI not relevant in direct migration, since no
          * target libvirtd is involved */
@@ -3450,6 +3449,10 @@ virDomainMigrateDirect(virDomainPtr domain,
                                                            dname,
                                                            bandwidth);
     } else {
+        if (!domain->conn->driver->domainMigratePerform) {
+            virReportUnsupportedError();
+            return -1;
+        }
         VIR_DEBUG("Using migration protocol 2");
         if (xmlin) {
             virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",