mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 16:45:26 +00:00
qemu: Add qemuDomainCheckABIStability
When making ABI stability checks for an active domain, we need to make sure we use the same migratable definition which virDomainGetXMLDesc with the MIGRATABLE flag provides, otherwise the ABI check will fail. This is implemented in the new qemuDomainCheckABIStability which takes a domain object and generates the right migratable definition from it. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
a0912df3fa
commit
063b2b8788
@ -5919,6 +5919,10 @@ qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define COPY_FLAGS (VIR_DOMAIN_XML_SECURE | \
|
||||||
|
VIR_DOMAIN_XML_UPDATE_CPU | \
|
||||||
|
VIR_DOMAIN_XML_MIGRATABLE)
|
||||||
|
|
||||||
bool
|
bool
|
||||||
qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
||||||
virDomainDefPtr src,
|
virDomainDefPtr src,
|
||||||
@ -5926,13 +5930,10 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
|||||||
{
|
{
|
||||||
virDomainDefPtr migratableDefSrc = NULL;
|
virDomainDefPtr migratableDefSrc = NULL;
|
||||||
virDomainDefPtr migratableDefDst = NULL;
|
virDomainDefPtr migratableDefDst = NULL;
|
||||||
const unsigned int flags = VIR_DOMAIN_XML_SECURE |
|
|
||||||
VIR_DOMAIN_XML_UPDATE_CPU |
|
|
||||||
VIR_DOMAIN_XML_MIGRATABLE;
|
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) ||
|
if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, COPY_FLAGS)) ||
|
||||||
!(migratableDefDst = qemuDomainDefCopy(driver, dst, flags)))
|
!(migratableDefDst = qemuDomainDefCopy(driver, dst, COPY_FLAGS)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuDomainMigratableDefCheckABIStability(driver,
|
ret = qemuDomainMigratableDefCheckABIStability(driver,
|
||||||
@ -5945,6 +5946,36 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
qemuDomainCheckABIStability(virQEMUDriverPtr driver,
|
||||||
|
virDomainObjPtr vm,
|
||||||
|
virDomainDefPtr dst)
|
||||||
|
{
|
||||||
|
virDomainDefPtr migratableSrc = NULL;
|
||||||
|
virDomainDefPtr migratableDst = NULL;
|
||||||
|
char *xml = NULL;
|
||||||
|
bool ret = false;
|
||||||
|
|
||||||
|
if (!(xml = qemuDomainFormatXML(driver, vm, COPY_FLAGS)) ||
|
||||||
|
!(migratableSrc = qemuDomainDefFromXML(driver, xml)) ||
|
||||||
|
!(migratableDst = qemuDomainDefCopy(driver, dst, COPY_FLAGS)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
ret = qemuDomainMigratableDefCheckABIStability(driver,
|
||||||
|
vm->def, migratableSrc,
|
||||||
|
dst, migratableDst);
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
VIR_FREE(xml);
|
||||||
|
virDomainDefFree(migratableSrc);
|
||||||
|
virDomainDefFree(migratableDst);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef COPY_FLAGS
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
qemuDomainAgentAvailable(virDomainObjPtr vm,
|
qemuDomainAgentAvailable(virDomainObjPtr vm,
|
||||||
bool reportError)
|
bool reportError)
|
||||||
|
@ -666,6 +666,10 @@ bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
|
|||||||
virDomainDefPtr src,
|
virDomainDefPtr src,
|
||||||
virDomainDefPtr dst);
|
virDomainDefPtr dst);
|
||||||
|
|
||||||
|
bool qemuDomainCheckABIStability(virQEMUDriverPtr driver,
|
||||||
|
virDomainObjPtr vm,
|
||||||
|
virDomainDefPtr dst);
|
||||||
|
|
||||||
bool qemuDomainAgentAvailable(virDomainObjPtr vm,
|
bool qemuDomainAgentAvailable(virDomainObjPtr vm,
|
||||||
bool reportError);
|
bool reportError);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user