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