]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Swap order of AddImplicitControllers and DomainDefPostParse
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Mon, 17 Jun 2013 14:17:37 +0000 (16:17 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 28 Jun 2013 07:52:00 +0000 (09:52 +0200)
Implicit controllers may be dependent on device definitions altered
in a post-parse callback. Specifically, if a console device is
defined without the target type, the type will be set in QEMU's
callback. In the case of s390, this is virtio, which requires
an implicit virtio-serial controller.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/conf/domain_conf.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-balloon-device-auto.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-channel-virtio-auto.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-console-virtio.xml
tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-scsi-device-auto.xml

index e41dfa2e66f25de63ff601fc397eb801047a7c9b..011de7127a210b7911c71726c3a1075cd7e78840 100644 (file)
@@ -12111,14 +12111,14 @@ virDomainDefParseXML(xmlDocPtr xml,
         (def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0)
         goto error;
 
-    /* Auto-add any implied controllers which aren't present */
-    if (virDomainDefAddImplicitControllers(def) < 0)
-        goto error;
-
     /* callback to fill driver specific domain aspects */
     if (virDomainDefPostParse(def, caps, xmlopt) < 0)
         goto error;
 
+    /* Auto-add any implied controllers which aren't present */
+    if (virDomainDefAddImplicitControllers(def) < 0)
+        goto error;
+
     virHashFree(bootHash);
 
     return def;
index 6aed326c635e90b1873d656fe6f5525397f75fbe..380b70f1e809d6c658918e084fe391bf1a37008e 100644 (file)
@@ -20,8 +20,8 @@
       <address type='drive' controller='0' bus='0' target='0' unit='0'/>
     </disk>
     <controller type='usb' index='0'/>
-    <controller type='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
+    <controller type='ide' index='0'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>
index 017527266aadcace272fad619bb1ed781efba07a..fd6b8524e84773158a880f4262ba922f28259986 100644 (file)
@@ -25,8 +25,8 @@
     <controller type='virtio-serial' index='1'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
     </controller>
-    <controller type='virtio-serial' index='2'/>
     <controller type='pci' index='0' model='pci-root'/>
+    <controller type='virtio-serial' index='2'/>
     <channel type='pty'>
       <target type='virtio' name='org.linux-kvm.port.0'/>
       <address type='virtio-serial' controller='0' bus='0' port='1'/>
index 3c865c3011713acbd881e54089ee1bb08e71e754..340430e3d1dbd8f02500b7e88b6782f852911ab1 100644 (file)
@@ -21,8 +21,8 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
-    <controller type='virtio-serial' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
+    <controller type='virtio-serial' index='0'/>
     <console type='pty'>
       <target type='virtio' port='0'/>
     </console>
index 7d152bc7b6a8a6f540c97899f8b738f22fc65139..5ec1e9422ec053d1a5ee9f9628adea7f8e858a2b 100644 (file)
@@ -26,8 +26,8 @@
     </disk>
     <controller type='usb' index='0'/>
     <controller type='ide' index='0'/>
-    <controller type='scsi' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
+    <controller type='scsi' index='0'/>
     <memballoon model='virtio'/>
   </devices>
 </domain>