This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1967666 - Unify length limits of serial number for SCSI disks
Summary: Unify length limits of serial number for SCSI disks
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: 9.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: qing.wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-03 14:53 UTC by Peter Krempa
Modified: 2023-08-26 11:38 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-16 07:27:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-1312 0 None Migrated None 2023-08-25 16:55:54 UTC

Description Peter Krempa 2021-06-03 14:53:35 UTC
Description of problem:
Depending on how the serial of a SCSI disk is configured and queried there are 3 possible length limits to which the serial is truncated:

1) when queried via VPD 0x80 -> 36 chars ( to fit UUID, raised from 20 to 36 in qemu 2.8)
2) when queried via VPD 0x83, configured via 'serial=' -> 20 chars (limit adopted from IDE?)
3) when queried via VPD 0x83, configured via 'device_id' -> 256 - 8 (message size limit)

Having multiple distinct arbitrary unjustified limit is wrong and caused problems such as when libvirt switched to using "device_id" which was required prior to change to use -blockdev.

See:

https://bugzilla.redhat.com/show_bug.cgi?id=1959997

To reproduce the issue, different behaviours happen when the 'serial=' is used alone or when 'device_id' is used.

Comment 1 qing.wang 2021-06-07 06:34:47 UTC
Hi,Peter, i have some questions for the issue?

1.How long the Unify length limits of serial number

2.What is the expected result if Serial number exceeding length? refuse to run or give a warning message?

3.How to handle the virtio device, (virtio-blk-pci), they should follow same rule of the serial number

Current test result:
1.create images
qemu-img create -f qcow2 /home/kvm_autotest_root/images/data1.qcow2 1G
qemu-img create -f qcow2 /home/kvm_autotest_root/images/data2.qcow2 2G
qemu-img create -f qcow2 /home/kvm_autotest_root/images/data3.qcow2 3G

2.boot vm with long serial number of data images

/usr/libexec/qemu-kvm \
  -name testvm \
  -machine q35 \
  -m 8G \
  -smp 8 \
  -cpu host,vmx,+kvm_pv_unhalt \
  -device qemu-xhci,id=usb1 \
  -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
  \
  -device pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x3,chassis=1 \
  -device pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x3.0x1,bus=pcie.0,chassis=2 \
  -device pcie-root-port,id=pcie-root-port-2,port=0x2,addr=0x3.0x2,bus=pcie.0,chassis=3 \
  -device pcie-root-port,id=pcie-root-port-3,port=0x3,addr=0x3.0x3,bus=pcie.0,chassis=4 \
  -device pcie-root-port,id=pcie-root-port-4,port=0x4,addr=0x3.0x4,bus=pcie.0,chassis=5 \
  -device pcie-root-port,id=pcie-root-port-5,port=0x5,addr=0x3.0x5,bus=pcie.0,chassis=6 \
  -device pcie-root-port,id=pcie-root-port-6,port=0x6,addr=0x3.0x6,bus=pcie.0,chassis=7 \
  -device pcie-root-port,id=pcie-root-port-7,port=0x7,addr=0x3.0x7,bus=pcie.0,chassis=8  \
  -device virtio-scsi-pci,id=scsi0,bus=pcie-root-port-5 \
  -device virtio-scsi-pci,id=scsi1,bus=pcie-root-port-6 \
  -blockdev driver=qcow2,file.driver=file,cache.direct=off,cache.no-flush=on,file.filename=/home/kvm_autotest_root/images/rhel840-64-virtio-scsi.qcow2,node-name=drive_image1   \
  -device scsi-hd,id=os,drive=drive_image1,bus=scsi0.0,bootindex=0,serial=OS_DISK   \
  \
  -blockdev driver=qcow2,file.driver=file,file.filename=/home/kvm_autotest_root/images/data1.qcow2,node-name=data_image1   \
  -device scsi-hd,id=data1,drive=data_image1,bus=scsi0.0,bootindex=1,serial=0-1234567890-123456789-1234567890-abcdefg   \
  -blockdev driver=qcow2,file.driver=file,file.filename=/home/kvm_autotest_root/images/data2.qcow2,node-name=data_image2   \
  -device scsi-hd,id=data2,drive=data_image2,bus=scsi0.0,bootindex=2,device_id=1-1234567890-123456789-1234567890-abcdefg   \
  -blockdev driver=qcow2,file.driver=file,file.filename=/home/kvm_autotest_root/images/data3.qcow2,node-name=data_image3   \
  -device virtio-blk-pci,id=data3,drive=data_image3,bus=pcie-root-port-3,bootindex=3,serial=2-1234567890-123456789-1234567890-abcdefg   \
  -vnc :5 \
  -monitor stdio \
  -qmp tcp:0:5955,server=on,wait=off \
  -device virtio-net-pci,mac=9a:b5:b6:b1:b2:b7,id=idMmq1jH,vectors=4,netdev=idxgXAlm,bus=pcie-root-port-7 \
  -netdev tap,id=idxgXAlm \
  -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/monitor-qmp7.log,server=on,wait=off \
  -mon chardev=qmp_id_qmpmonitor1,mode=control \
  -chardev file,path=/var/tmp/monitor-serial7.log,id=serial_id_serial0 \
  -device isa-serial,chardev=serial_id_serial0 \
  -D debug.log \
  -boot menu=on,reboot-timeout=1000 \
   \

