This patch separates the actual ABI checks from getting migratable defs
in qemuDomainDefCheckABIStability so that we can create another wrapper
which will use different methods to get the migratable defs.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 34 +++++++++++++++++++++++-----------
1 file changed, 23 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2f8afd1d9..01644694b 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -5899,6 +5899,26 @@ virDomainABIStability virQEMUDriverDomainABIStability = {
};
+static bool
+qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver,
+ virDomainDefPtr src,
+ virDomainDefPtr migratableSrc,
+ virDomainDefPtr dst,
+ virDomainDefPtr migratableDst)
+{
+ if (!virDomainDefCheckABIStabilityFlags(migratableSrc,
+ migratableDst,
+ driver->xmlopt,
+ VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE))
+ return false;
+
+ /* Force update any skipped values from the volatile flag */
+ dst->mem.cur_balloon = src->mem.cur_balloon;
+
+ return true;
+}
+
+
bool
qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
virDomainDefPtr src,
@@ -5909,23 +5929,15 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
const unsigned int flags = VIR_DOMAIN_XML_SECURE |
VIR_DOMAIN_XML_UPDATE_CPU |
VIR_DOMAIN_XML_MIGRATABLE;
- const unsigned int check_flags = VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE;
bool ret = false;
if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) ||
!(migratableDefDst = qemuDomainDefCopy(driver, dst, flags)))
goto cleanup;
- if (!virDomainDefCheckABIStabilityFlags(migratableDefSrc,
- migratableDefDst,
- driver->xmlopt,
- check_flags))
- goto cleanup;
-
- /* Force update any skipped values from the volatile flag */
- dst->mem.cur_balloon = src->mem.cur_balloon;
-
- ret = true;
+ ret = qemuDomainMigratableDefCheckABIStability(driver,
+ src, migratableDefSrc,
+ dst, migratableDefDst);
cleanup:
virDomainDefFree(migratableDefSrc);
--
2.13.1