|
|
d759b5 |
From 9b636a691bab67fbce7455501e0b1a9036a56643 Mon Sep 17 00:00:00 2001
|
|
|
d759b5 |
Message-Id: <9b636a691bab67fbce7455501e0b1a9036a56643@dist-git>
|
|
|
7b4659 |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7b4659 |
Date: Fri, 16 Aug 2019 14:52:36 +0200
|
|
|
7b4659 |
Subject: [PATCH] qemu: Pass correct qemuCaps to virDomainDeviceDefPostParse
|
|
|
7b4659 |
MIME-Version: 1.0
|
|
|
7b4659 |
Content-Type: text/plain; charset=UTF-8
|
|
|
7b4659 |
Content-Transfer-Encoding: 8bit
|
|
|
7b4659 |
|
|
|
7b4659 |
Since qemuDomainDeviceDefPostParse callback requires qemuCaps, we need
|
|
|
7b4659 |
to make sure it gets the capabilities stored in the domain's private
|
|
|
7b4659 |
data if the domain is running. Passing NULL may cause QEMU capabilities
|
|
|
7b4659 |
probing to be triggered in case QEMU binary changed in the meantime.
|
|
|
7b4659 |
When this happens while a running domain object is locked, QMP event
|
|
|
7b4659 |
delivered to the domain before QEMU capabilities probing finishes will
|
|
|
7b4659 |
deadlock the event loop.
|
|
|
7b4659 |
|
|
|
7b4659 |
QEMU capabilities lookup (via domainPostParseDataAlloc callback) is
|
|
|
7b4659 |
hidden inside virDomainDeviceDefPostParseOne with no way to pass
|
|
|
7b4659 |
qemuCaps to virDomainDeviceDef* functions. This patch fixes all
|
|
|
7b4659 |
remaining paths leading to virDomainDeviceDefPostParse.
|
|
|
7b4659 |
|
|
|
7b4659 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7b4659 |
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
|
7b4659 |
(cherry picked from commit b449c270416468ec8b73670b49a9aff87c8902a2)
|
|
|
7b4659 |
|
|
|
7b4659 |
Conflicts:
|
|
|
7b4659 |
src/conf/domain_conf.c
|
|
|
7b4659 |
src/conf/domain_conf.h
|
|
|
7b4659 |
- context
|
|
|
7b4659 |
|
|
|
7b4659 |
src/lxc/lxc_driver.c
|
|
|
7b4659 |
- lxcDomainUpdateDeviceFlags is different upstream
|
|
|
7b4659 |
|
|
|
7b4659 |
src/qemu/qemu_driver.c
|
|
|
7b4659 |
- qemuDomainAttachDeviceLiveAndConfig is different upstream
|
|
|
7b4659 |
|
|
|
7b4659 |
src/uml/uml_driver.c
|
|
|
7b4659 |
- uml driver was removed upstream
|
|
|
7b4659 |
|
|
|
7b4659 |
https://bugzilla.redhat.com/show_bug.cgi?id=1731783
|
|
|
7b4659 |
|
|
|
7b4659 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7b4659 |
Message-Id: <26b6c56b3da907b14e201b23bec6164037151fb6.1565959866.git.jdenemar@redhat.com>
|
|
|
7b4659 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
7b4659 |
---
|
|
|
7b4659 |
src/conf/domain_conf.c | 23 ++++++++++++++---------
|
|
|
7b4659 |
src/conf/domain_conf.h | 4 +++-
|
|
|
7b4659 |
src/libxl/libxl_driver.c | 12 ++++++------
|
|
|
7b4659 |
src/lxc/lxc_driver.c | 12 ++++++------
|
|
|
7b4659 |
src/openvz/openvz_driver.c | 2 +-
|
|
|
7b4659 |
src/phyp/phyp_driver.c | 2 +-
|
|
|
7b4659 |
src/qemu/qemu_driver.c | 19 +++++++++++--------
|
|
|
7b4659 |
src/uml/uml_driver.c | 3 ++-
|
|
|
7b4659 |
src/vbox/vbox_common.c | 4 ++--
|
|
|
7b4659 |
tests/qemuhotplugtest.c | 2 +-
|
|
|
7b4659 |
10 files changed, 47 insertions(+), 36 deletions(-)
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
7b4659 |
index 0fdf1742fd..637d971e21 100644
|
|
|
7b4659 |
--- a/src/conf/domain_conf.c
|
|
|
7b4659 |
+++ b/src/conf/domain_conf.c
|
|
|
7b4659 |
@@ -4961,22 +4961,24 @@ virDomainDeviceDefPostParseOne(virDomainDeviceDefPtr dev,
|
|
|
7b4659 |
const virDomainDef *def,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
unsigned int flags,
|
|
|
7b4659 |
- virDomainXMLOptionPtr xmlopt)
|
|
|
7b4659 |
+ virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
- void *parseOpaque = NULL;
|
|
|
7b4659 |
+ void *data = NULL;
|
|
|
7b4659 |
int ret;
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (xmlopt->config.domainPostParseDataAlloc) {
|
|
|
7b4659 |
+ if (!parseOpaque && xmlopt->config.domainPostParseDataAlloc) {
|
|
|
7b4659 |
if (xmlopt->config.domainPostParseDataAlloc(def, caps, flags,
|
|
|
7b4659 |
xmlopt->config.priv,
|
|
|
7b4659 |
- &parseOpaque) < 0)
|
|
|
7b4659 |
+ &data) < 0)
|
|
|
7b4659 |
return -1;
|
|
|
7b4659 |
+ parseOpaque = data;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
ret = virDomainDeviceDefPostParse(dev, def, caps, flags, xmlopt, parseOpaque);
|
|
|
7b4659 |
|
|
|
7b4659 |
- if (parseOpaque && xmlopt->config.domainPostParseDataFree)
|
|
|
7b4659 |
- xmlopt->config.domainPostParseDataFree(parseOpaque);
|
|
|
7b4659 |
+ if (data && xmlopt->config.domainPostParseDataFree)
|
|
|
7b4659 |
+ xmlopt->config.domainPostParseDataFree(data);
|
|
|
7b4659 |
|
|
|
7b4659 |
return ret;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -16321,6 +16323,7 @@ virDomainDeviceDefParse(const char *xmlStr,
|
|
|
7b4659 |
const virDomainDef *def,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque,
|
|
|
7b4659 |
unsigned int flags)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
xmlDocPtr xml;
|
|
|
7b4659 |
@@ -16482,7 +16485,8 @@ virDomainDeviceDefParse(const char *xmlStr,
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
/* callback to fill driver specific device aspects */
|
|
|
7b4659 |
- if (virDomainDeviceDefPostParseOne(dev, def, caps, flags, xmlopt) < 0)
|
|
|
7b4659 |
+ if (virDomainDeviceDefPostParseOne(dev, def, caps, flags,
|
|
|
7b4659 |
+ xmlopt, parseOpaque) < 0)
|
|
|
7b4659 |
goto error;
|
|
|
7b4659 |
|
|
|
7b4659 |
/* validate the configuration */
|
|
|
7b4659 |
@@ -29593,7 +29597,8 @@ virDomainDeviceDefPtr
|
|
|
7b4659 |
virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
|
|
|
7b4659 |
const virDomainDef *def,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
- virDomainXMLOptionPtr xmlopt)
|
|
|
7b4659 |
+ virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque)
|
|
|
7b4659 |
{
|
|
|
7b4659 |
virDomainDeviceDefPtr ret = NULL;
|
|
|
7b4659 |
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
|
|
7b4659 |
@@ -29682,7 +29687,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
xmlStr = virBufferContentAndReset(&buf;;
|
|
|
7b4659 |
- ret = virDomainDeviceDefParse(xmlStr, def, caps, xmlopt,
|
|
|
7b4659 |
+ ret = virDomainDeviceDefParse(xmlStr, def, caps, xmlopt, parseOpaque,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
|
|
7b4659 |
index 9e4fed6d4e..0989368e7c 100644
|
|
|
7b4659 |
--- a/src/conf/domain_conf.h
|
|
|
7b4659 |
+++ b/src/conf/domain_conf.h
|
|
|
7b4659 |
@@ -2906,7 +2906,8 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
|
|
|
7b4659 |
virDomainDeviceDefPtr virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
|
|
|
7b4659 |
const virDomainDef *def,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
- virDomainXMLOptionPtr xmlopt);
|
|
|
7b4659 |
+ virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque);
|
|
|
7b4659 |
int virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
|
|
|
7b4659 |
int type);
|
|
|
7b4659 |
virDomainDeviceInfoPtr virDomainDeviceGetInfo(virDomainDeviceDefPtr device);
|
|
|
7b4659 |
@@ -3039,6 +3040,7 @@ virDomainDeviceDefPtr virDomainDeviceDefParse(const char *xmlStr,
|
|
|
7b4659 |
const virDomainDef *def,
|
|
|
7b4659 |
virCapsPtr caps,
|
|
|
7b4659 |
virDomainXMLOptionPtr xmlopt,
|
|
|
7b4659 |
+ void *parseOpaque,
|
|
|
7b4659 |
unsigned int flags);
|
|
|
7b4659 |
virDomainDiskDefPtr virDomainDiskDefParse(const char *xmlStr,
|
|
|
7b4659 |
const virDomainDef *def,
|
|
|
7b4659 |
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
|
|
|
7b4659 |
index be6b66ce7e..1eb63c5b64 100644
|
|
|
7b4659 |
--- a/src/libxl/libxl_driver.c
|
|
|
7b4659 |
+++ b/src/libxl/libxl_driver.c
|
|
|
7b4659 |
@@ -3955,7 +3955,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- cfg->caps, driver->xmlopt,
|
|
|
7b4659 |
+ cfg->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -3972,7 +3972,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
/* If dev exists it was created to modify the domain config. Free it. */
|
|
|
7b4659 |
virDomainDeviceDefFree(dev);
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- cfg->caps, driver->xmlopt,
|
|
|
7b4659 |
+ cfg->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -4044,7 +4044,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- cfg->caps, driver->xmlopt,
|
|
|
7b4659 |
+ cfg->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
@@ -4062,7 +4062,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
/* If dev exists it was created to modify the domain config. Free it. */
|
|
|
7b4659 |
virDomainDeviceDefFree(dev);
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- cfg->caps, driver->xmlopt,
|
|
|
7b4659 |
+ cfg->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
@@ -4132,7 +4132,7 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
|
|
|
7b4659 |
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- cfg->caps, driver->xmlopt,
|
|
|
7b4659 |
+ cfg->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
@@ -4151,7 +4151,7 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
/* If dev exists it was created to modify the domain config. Free it. */
|
|
|
7b4659 |
virDomainDeviceDefFree(dev);
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- cfg->caps, driver->xmlopt,
|
|
|
7b4659 |
+ cfg->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
|
|
|
7b4659 |
index b182fa3759..5978183e7f 100644
|
|
|
7b4659 |
--- a/src/lxc/lxc_driver.c
|
|
|
7b4659 |
+++ b/src/lxc/lxc_driver.c
|
|
|
7b4659 |
@@ -4736,7 +4736,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt,
|
|
|
7b4659 |
+ caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
@@ -4748,7 +4748,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
* to CONFIG takes one instance.
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
dev_copy = virDomainDeviceDefCopy(dev, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt);
|
|
|
7b4659 |
+ caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!dev_copy)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -4851,7 +4851,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt,
|
|
|
7b4659 |
+ caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
@@ -4863,7 +4863,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
* to CONFIG takes one instance.
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
dev_copy = virDomainDeviceDefCopy(dev, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt);
|
|
|
7b4659 |
+ caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!dev_copy)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -4941,7 +4941,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
|
|
|
7b4659 |
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt,
|
|
|
7b4659 |
+ caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
@@ -4954,7 +4954,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
* to CONFIG takes one instance.
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
dev_copy = virDomainDeviceDefCopy(dev, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt);
|
|
|
7b4659 |
+ caps, driver->xmlopt, NULL);
|
|
|
7b4659 |
if (!dev_copy)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
|
|
|
7b4659 |
index 14295dfda0..d6efb70209 100644
|
|
|
7b4659 |
--- a/src/openvz/openvz_driver.c
|
|
|
7b4659 |
+++ b/src/openvz/openvz_driver.c
|
|
|
7b4659 |
@@ -1972,7 +1972,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
|
|
|
7b4659 |
if (!(def = virDomainObjGetOneDef(vm, flags)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
- dev = virDomainDeviceDefParse(xml, def, driver->caps, driver->xmlopt,
|
|
|
7b4659 |
+ dev = virDomainDeviceDefParse(xml, def, driver->caps, driver->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
if (!dev)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
|
|
|
7b4659 |
index 67ce7903ba..430472e724 100644
|
|
|
7b4659 |
--- a/src/phyp/phyp_driver.c
|
|
|
7b4659 |
+++ b/src/phyp/phyp_driver.c
|
|
|
7b4659 |
@@ -1721,7 +1721,7 @@ phypDomainAttachDevice(virDomainPtr domain, const char *xml)
|
|
|
7b4659 |
|
|
|
7b4659 |
def->os.type = VIR_DOMAIN_OSTYPE_LINUX;
|
|
|
7b4659 |
|
|
|
7b4659 |
- dev = virDomainDeviceDefParse(xml, def, phyp_driver->caps, NULL,
|
|
|
7b4659 |
+ dev = virDomainDeviceDefParse(xml, def, phyp_driver->caps, NULL, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
if (!dev)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
7b4659 |
index 00213a5f80..8ecdcf3440 100644
|
|
|
7b4659 |
--- a/src/qemu/qemu_driver.c
|
|
|
7b4659 |
+++ b/src/qemu/qemu_driver.c
|
|
|
7b4659 |
@@ -8405,7 +8405,7 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt,
|
|
|
7b4659 |
+ caps, driver->xmlopt, priv->qemuCaps,
|
|
|
7b4659 |
parse_flags);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
@@ -8419,7 +8419,8 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
|
|
|
7b4659 |
* create a deep copy of device as adding
|
|
|
7b4659 |
* to CONFIG takes one instance.
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
- dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps, driver->xmlopt);
|
|
|
7b4659 |
+ dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps, driver->xmlopt,
|
|
|
7b4659 |
+ priv->qemuCaps);
|
|
|
7b4659 |
if (!dev_copy)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -8567,8 +8568,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
!(flags & VIR_DOMAIN_AFFECT_LIVE))
|
|
|
7b4659 |
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
|
|
|
7b4659 |
|
|
|
7b4659 |
- dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt,
|
|
|
7b4659 |
+ dev = dev_copy = virDomainDeviceDefParse(xml, vm->def, caps,
|
|
|
7b4659 |
+ driver->xmlopt, priv->qemuCaps,
|
|
|
7b4659 |
parse_flags);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
@@ -8579,7 +8580,8 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
|
|
|
7b4659 |
* create a deep copy of device as adding
|
|
|
7b4659 |
* to CONFIG takes one instance.
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
- dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps, driver->xmlopt);
|
|
|
7b4659 |
+ dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps,
|
|
|
7b4659 |
+ driver->xmlopt, priv->qemuCaps);
|
|
|
7b4659 |
if (!dev_copy)
|
|
|
7b4659 |
goto endjob;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
@@ -8665,8 +8667,8 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
|
|
|
7b4659 |
!(flags & VIR_DOMAIN_AFFECT_LIVE))
|
|
|
7b4659 |
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
|
|
|
7b4659 |
|
|
|
7b4659 |
- dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
|
|
|
7b4659 |
- caps, driver->xmlopt,
|
|
|
7b4659 |
+ dev = dev_copy = virDomainDeviceDefParse(xml, vm->def, caps,
|
|
|
7b4659 |
+ driver->xmlopt, priv->qemuCaps,
|
|
|
7b4659 |
parse_flags);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
@@ -8677,7 +8679,8 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
|
|
|
7b4659 |
* create a deep copy of device as adding
|
|
|
7b4659 |
* to CONFIG takes one instance.
|
|
|
7b4659 |
*/
|
|
|
7b4659 |
- dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps, driver->xmlopt);
|
|
|
7b4659 |
+ dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps,
|
|
|
7b4659 |
+ driver->xmlopt, priv->qemuCaps);
|
|
|
7b4659 |
if (!dev_copy)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
}
|
|
|
7b4659 |
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
|
|
|
7b4659 |
index 796de53d43..175d6c9c2e 100644
|
|
|
7b4659 |
--- a/src/uml/uml_driver.c
|
|
|
7b4659 |
+++ b/src/uml/uml_driver.c
|
|
|
7b4659 |
@@ -2089,7 +2089,7 @@ static int umlDomainAttachDevice(virDomainPtr dom, const char *xml)
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
dev = virDomainDeviceDefParse(xml, vm->def, driver->caps, driver->xmlopt,
|
|
|
7b4659 |
- VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
+ NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
@@ -2202,6 +2202,7 @@ static int umlDomainDetachDevice(virDomainPtr dom, const char *xml)
|
|
|
7b4659 |
}
|
|
|
7b4659 |
|
|
|
7b4659 |
dev = virDomainDeviceDefParse(xml, vm->def, driver->caps, driver->xmlopt,
|
|
|
7b4659 |
+ NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
|
|
|
7b4659 |
index 46d2b7afa3..eed7c83913 100644
|
|
|
7b4659 |
--- a/src/vbox/vbox_common.c
|
|
|
7b4659 |
+++ b/src/vbox/vbox_common.c
|
|
|
7b4659 |
@@ -4313,7 +4313,7 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
|
|
|
7b4659 |
|
|
|
7b4659 |
def->os.type = VIR_DOMAIN_OSTYPE_HVM;
|
|
|
7b4659 |
|
|
|
7b4659 |
- dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt,
|
|
|
7b4659 |
+ dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
@@ -4432,7 +4432,7 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
|
|
|
7b4659 |
|
|
|
7b4659 |
def->os.type = VIR_DOMAIN_OSTYPE_HVM;
|
|
|
7b4659 |
|
|
|
7b4659 |
- dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt,
|
|
|
7b4659 |
+ dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt, NULL,
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
|
|
7b4659 |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
|
|
7b4659 |
if (dev == NULL)
|
|
|
7b4659 |
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
|
|
|
7b4659 |
index 2dbf768e16..b202ade286 100644
|
|
|
7b4659 |
--- a/tests/qemuhotplugtest.c
|
|
|
7b4659 |
+++ b/tests/qemuhotplugtest.c
|
|
|
7b4659 |
@@ -272,7 +272,7 @@ testQemuHotplug(const void *data)
|
|
|
7b4659 |
device_parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
|
|
|
7b4659 |
|
|
|
7b4659 |
if (!(dev = virDomainDeviceDefParse(device_xml, vm->def,
|
|
|
7b4659 |
- caps, driver.xmlopt,
|
|
|
7b4659 |
+ caps, driver.xmlopt, NULL,
|
|
|
7b4659 |
device_parse_flags)))
|
|
|
7b4659 |
goto cleanup;
|
|
|
7b4659 |
|
|
|
7b4659 |
--
|
|
|
7b4659 |
2.22.1
|
|
|
7b4659 |
|