3.login guest

check vpd 

[root@localhost home]# lsblk -nd
sda    8:0    0  20G  0 disk 
sdb    8:16   0   1G  0 disk 
sdc    8:32   0   2G  0 disk 
vda  252:0    0   3G  0 disk 


[root@localhost home]# sg_vpd /dev/sdb --page=0x80;sg_vpd /dev/sdb --page=0x83
Unit serial number VPD page:
  Unit serial number: 0-1234567890-123456789-1234567890-ab
Device Identification VPD page:
  Addressed logical unit:
    designator type: vendor specific [0x0],  code set: ASCII
      vendor specific: 0-1234567890-1234567
[root@localhost home]# 
[root@localhost home]# 
[root@localhost home]# sg_vpd /dev/sdc --page=0x80;sg_vpd /dev/sdc --page=0x83
fetching VPD page failed: Numerical argument out of domain
sg_vpd failed: Numerical argument out of domain
Device Identification VPD page:
  Addressed logical unit:
    designator type: vendor specific [0x0],  code set: ASCII
      vendor specific: 1-1234567890-123456789-1234567890-abcdefg



[root@localhost home]# udevadm info /dev/sdb|grep ID_SERIAL
E: ID_SERIAL=0QEMU_QEMU_HARDDISK_0-1234567890-1234567
E: ID_SERIAL_SHORT=0-1234567890-1234567

[root@localhost home]# udevadm info /dev/sdc|grep ID_SERIAL
E: ID_SERIAL=0QEMU_QEMU_HARDDISK_1-1234567890-123456789-1234567890-abcdefg
E: ID_SERIAL_SHORT=1-1234567890-123456789-1234567890-abcdefg

[root@localhost home]# udevadm info /dev/vda|grep ID_SERIAL
E: ID_SERIAL=2-1234567890-1234567

Comment 2 Peter Krempa 2021-06-07 15:13:14 UTC
(In reply to qing.wang from comment #1)
> Hi,Peter, i have some questions for the issue?
> 
> 1.How long the Unify length limits of serial number

For SCSI disks it should be unified to the technical limit of 248 characters, it doesn't make sense to pick arbitrary values.

> 2.What is the expected result if Serial number exceeding length? refuse to
> run or give a warning message?

Ideally qemu would reject startup or hotplug if the serial number can't be honoured. This is a question for 
https://bugzilla.redhat.com/show_bug.cgi?id=1967668

 
> 3.How to handle the virtio device, (virtio-blk-pci), they should follow same
> rule of the serial number

Unless there's a technical limit on the serial number lenght such as in case of IDE disks limiting it arbitrarily to 20 characters is wrong especially since at least some users want to use UUIDs which are 36 characters.

Comment 3 qing.wang 2021-06-08 11:27:46 UTC
(In reply to Peter Krempa from comment #2)
> (In reply to qing.wang from comment #1)
> > Hi,Peter, i have some questions for the issue?
> > 
> > 1.How long the Unify length limits of serial number
> 
> For SCSI disks it should be unified to the technical limit of 248
> characters, it doesn't make sense to pick arbitrary values.
> 
> > 2.What is the expected result if Serial number exceeding length? refuse to
> > run or give a warning message?
> 
> Ideally qemu would reject startup or hotplug if the serial number can't be
> honoured. This is a question for 
> https://bugzilla.redhat.com/show_bug.cgi?id=1967668
> 
>  
> > 3.How to handle the virtio device, (virtio-blk-pci), they should follow same
> > rule of the serial number
> 
> Unless there's a technical limit on the serial number lenght such as in case
> of IDE disks limiting it arbitrarily to 20 characters is wrong especially
> since at least some users want to use UUIDs which are 36 characters.

yes, according to test in comment 1. so it will extent support 36 for virtio-blk-pci ?

Comment 4 Peter Krempa 2021-06-14 07:35:34 UTC
(In reply to qing.wang from comment #3)
> (In reply to Peter Krempa from comment #2)
> > (In reply to qing.wang from comment #1)

[...]

> > > 3.How to handle the virtio device, (virtio-blk-pci), they should follow same
> > > rule of the serial number
> > 
> > Unless there's a technical limit on the serial number lenght such as in case
> > of IDE disks limiting it arbitrarily to 20 characters is wrong especially
> > since at least some users want to use UUIDs which are 36 characters.
> 
> yes, according to test in comment 1. so it will extent support 36 for
> virtio-blk-pci ?

The limit should not be arbitrary as the 36 characters for UUID in case of the SCSI disk was. Limits should be picked based on technical limits of the device interface.

Comment 7 John Ferlan 2021-09-08 21:41:24 UTC
Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 18 RHEL Program Management 2023-08-15 15:25:07 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 19 RHEL Program Management 2023-08-16 07:27:41 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.


Note You need to log in before you can comment on or make changes to this bug.