---
src/conf/domain_conf.c | 4 +++-
src/conf/domain_conf.h | 2 ++
src/libxl/libxl_driver.c | 6 ++++--
src/lxc/lxc_driver.c | 6 ++++--
src/openvz/openvz_driver.c | 4 ++--
src/phyp/phyp_driver.c | 4 ++--
src/qemu/qemu_driver.c | 11 +++++++----
src/uml/uml_driver.c | 4 ++--
src/vbox/vbox_tmpl.c | 8 ++++----
src/xen/xend_internal.c | 6 +++---
src/xen/xm_internal.c | 2 ++
11 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6766775..39c1eed 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8381,6 +8381,7 @@ virDomainPMStateParseXML(xmlXPathContextPtr ctxt,
virDomainDeviceDefPtr
virDomainDeviceDefParse(virCapsPtr caps,
+ virDomainXMLConfPtr xmlconf,
virDomainDefPtr def,
const char *xmlStr,
unsigned int flags)
@@ -16385,6 +16386,7 @@ virDomainNetFind(virDomainDefPtr def, const char *device)
*/
virDomainDeviceDefPtr
virDomainDeviceDefCopy(virCapsPtr caps,
+ virDomainXMLConfPtr xmlconf,
const virDomainDefPtr def,
virDomainDeviceDefPtr src)
{
@@ -16453,7 +16455,7 @@ virDomainDeviceDefCopy(virCapsPtr caps,
goto cleanup;
xmlStr = virBufferContentAndReset(&buf);
- ret = virDomainDeviceDefParse(caps, def, xmlStr, flags);
+ ret = virDomainDeviceDefParse(caps, xmlconf, def, xmlStr, flags);
cleanup:
VIR_FREE(xmlStr);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 98a5c37..b9bfd31 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2025,6 +2025,7 @@ void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def);
void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def);
void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
virDomainDeviceDefPtr virDomainDeviceDefCopy(virCapsPtr caps,
+ virDomainXMLConfPtr xmlconf,
const virDomainDefPtr def,
virDomainDeviceDefPtr src);
int virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
@@ -2087,6 +2088,7 @@ void virDomainObjListRemove(virDomainObjListPtr doms,
virDomainObjPtr dom);
virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
+ virDomainXMLConfPtr xmlconf,
virDomainDefPtr def,
const char *xmlStr,
unsigned int flags);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 40a7a6b..af1f9a9 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3556,7 +3556,8 @@ libxlDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
priv = vm->privateData;
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
- if (!(dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
+ if (!(dev = virDomainDeviceDefParse(driver->caps, driver->xmlconf,
+ vm->def, xml,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
@@ -3586,7 +3587,8 @@ libxlDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
if (flags & VIR_DOMAIN_DEVICE_MODIFY_LIVE) {
/* If dev exists it was created to modify the domain config. Free it. */
virDomainDeviceDefFree(dev);
- if (!(dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
+ if (!(dev = virDomainDeviceDefParse(driver->caps, driver->xmlconf,
+ vm->def, xml,
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 59bb786..97dd3b4 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -4337,7 +4337,8 @@ lxcDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
goto cleanup;
}
- dev = dev_copy = virDomainDeviceDefParse(driver->caps, vm->def, xml,
+ dev = dev_copy = virDomainDeviceDefParse(driver->caps, driver->xmlconf,
+ vm->def, xml,
VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
goto cleanup;
@@ -4348,7 +4349,8 @@ lxcDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
* create a deep copy of device as adding
* to CONFIG takes one instance.
*/
- dev_copy = virDomainDeviceDefCopy(driver->caps, vm->def, dev);
+ dev_copy = virDomainDeviceDefCopy(driver->caps, driver->xmlconf,
+ vm->def, dev);
if (!dev_copy)
goto cleanup;
}
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index 67d66ae..d537185 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -2085,8 +2085,8 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
&vmdef) < 0)
goto cleanup;
- dev = virDomainDeviceDefParse(driver->caps, vmdef, xml,
- VIR_DOMAIN_XML_INACTIVE);
+ dev = virDomainDeviceDefParse(driver->caps, driver->xmlconf,
+ vmdef, xml, VIR_DOMAIN_XML_INACTIVE);
if (!dev)
goto cleanup;
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 59cc1ca..c35417b 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -1754,8 +1754,8 @@ phypAttachDevice(virDomainPtr domain, const char *xml)
goto cleanup;
}
- dev = virDomainDeviceDefParse(phyp_driver->caps, def, xml,
- VIR_DOMAIN_XML_INACTIVE);
+ dev = virDomainDeviceDefParse(phyp_driver->caps, NULL,
+ def, xml, VIR_DOMAIN_XML_INACTIVE);
if (!dev) {
goto cleanup;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8e0abc3..6101ee6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5774,7 +5774,8 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
tmp = dev->data.disk;
dev->data.disk = orig_disk;
- if (!(dev_copy = virDomainDeviceDefCopy(caps, vm->def, dev))) {
+ if (!(dev_copy = virDomainDeviceDefCopy(caps, driver->xmlconf,
+ vm->def, dev))) {
dev->data.disk = tmp;
goto end;
}
@@ -6050,7 +6051,8 @@ qemuDomainChangeDiskMediaLive(virDomainObjPtr vm,
tmp = dev->data.disk;
dev->data.disk = orig_disk;
- if (!(dev_copy = virDomainDeviceDefCopy(caps, vm->def, dev))) {
+ if (!(dev_copy = virDomainDeviceDefCopy(caps, driver->xmlconf,
+ vm->def, dev))) {
dev->data.disk = tmp;
goto end;
}
@@ -6449,7 +6451,8 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
goto endjob;
}
- dev = dev_copy = virDomainDeviceDefParse(caps, vm->def, xml,
+ dev = dev_copy = virDomainDeviceDefParse(caps, driver->xmlconf,
+ vm->def, xml,
VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
goto endjob;
@@ -6460,7 +6463,7 @@ qemuDomainModifyDeviceFlags(virDomainPtr dom, const char *xml,
* create a deep copy of device as adding
* to CONFIG takes one instance.
*/
- dev_copy = virDomainDeviceDefCopy(caps, vm->def, dev);
+ dev_copy = virDomainDeviceDefCopy(caps, driver->xmlconf, vm->def, dev);
if (!dev_copy)
goto endjob;
}
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index b08212d..3a8a98a 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -2080,7 +2080,7 @@ static int umlDomainAttachDevice(virDomainPtr dom, const char *xml)
goto cleanup;
}
- dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
+ dev = virDomainDeviceDefParse(driver->caps, driver->xmlconf, vm->def, xml,
VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
@@ -2198,7 +2198,7 @@ static int umlDomainDetachDevice(virDomainPtr dom, const char *xml)
{
goto cleanup;
}
- dev = virDomainDeviceDefParse(driver->caps, vm->def, xml,
+ dev = virDomainDeviceDefParse(driver->caps, driver->xmlconf, vm->def, xml,
VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
goto cleanup;
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index aa7466b..7a47067 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -5396,8 +5396,8 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
goto cleanup;
}
- dev = virDomainDeviceDefParse(data->caps, def, xml,
- VIR_DOMAIN_XML_INACTIVE);
+ dev = virDomainDeviceDefParse(data->caps, data->xmlconf,
+ def, xml, VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
goto cleanup;
@@ -5631,8 +5631,8 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
{
goto cleanup;
}
- dev = virDomainDeviceDefParse(data->caps, def, xml,
- VIR_DOMAIN_XML_INACTIVE);
+ dev = virDomainDeviceDefParse(data->caps, data->xmlconf,
+ def, xml, VIR_DOMAIN_XML_INACTIVE);
if (dev == NULL)
goto cleanup;
diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index 398da0d..93ba456 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -2519,7 +2519,7 @@ xenDaemonAttachDeviceFlags(virDomainPtr domain,
NULL)))
goto cleanup;
- if (!(dev = virDomainDeviceDefParse(priv->caps,
+ if (!(dev = virDomainDeviceDefParse(priv->caps, priv->xmlconf,
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
@@ -2679,7 +2679,7 @@ xenDaemonUpdateDeviceFlags(virDomainPtr domain,
NULL)))
goto cleanup;
- if (!(dev = virDomainDeviceDefParse(priv->caps,
+ if (!(dev = virDomainDeviceDefParse(priv->caps, priv->xmlconf,
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
@@ -2786,7 +2786,7 @@ xenDaemonDetachDeviceFlags(virDomainPtr domain,
NULL)))
goto cleanup;
- if (!(dev = virDomainDeviceDefParse(priv->caps,
+ if (!(dev = virDomainDeviceDefParse(priv->caps, priv->xmlconf,
def, xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index f6a3593..2a42e0a 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -1311,6 +1311,7 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain,
def = entry->def;
if (!(dev = virDomainDeviceDefParse(priv->caps,
+ priv->xmlconf,
entry->def,
xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
@@ -1404,6 +1405,7 @@ xenXMDomainDetachDeviceFlags(virDomainPtr domain,
def = entry->def;
if (!(dev = virDomainDeviceDefParse(priv->caps,
+ priv->xmlconf,
entry->def,
xml, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
--
1.8.1.5