conf: Swap order of AddImplicitControllers and DomainDefPostParse

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>
This commit is contained in:
Viktor Mihajlovski 2013-06-17 16:17:37 +02:00 committed by Ján Tomko
parent 38dc212296
commit b291a00aca
5 changed files with 8 additions and 8 deletions

View File

@ -12111,14 +12111,14 @@ virDomainDefParseXML(xmlDocPtr xml,
(def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0) (def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0)
goto error; goto error;
/* Auto-add any implied controllers which aren't present */
if (virDomainDefAddImplicitControllers(def) < 0)
goto error;
/* callback to fill driver specific domain aspects */ /* callback to fill driver specific domain aspects */
if (virDomainDefPostParse(def, caps, xmlopt) < 0) if (virDomainDefPostParse(def, caps, xmlopt) < 0)
goto error; goto error;
/* Auto-add any implied controllers which aren't present */
if (virDomainDefAddImplicitControllers(def) < 0)
goto error;
virHashFree(bootHash); virHashFree(bootHash);
return def; return def;

View File

@ -20,8 +20,8 @@
<address type='drive' controller='0' bus='0' target='0' unit='0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk> </disk>
<controller type='usb' index='0'/> <controller type='usb' index='0'/>
<controller type='ide' index='0'/>
<controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'/>
<memballoon model='virtio'/> <memballoon model='virtio'/>
</devices> </devices>
</domain> </domain>

View File

@ -25,8 +25,8 @@
<controller type='virtio-serial' index='1'> <controller type='virtio-serial' index='1'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</controller> </controller>
<controller type='virtio-serial' index='2'/>
<controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='0' model='pci-root'/>
<controller type='virtio-serial' index='2'/>
<channel type='pty'> <channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.0'/> <target type='virtio' name='org.linux-kvm.port.0'/>
<address type='virtio-serial' controller='0' bus='0' port='1'/> <address type='virtio-serial' controller='0' bus='0' port='1'/>

View File

@ -21,8 +21,8 @@
</disk> </disk>
<controller type='usb' index='0'/> <controller type='usb' index='0'/>
<controller type='ide' index='0'/> <controller type='ide' index='0'/>
<controller type='virtio-serial' index='0'/>
<controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='0' model='pci-root'/>
<controller type='virtio-serial' index='0'/>
<console type='pty'> <console type='pty'>
<target type='virtio' port='0'/> <target type='virtio' port='0'/>
</console> </console>

View File

@ -26,8 +26,8 @@
</disk> </disk>
<controller type='usb' index='0'/> <controller type='usb' index='0'/>
<controller type='ide' index='0'/> <controller type='ide' index='0'/>
<controller type='scsi' index='0'/>
<controller type='pci' index='0' model='pci-root'/> <controller type='pci' index='0' model='pci-root'/>
<controller type='scsi' index='0'/>
<memballoon model='virtio'/> <memballoon model='virtio'/>
</devices> </devices>
</domain> </domain>