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