From: Michal Privoznik <mpriv...@redhat.com>

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.

This patch has been already sent to mailist and has form
that finally suggested by Michal Privoznik. I just include
it in the set as it is not merged yet.
---
 src/libvirt-domain.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 6f10c74..15de714 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3412,16 +3412,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 */
@@ -3437,6 +3436,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",
-- 
1.7.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to