Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
Although libvirt can set bootindex=1 in the "-device usb-host" options, and although seabios is capable of booting from a device
plugged into a nec-usb-xhci controller, for some reason either qemu or seabios isn't properly moving the selection for the USB disk up to
position 1 only if the usb controller is nec-usb-xhci.
Version-Release number of selected component (if applicable):
seabios-1.9.1-4.el7.x86_64
qemu-kvm-rhev-2.6.0-21.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
Steps :
1.An bootable USB hostdev with bootindex=1
2.An bootable virtual disk
3.enable boot menu, start guest.
4.Guest tried to start from the virtual disk but ignore the usb hostdev with bootindex=1
5. check boot menu when guest starts :
Select boot device :
1. Virtio disk PCI:0:7
2. USB MSC Drive USB DISK ... (it is the device with boot order =1 )
qemu cmd line :
# ps -ef|grep qemu | sed 's/-device/\n-device/g'
qemu 6608 1 0 10:51 ? 00:00:02 /usr/libexec/qemu-kvm -name guest=vm2,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-35-vm2/master-key.aes -machine pc-i440fx-rhel7.3.0,accel=kvm,usb=off,vmport=off -cpu IvyBridge -bios /usr/share/seabios/bios-256k.bin
......
-device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/var/lib/libvirt/images/vm2.qcow2,format=qcow2,if=none,id=drive-virtio-disk0
-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2
......
-device usb-host,hostbus=2,hostaddr=3,id=hostdev0,bootindex=1,bus=usb.0,port=4
guest xml :
# virsh dumpxml vm2
......
<os>
<type arch='x86_64' machine='pc-i440fx-rhel7.3.0'>hvm</type>
<loader type='rom'>/usr/share/seabios/bios-256k.bin</loader>
<bootmenu enable='yes'/>
</os>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/vm2.qcow2'/>
<backingStore/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</disk>
......
<controller type='usb' index='0' model='nec-xhci'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</controller>
......
<hostdev mode='subsystem' type='usb' managed='yes'>
<source startupPolicy='optional'>
<vendor id='0x1005'/>
<product id='0xb113'/>
<address bus='2' device='3'/>
</source>
<boot order='1'/>
<alias name='hostdev0'/>
<address type='usb' bus='0' port='4'/>
</hostdev>
Actual results:
As step 5, host usb with bootindex = 1 cannot be moved to the first place.
Expected results:
List bootable devices as boot index.
Additional info:
Underlying issue: Each physical xhci port is two virtual ports, one for usb3 devices and one for usb1+usb2 devices. So, the device plugged into physical port #1 can show up on virtual port #1 (usb3) or virtual port #5 (usb1+usb2).
The bootindex entry is created for the physical port numbering, i.e. port #1. So it works for usb3 sticks (when plugged into a usb3 port on the host) and doesn't work for usb2 sticks. Virtual sticks (aka usb-storage) support usb3 and work fine too.
I guess we should map those virtual port numbers back to physical port numbers in the firmware driver.
Reassigning to seabios.
Adding László to CC (clone for ovmf if needed).
Thanks for the CC.
At the moment OVMF doesn't have any special handling for bootorder entries that describe assigned USB host devices. I seem to remember testing boot from physical USB sticks with OVMF, but I'm unsure if those tests used "-device usb-host", or SCSI LUN passthrough.
I also can't recall if this scenario was specifically covered in the last QE test plan for OVMF that I reviewed...
I suggest that, if we want to support this use case, QE please retest it with OVMF, and report a separate BZ if it doesn't work. That bug report should include the full OVMF debug log (as usual). From that log, I should be able to see the "bootorder" fw_cfg file, including the OpenFirmware devpath that needs special casing.
Furthermore, a comparison between OpenFirmware devpaths that only differ in the virtual port in use would be helpful.
Independently, what are the practical advantages of assigning a USB block device with <hostdev> over any other methods, for example LUN passthrough with virtio-scsi? I certainly see the point of <hostdev> assignment for a USB mouse or keyboard, but not so much for a block device. Even for optical media or tape writing, we've always suggested LUN passthrough, to my knowledge.
Gard, please don't change BZ status like this. You are free to use NEW<->ASSIGNED<->POST. Maintainers will change the status from POST to MODIFIED to ON_QA so that we can make sure the BZ gets tracked properly in the advisory that goes to customers.
Mirek, can you please add the seabios build NVR to the BZ and add the BZ to the advisory?
Description of problem: Although libvirt can set bootindex=1 in the "-device usb-host" options, and although seabios is capable of booting from a device plugged into a nec-usb-xhci controller, for some reason either qemu or seabios isn't properly moving the selection for the USB disk up to position 1 only if the usb controller is nec-usb-xhci. Version-Release number of selected component (if applicable): seabios-1.9.1-4.el7.x86_64 qemu-kvm-rhev-2.6.0-21.el7.x86_64 How reproducible: 100% Steps to Reproduce: Steps : 1.An bootable USB hostdev with bootindex=1 2.An bootable virtual disk 3.enable boot menu, start guest. 4.Guest tried to start from the virtual disk but ignore the usb hostdev with bootindex=1 5. check boot menu when guest starts : Select boot device : 1. Virtio disk PCI:0:7 2. USB MSC Drive USB DISK ... (it is the device with boot order =1 ) qemu cmd line : # ps -ef|grep qemu | sed 's/-device/\n-device/g' qemu 6608 1 0 10:51 ? 00:00:02 /usr/libexec/qemu-kvm -name guest=vm2,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-35-vm2/master-key.aes -machine pc-i440fx-rhel7.3.0,accel=kvm,usb=off,vmport=off -cpu IvyBridge -bios /usr/share/seabios/bios-256k.bin ...... -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/var/lib/libvirt/images/vm2.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 ...... -device usb-host,hostbus=2,hostaddr=3,id=hostdev0,bootindex=1,bus=usb.0,port=4 guest xml : # virsh dumpxml vm2 ...... <os> <type arch='x86_64' machine='pc-i440fx-rhel7.3.0'>hvm</type> <loader type='rom'>/usr/share/seabios/bios-256k.bin</loader> <bootmenu enable='yes'/> </os> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/vm2.qcow2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </disk> ...... <controller type='usb' index='0' model='nec-xhci'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </controller> ...... <hostdev mode='subsystem' type='usb' managed='yes'> <source startupPolicy='optional'> <vendor id='0x1005'/> <product id='0xb113'/> <address bus='2' device='3'/> </source> <boot order='1'/> <alias name='hostdev0'/> <address type='usb' bus='0' port='4'/> </hostdev> Actual results: As step 5, host usb with bootindex = 1 cannot be moved to the first place. Expected results: List bootable devices as boot index. Additional info: