diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 683a2321481b34a93b9cd33fa7c5792a98f5f25c..886245c244fcade1e73ae9f38d98749221765649 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -409,6 +409,8 @@ virDomainMemoryFindByDef; virDomainMemoryFindInactiveByDef; virDomainMemoryInsert; virDomainMemoryRemove; +virDomainMemorySourceTypeFromString; +virDomainMemorySourceTypeToString; virDomainNetAppendIPAddress; virDomainNetDefClear; virDomainNetDefFormat; diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 78f55c0e77ef362d41ab756aaf417ee8ecdd4ba4..d8b88386dbb2fd639e15480979ac47a770d656a0 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -910,7 +910,7 @@ virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver) return virDomainXMLOptionNew(&virQEMUDriverDomainDefParserConfig, &virQEMUDriverPrivateDataCallbacks, &virQEMUDriverDomainXMLNamespace, - NULL); + &virQEMUDriverDomainABIStability); } diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 173334dfb931d2cfe2f1d3a32d1323fc26178aad..6986324897c80831e29f57bb5469fd4d2aad43ae 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5820,6 +5820,28 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver, } +static bool +qemuDomainABIStabilityCheck(const virDomainDef *src, + const virDomainDef *dst) +{ + if (src->mem.source != dst->mem.source) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target memoryBacking source '%s' doesn't " + "match source memoryBacking source'%s'"), + virDomainMemorySourceTypeToString(dst->mem.source), + virDomainMemorySourceTypeToString(src->mem.source)); + return false; + } + + return true; +} + + +virDomainABIStability virQEMUDriverDomainABIStability = { + .domain = qemuDomainABIStabilityCheck, +}; + + bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, virDomainDefPtr src, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index aebd91ad37fd6eb613b1f3b8a53adfba57225156..829f7746e7113f722600da70f7f309ca5317745e 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -636,6 +636,7 @@ void qemuDomainCleanupRun(virQEMUDriverPtr driver, extern virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks; extern virDomainXMLNamespace virQEMUDriverDomainXMLNamespace; extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig; +extern virDomainABIStability virQEMUDriverDomainABIStability; int qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob);