@@ -1249,6 +1249,16 @@ qemuDomainDefPostParse(virDomainDefPtr def,
if (virSecurityManagerVerify(driver->securityManager, def) < 0)
goto cleanup;
+ /* Device defaults are normally set after calling the driver specific
+ PostParse routine (this function), but we need them earlier. */
+ if (virDomainDefPostParseDevices(def, caps, driver->xmlopt) < 0)
+ goto cleanup;
+ if (virDomainDefAddImplicitDevices(def) < 0)
+ goto cleanup;
+
+ if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
+ goto cleanup;
+
ret = 0;
cleanup:
virObjectUnref(qemuCaps);
@@ -1726,9 +1726,6 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
goto cleanup;
- if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
- goto cleanup;
-
if (!(vm = virDomainObjListAdd(driver->domains, def,
driver->xmlopt,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
@@ -7266,9 +7263,6 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
if (qemuAssignDeviceAliases(def, qemuCaps) < 0)
goto cleanup;
- if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
- goto cleanup;
-
/* do fake auto-alloc of graphics ports, if such config is used */
for (i = 0; i < def->ngraphics; ++i) {
virDomainGraphicsDefPtr graphics = def->graphics[i];
@@ -7502,9 +7496,6 @@ static virDomainPtr qemuDomainDefineXMLFlags(virConnectPtr conn, const char *xml
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator)))
goto cleanup;
- if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
- goto cleanup;
-
if (!(vm = virDomainObjListAdd(driver->domains, def,
driver->xmlopt,
0, &oldDef)))
@@ -28,7 +28,9 @@
<address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk>
<controller type='usb' index='0'/>
- <controller type='scsi' index='0'/>
+ <controller type='scsi' index='0'>
+ <address type='spapr-vio' reg='0x2000'/>
+ </controller>
<controller type='pci' index='0' model='pci-root'/>
<input type='keyboard' bus='usb'/>
<input type='mouse' bus='usb'/>
@@ -304,14 +304,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
virQEMUCapsFilterByMachineType(extraFlags, vmdef->os.machine);
- if (virQEMUCapsGet(extraFlags, QEMU_CAPS_DEVICE)) {
- if (qemuDomainAssignAddresses(vmdef, extraFlags, NULL)) {
- if (flags & FLAG_EXPECT_ERROR)
- goto ok;
- goto out;
- }
- }
-
log = virtTestLogContentAndReset();
VIR_FREE(log);
virResetLastError();
@@ -1373,7 +1365,7 @@ mymain(void)
QEMU_CAPS_PCI_OHCI, QEMU_CAPS_PCI_MULTIFUNCTION);
DO_TEST("pseries-vio-user-assigned",
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
- DO_TEST_ERROR("pseries-vio-address-clash",
+ DO_TEST_PARSE_ERROR("pseries-vio-address-clash",
QEMU_CAPS_CHARDEV, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
DO_TEST("pseries-nvram", QEMU_CAPS_DEVICE_NVRAM);
DO_TEST("pseries-usb-kbd", QEMU_CAPS_PCI_OHCI,
@@ -1499,7 +1491,7 @@ mymain(void)
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_VGA_QXL, QEMU_CAPS_DEVICE_QXL);
- DO_TEST_ERROR("pcie-root-port-too-many",
+ DO_TEST_PARSE_ERROR("pcie-root-port-too-many",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE,
QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE,
QEMU_CAPS_DEVICE_IOH3420,
@@ -29,10 +29,11 @@
<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'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.foo'/>
- <address type='virtio-serial' controller='1' bus='0' port='0'/>
+ <address type='virtio-serial' controller='1' bus='0' port='1'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.bar'/>
@@ -40,15 +41,15 @@
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.wizz'/>
- <address type='virtio-serial' controller='0' bus='0' port='0'/>
+ <address type='virtio-serial' controller='0' bus='0' port='2'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.ooh'/>
- <address type='virtio-serial' controller='1' bus='0' port='0'/>
+ <address type='virtio-serial' controller='1' bus='0' port='2'/>
</channel>
<channel type='pty'>
<target type='virtio' name='org.linux-kvm.port.lla'/>
- <address type='virtio-serial' controller='2' bus='0' port='0'/>
+ <address type='virtio-serial' controller='2' bus='0' port='1'/>
</channel>
<memballoon model='virtio'/>
</devices>
new file mode 100644
@@ -0,0 +1,35 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='block' device='disk'>
+ <source dev='/dev/HostVG/QEMUGuest1'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <source file='/tmp/scsidisk.img'/>
+ <target dev='sda' bus='scsi'/>
+ <address type='drive' controller='0' bus='0' target='3' unit='0'/>
+ </disk>
+ <controller type='ide' index='0'/>
+ <controller type='scsi' index='0' model='ibmvscsi'>
+ <address type='spapr-vio' reg='0x2000'/>
+ </controller>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
new file mode 100644
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <serial type='pty'>
+ <target port='0'/>
+ <address type='spapr-vio' reg='0x30000000'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ <address type='spapr-vio' reg='0x30000000'/>
+ </console>
+ <memballoon model='none'/>
+ <panic model='pseries'/>
+ </devices>
+</domain>
@@ -18,11 +18,11 @@
<controller type='pci' index='0' model='pci-root'/>
<serial type='pty'>
<target port='0'/>
- <address type='spapr-vio'/>
+ <address type='spapr-vio' reg='0x30000000'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
- <address type='spapr-vio'/>
+ <address type='spapr-vio' reg='0x30000000'/>
</console>
<memballoon model='none'/>
<panic model='pseries'/>
@@ -18,11 +18,11 @@
<controller type='pci' index='0' model='pci-root'/>
<serial type='pty'>
<target port='0'/>
- <address type='spapr-vio'/>
+ <address type='spapr-vio' reg='0x30000000'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
- <address type='spapr-vio'/>
+ <address type='spapr-vio' reg='0x30000000'/>
</console>
<memballoon model='none'/>
<panic model='pseries'/>
@@ -232,6 +232,12 @@ testInfoSet(struct testInfo *info,
if (!(info->qemuCaps = virQEMUCapsNew()))
goto error;
+ virQEMUCapsSetList(info->qemuCaps,
+ QEMU_CAPS_SCSI_LSI,
+ QEMU_CAPS_VIRTIO_SCSI,
+ QEMU_CAPS_SCSI_MEGASAS,
+ QEMU_CAPS_LAST);
+
if (qemuTestCapsCacheInsert(driver.qemuCapsCache, name,
info->qemuCaps) < 0)
goto error;
@@ -417,7 +423,7 @@ mymain(void)
DO_TEST("disk-drive-network-iscsi");
DO_TEST("disk-drive-network-iscsi-auth");
DO_TEST("disk-scsi-device");
- DO_TEST("disk-scsi-vscsi");
+ DO_TEST_DIFFERENT("disk-scsi-vscsi");
DO_TEST("disk-scsi-virtio-scsi");
DO_TEST("disk-virtio-scsi-num_queues");
DO_TEST("disk-virtio-scsi-cmd_per_lun");
@@ -602,7 +608,7 @@ mymain(void)
DO_TEST_DIFFERENT("panic");
DO_TEST("panic-isa");
- DO_TEST("panic-pseries");
+ DO_TEST_DIFFERENT("panic-pseries");
DO_TEST("panic-double");
DO_TEST("panic-no-address");