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)
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;

View 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>

View 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'/>

View 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>

View 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>