Skip to content

Commit

Permalink
device_bit_check:fix pci search pattern
Browse files Browse the repository at this point in the history
The output of lspic is change in new guest
like as RHEL9.3 and RHEL8.9.
1. Change the message pattern
2. Adding pci numeric id as checking point

Refer to https://github.com/vcrhonek/hwdata/blob/master/pci.ids#L24039-L24058

lspci -nn
RHEL9.2
07:00.0 SCSI storage controller [0100]: Red Hat, Inc. Virtio SCSI [1af4:1048] (rev 01)
08:00.0 Ethernet controller [0200]: Red Hat, Inc. Virtio network device [1af4:1041] (rev 01)
RHEL9.3
07:00.0 SCSI storage controller [0100]: Red Hat, Inc. Virtio 1.0 SCSI [1af4:1048] (rev 01)
08:00.0 Ethernet controller [0200]: Red Hat, Inc. Virtio 1.0 network device [1af4:1041] (rev 01)

Signed-off-by: qingwangrh <[email protected]>
  • Loading branch information
qingwangrh committed Jul 14, 2023
1 parent c8c818f commit 3ff5f91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions qemu/tests/cfg/device_bit_check.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
virtio_blk:
dev_param_name = blk_extra_params
blk_extra_params = ""
pci_id_pattern = "(\d+:\d+\.\d+)\s+SCSI storage controller:.*?Virtio block device"
pci_id_pattern = "(\d+:\d+\.\d+)\s+SCSI storage controller.*?Virtio.*?block.*?device.*?1af4:1042"
dev_type = "virtio-blk-.*"
virtio_scsi:
dev_param_name = bus_extra_params
bus_extra_params = ""
pci_id_pattern = "(\d+:\d+\.\d+)\s+SCSI storage controller:.*?Virtio SCSI"
pci_id_pattern = "(\d+:\d+\.\d+)\s+SCSI storage controller.*?Virtio.*?SCSI.*?1af4:1048"
dev_type = "virtio-scsi-.*"
s390x:
ccw_id_pattern = "\d+\.\d+\."
- nic_device:
only virtio_net
nic_extra_params = ""
pci_id_pattern = "(\d+:\d+\.\d+)\s+Ethernet controller:.*?Virtio network device"
pci_id_pattern = "(\d+:\d+\.\d+)\s+Ethernet controller.*?Virtio.*?network.*?device.*?1af4:1041"
dev_type = "virtio-net-.*"
dev_param_name = nic_extra_params
2 changes: 1 addition & 1 deletion qemu/tests/device_bit_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def run(test, params, env):
test.error("Can't get the ccw id for device")
cmd = "cat /sys/bus/ccw/devices/%s/" % ccw_n[0]
else:
pci_info = session.cmd_output("lspci")
pci_info = session.cmd_output("lspci -nn")
pci_n = re.findall(pci_id_pattern, pci_info)
if not pci_n:
test.error("Can't get the pci id for device")
Expand Down

0 comments on commit 3ff5f91

Please sign in to comment.