mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 11:01:19 +00:00
XMLToNative: Parse XML as INACTIVE
Right now we are parsing the XML as though it's live, which for example will choke on hardcoded XML like: <seclabel type='dynamic' model='selinux' relabel='yes'/> Erroring with: $ sudo virsh domxml-to-native qemu-argv f error: XML error: security label is missing All drivers are fixed, but only qemu was tested.
This commit is contained in:
parent
3b79321ad0
commit
fbf14e8294
@ -2836,7 +2836,8 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
|
||||
}
|
||||
|
||||
def = virDomainDefParseString(domainXml, priv->caps, priv->xmlopt,
|
||||
1 << VIR_DOMAIN_VIRT_VMWARE, 0);
|
||||
1 << VIR_DOMAIN_VIRT_VMWARE,
|
||||
VIR_DOMAIN_XML_INACTIVE);
|
||||
|
||||
if (!def) {
|
||||
return NULL;
|
||||
|
@ -2979,7 +2979,8 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
|
||||
|
||||
if (!(def = virDomainDefParseString(domainXml,
|
||||
cfg->caps, driver->xmlopt,
|
||||
1 << VIR_DOMAIN_VIRT_XEN, 0)))
|
||||
1 << VIR_DOMAIN_VIRT_XEN,
|
||||
VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(conf = xenFormatXM(conn, def, cfg->verInfo->xen_version_major)))
|
||||
|
@ -5812,7 +5812,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
|
||||
goto cleanup;
|
||||
|
||||
def = virDomainDefParseString(xmlData, caps, driver->xmlopt,
|
||||
QEMU_EXPECTED_VIRT_TYPES, 0);
|
||||
QEMU_EXPECTED_VIRT_TYPES,
|
||||
VIR_DOMAIN_XML_INACTIVE);
|
||||
if (!def)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -1657,7 +1657,8 @@ xenUnifiedConnectDomainXMLToNative(virConnectPtr conn,
|
||||
}
|
||||
|
||||
if (!(def = virDomainDefParseString(xmlData, priv->caps, priv->xmlopt,
|
||||
1 << VIR_DOMAIN_VIRT_XEN, 0)))
|
||||
1 << VIR_DOMAIN_VIRT_XEN,
|
||||
VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
if (STREQ(format, XEN_CONFIG_FORMAT_XM)) {
|
||||
|
Loading…
Reference in New Issue
Block a user