]> xenbits.xensource.com Git - libvirt.git/commitdiff
XMLToNative: Parse XML as INACTIVE
authorCole Robinson <crobinso@redhat.com>
Thu, 13 Mar 2014 19:10:45 +0000 (15:10 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 14 Mar 2014 21:33:29 +0000 (17:33 -0400)
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.

src/esx/esx_driver.c
src/libxl/libxl_driver.c
src/qemu/qemu_driver.c
src/xen/xen_driver.c

index 886d984216f7dc9219a70925068bc4152050e910..6a2efe31b28ef5d1f6c28ec0cac4483f73bfa79b 100644 (file)
@@ -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;
index ae7342a9baca955583baadec94523951726a2092..09ae0755a2cdb481bab2138afb5819afecb5c15b 100644 (file)
@@ -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)))
index a01739c81580c50480ee7ac4399919c6b614b664..89f443f5fe180f39c7e164cf79c7bba94a204ff6 100644 (file)
@@ -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;
 
index 1880b22cb0bc555140d611a703f9db438b616b04..9204f888a309fdf6e541820ba2a187cb1819fc45 100644 (file)
@@ -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)) {