3e5111
From 2e728d3be5792685c38adbd61e80318e51985897 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <2e728d3be5792685c38adbd61e80318e51985897@dist-git>
3e5111
From: Jiri Denemark <jdenemar@redhat.com>
3e5111
Date: Wed, 14 Jun 2017 13:43:12 +0200
3e5111
Subject: [PATCH] qemu: Add qemuDomainMigratableDefCheckABIStability
3e5111
3e5111
This patch separates the actual ABI checks from getting migratable defs
3e5111
in qemuDomainDefCheckABIStability so that we can create another wrapper
3e5111
which will use different methods to get the migratable defs.
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3e5111
(cherry picked from commit a0912df3faac8b58725f45b8cf928990999585a3)
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1460952
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_domain.c | 34 +++++++++++++++++++++++-----------
3e5111
 1 file changed, 23 insertions(+), 11 deletions(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
3e5111
index ce75105afa..b3dc2bc3ac 100644
3e5111
--- a/src/qemu/qemu_domain.c
3e5111
+++ b/src/qemu/qemu_domain.c
3e5111
@@ -5889,6 +5889,26 @@ virDomainABIStability virQEMUDriverDomainABIStability = {
3e5111
 };
3e5111
 
3e5111
 
3e5111
+static bool
3e5111
+qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver,
3e5111
+                                         virDomainDefPtr src,
3e5111
+                                         virDomainDefPtr migratableSrc,
3e5111
+                                         virDomainDefPtr dst,
3e5111
+                                         virDomainDefPtr migratableDst)
3e5111
+{
3e5111
+    if (!virDomainDefCheckABIStabilityFlags(migratableSrc,
3e5111
+                                            migratableDst,
3e5111
+                                            driver->xmlopt,
3e5111
+                                            VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE))
3e5111
+        return false;
3e5111
+
3e5111
+    /* Force update any skipped values from the volatile flag */
3e5111
+    dst->mem.cur_balloon = src->mem.cur_balloon;
3e5111
+
3e5111
+    return true;
3e5111
+}
3e5111
+
3e5111
+
3e5111
 bool
3e5111
 qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
3e5111
                                virDomainDefPtr src,
3e5111
@@ -5899,23 +5919,15 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
3e5111
     const unsigned int flags = VIR_DOMAIN_XML_SECURE |
3e5111
                                VIR_DOMAIN_XML_UPDATE_CPU |
3e5111
                                VIR_DOMAIN_XML_MIGRATABLE;
3e5111
-    const unsigned int check_flags = VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE;
3e5111
     bool ret = false;
3e5111
 
3e5111
     if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) ||
3e5111
         !(migratableDefDst = qemuDomainDefCopy(driver, dst, flags)))
3e5111
         goto cleanup;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStabilityFlags(migratableDefSrc,
3e5111
-                                            migratableDefDst,
3e5111
-                                            driver->xmlopt,
3e5111
-                                            check_flags))
3e5111
-        goto cleanup;
3e5111
-
3e5111
-    /* Force update any skipped values from the volatile flag */
3e5111
-    dst->mem.cur_balloon = src->mem.cur_balloon;
3e5111
-
3e5111
-    ret = true;
3e5111
+    ret = qemuDomainMigratableDefCheckABIStability(driver,
3e5111
+                                                   src, migratableDefSrc,
3e5111
+                                                   dst, migratableDefDst);
3e5111
 
3e5111
  cleanup:
3e5111
     virDomainDefFree(migratableDefSrc);
3e5111
-- 
3e5111
2.13.1
3e5111