[libvirt] [PATCH 3/3] qemu: XMLToNative: Parse XML as INACTIVE

Cole Robinson crobinso at redhat.com
Thu Mar 13 19:13:06 UTC 2014


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
---
 src/qemu/qemu_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a01739c..89f443f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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;
 
-- 
1.8.5.3




More information about the libvir-list mailing list