mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: Pass qemuCaps to qemuMigrationCookieXMLParse
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 qemuMigrationCookieXMLParse. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
6e7c33dad7
commit
bf15b145ec
@ -1197,6 +1197,7 @@ qemuMigrationCookieCapsXMLParse(xmlXPathContextPtr ctxt)
|
|||||||
static int
|
static int
|
||||||
qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
|
virQEMUCapsPtr qemuCaps,
|
||||||
xmlDocPtr doc,
|
xmlDocPtr doc,
|
||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
@ -1338,7 +1339,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
mig->persistent = virDomainDefParseNode(doc, nodes[0],
|
mig->persistent = virDomainDefParseNode(doc, nodes[0],
|
||||||
caps, driver->xmlopt, NULL,
|
caps, driver->xmlopt, qemuCaps,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION |
|
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
||||||
@ -1391,6 +1392,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
static int
|
static int
|
||||||
qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig,
|
qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
|
virQEMUCapsPtr qemuCaps,
|
||||||
const char *xml,
|
const char *xml,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
@ -1403,7 +1405,7 @@ qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig,
|
|||||||
if (!(doc = virXMLParseStringCtxt(xml, _("(qemu_migration_cookie)"), &ctxt)))
|
if (!(doc = virXMLParseStringCtxt(xml, _("(qemu_migration_cookie)"), &ctxt)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
ret = qemuMigrationCookieXMLParse(mig, driver, doc, ctxt, flags);
|
ret = qemuMigrationCookieXMLParse(mig, driver, qemuCaps, doc, ctxt, flags);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
xmlXPathFreeContext(ctxt);
|
xmlXPathFreeContext(ctxt);
|
||||||
@ -1505,6 +1507,7 @@ qemuMigrationEatCookie(virQEMUDriverPtr driver,
|
|||||||
if (cookiein && cookieinlen &&
|
if (cookiein && cookieinlen &&
|
||||||
qemuMigrationCookieXMLParseStr(mig,
|
qemuMigrationCookieXMLParseStr(mig,
|
||||||
driver,
|
driver,
|
||||||
|
priv->qemuCaps,
|
||||||
cookiein,
|
cookiein,
|
||||||
flags) < 0)
|
flags) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user