mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
domain_conf: Allow to look up scsi disks when controller uses a CCW address
On s390x, devices are attached to the channel IO subsytem by default, 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@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
5db43b5a76
commit
bf63f6549a
@ -16101,6 +16101,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];
|
||||
}
|
||||
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
vdisk = def->disks[i];
|
||||
if (vdisk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
|
||||
@ -16734,6 +16740,23 @@ virDomainControllerFindByType(virDomainDefPtr def,
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
virDomainControllerFindByCCWAddress(virDomainDefPtr def,
|
||||
virDomainDeviceCCWAddressPtr addr)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < def->ncontrollers; i++) {
|
||||
virDomainDeviceInfoPtr info = &def->controllers[i]->info;
|
||||
|
||||
if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW &&
|
||||
virDomainDeviceCCWAddressEqual(&info->addr.ccw, addr))
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int
|
||||
virDomainControllerFindByPCIAddress(virDomainDefPtr def,
|
||||
virPCIDeviceAddressPtr addr)
|
||||
|
@ -3464,6 +3464,8 @@ void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
|
||||
virDomainControllerDefPtr controller);
|
||||
int virDomainControllerFind(const virDomainDef *def, int type, int idx);
|
||||
int virDomainControllerFindByType(virDomainDefPtr def, int type);
|
||||
int virDomainControllerFindByCCWAddress(virDomainDefPtr def,
|
||||
virDomainDeviceCCWAddressPtr addr);
|
||||
int virDomainControllerFindByPCIAddress(virDomainDefPtr def,
|
||||
virPCIDeviceAddressPtr addr);
|
||||
int virDomainControllerFindUnusedIndex(virDomainDef const *def, int type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user