mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
qemu: Pass correct qemuCaps to virDomainDefParseString
Since qemuDomainDefPostParse callback requires qemuCaps, we need to make sure it gets the capabilities stored in the domain's private data if the domain is running. Passing NULL may cause QEMU capabilities probing to be triggered in case QEMU binary changed in the meantime. When this happens while a running domain object is locked, QMP event delivered to the domain before QEMU capabilities probing finishes will deadlock the event loop. This patch fixes all paths leading to virDomainDefParseString. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
b900f7387f
commit
6e7c33dad7
@ -3437,7 +3437,8 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver,
|
|||||||
if (xmlin) {
|
if (xmlin) {
|
||||||
virDomainDefPtr def = NULL;
|
virDomainDefPtr def = NULL;
|
||||||
|
|
||||||
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt, NULL,
|
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt,
|
||||||
|
priv->qemuCaps,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) {
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) {
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -15907,7 +15908,8 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
|||||||
if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps,
|
if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps,
|
||||||
vm->def, priv->origCPU,
|
vm->def, priv->origCPU,
|
||||||
true, true)) ||
|
true, true)) ||
|
||||||
!(def->parent.dom = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
!(def->parent.dom = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||||
|
priv->qemuCaps,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||||
goto endjob;
|
goto endjob;
|
||||||
@ -17008,7 +17010,8 @@ qemuDomainCheckpointPrepare(virQEMUDriverPtr driver, virCapsPtr caps,
|
|||||||
if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps,
|
if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps,
|
||||||
vm->def, priv->origCPU,
|
vm->def, priv->origCPU,
|
||||||
true, true)) ||
|
true, true)) ||
|
||||||
!(def->parent.dom = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
!(def->parent.dom = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||||
|
priv->qemuCaps,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user