On Wed, 25 Nov 2020 12:06:48 +0100
Thomas Huth <thuth(a)redhat.com> wrote:
On s390x, devices are attached to the channel IO subsytem by default,
s/attached to the channel IO subsystem/accessed via the channel subsystem/
so we need to look up scsi controllers via their CCW address there
instead of using PCI.
This fixes "virsh domfsinfo" on s390x for virtio-scsi devices (the first
attempt from commit f8333b3b0a7 did it in the wrong way, reporting the
device name on the guest side instead of the target name on the host side).
Fixes: f8333b3b0a ("qemu: Fix domfsinfo for non-PCI device information ...")
Buglink:
https://bugzilla.redhat.com/show_bug.cgi?id=1858771
Signed-off-by: Thomas Huth <thuth(a)redhat.com>
---
src/conf/domain_conf.c | 23 +++++++++++++++++++++++
src/conf/domain_conf.h | 2 ++
2 files changed, 25 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 00c115d453..d617580fb3 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17610,6 +17610,12 @@ virDomainDiskIndexByAddress(virDomainDefPtr def,
if ((cidx = virDomainControllerFindByPCIAddress(def, pci_address)) >= 0)
controller = def->controllers[cidx];
+ if (!controller && ccw_addr) {
+ cidx = virDomainControllerFindByCCWAddress(def, ccw_addr);
+ if (cidx >= 0)
+ controller = def->controllers[cidx];
+ }
Maybe
if ((cidx = virDomainControllerFindByCCWAddress(def, ccw_addr)) >= 0)
controller = def->controllers[cidx];
to match the pci case right above?
(I find your way more readable, though.)
+
for (i = 0; i < def->ndisks; i++) {
vdisk = def->disks[i];
if (vdisk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
(...)
LGTM.