From 10c73bf18a8538376641c22142c18a255426ef3a Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Tue, 12 Dec 2017 06:30:31 -0500 Subject: [PATCH] qemu: Need to assign PCI address to vhost-scsi Commit id '70249927b' neglected to cover this case because the test had taken the "shortcut" to already add the
; however, when the PCI address assignment code was adjusted by commit id '70249927' the vhost-scsi (VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST) wasn't covered thus returning a 0 for pciFlags. So I altered the tests too to make sure it doesn't happen again. Previously the qemuxml2xmloutdata was a softlink to the source qemuxml2argvdata, so I unlinked and recreated the output file to force generation of the adddress. Without the test changes, an address generation returns: libvirt: Domain Config error : internal error: Cannot automatically add a new PCI bus for a device with connect flags 00 if an address was supplied in the test, a restart of libvirtd or edit of a guest would display the following opaque message: warning : qemuDomainCollectPCIAddress:1237 : qemuDomainDeviceCalculatePCIConnectFlags() thinks that the device with PCI address 0000:00:09.0 should not have a PCI address where the address is related to the guest PCI address provided. --- src/qemu/qemu_domain_address.c | 3 +- .../hostdev-scsi-vhost-scsi-ccw.xml | 1 - .../hostdev-scsi-vhost-scsi-pci.xml | 1 - .../hostdev-scsi-vhost-scsi-ccw.xml | 35 ++++++++++++++- .../hostdev-scsi-vhost-scsi-pci.xml | 43 ++++++++++++++++++- 5 files changed, 78 insertions(+), 5 deletions(-) mode change 120000 => 100644 tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml mode change 120000 => 100644 tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index a40cdb3993..6e7561d396 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -623,7 +623,8 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && - hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV)) { + hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV && + hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST)) { return 0; } diff --git a/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-ccw.xml b/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-ccw.xml index 6012d241ce..33234bc3d9 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-ccw.xml +++ b/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-ccw.xml @@ -24,7 +24,6 @@ -
diff --git a/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci.xml b/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci.xml index cb97544d30..13455f672e 100644 --- a/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci.xml +++ b/tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci.xml @@ -33,7 +33,6 @@ -
diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml deleted file mode 120000 index 39ff659682..0000000000 --- a/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/hostdev-scsi-vhost-scsi-ccw.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml new file mode 100644 index 0000000000..6012d241ce --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-ccw.xml @@ -0,0 +1,34 @@ + + QEMUGuest2 + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-s390x + + + +
+ + +
+ + + +
+ + +
+ + + + diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml deleted file mode 120000 index b17ea17c8f..0000000000 --- a/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml b/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml new file mode 100644 index 0000000000..cb97544d30 --- /dev/null +++ b/tests/qemuxml2xmloutdata/hostdev-scsi-vhost-scsi-pci.xml @@ -0,0 +1,42 @@ + + QEMUGuest2 + c7a5fdbd-edaf-9466-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-i686 + + + +
+ + +
+ + +
+ + +
+ + + + + + +
+ + +
+ + +