mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-29 09:05:25 +00:00
qemu: Add qemuDomainMigratableDefCheckABIStability
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@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
0810d4f5e0
commit
a0912df3fa
@ -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
|
bool
|
||||||
qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
||||||
virDomainDefPtr src,
|
virDomainDefPtr src,
|
||||||
@ -5909,23 +5929,15 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
|||||||
const unsigned int flags = VIR_DOMAIN_XML_SECURE |
|
const unsigned int flags = VIR_DOMAIN_XML_SECURE |
|
||||||
VIR_DOMAIN_XML_UPDATE_CPU |
|
VIR_DOMAIN_XML_UPDATE_CPU |
|
||||||
VIR_DOMAIN_XML_MIGRATABLE;
|
VIR_DOMAIN_XML_MIGRATABLE;
|
||||||
const unsigned int check_flags = VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE;
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) ||
|
if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) ||
|
||||||
!(migratableDefDst = qemuDomainDefCopy(driver, dst, flags)))
|
!(migratableDefDst = qemuDomainDefCopy(driver, dst, flags)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!virDomainDefCheckABIStabilityFlags(migratableDefSrc,
|
ret = qemuDomainMigratableDefCheckABIStability(driver,
|
||||||
migratableDefDst,
|
src, migratableDefSrc,
|
||||||
driver->xmlopt,
|
dst, migratableDefDst);
|
||||||
check_flags))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
/* Force update any skipped values from the volatile flag */
|
|
||||||
dst->mem.cur_balloon = src->mem.cur_balloon;
|
|
||||||
|
|
||||||
ret = true;
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virDomainDefFree(migratableDefSrc);
|
virDomainDefFree(migratableDefSrc);
|
||||||
|
Loading…
Reference in New Issue
Block a user