Bug 1298412

Summary: unable to boot guest with "usb-host" device automatically when it rank after one hard disk in boot menu
Product: Red Hat Enterprise Linux 6 Reporter: Yanan Fu <yfu>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED NEXTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.8CC: ailan, chayang, jinzhao, juzhang, kraxel, mkenneth, rbalakri, virt-bugs, virt-maint, yfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-20 07:02:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
add screendump when boot guest
none
add screendump for boot menu none

Description Yanan Fu 2016-01-14 02:12:16 UTC
Description of problem:
boot one guest with "usb-host", and one ide disk:

-drive id=drive_hd1,if=none,media=disk,file=empty_file1 \
-device ide-drive,id=hd1,drive=drive_hd1,bus=ide.0,unit=0 \
-device usb-ehci,id=ehci \
-device usb-host,hostbus=3,hostaddr=10,id=hostdev0,bus=ehci.0   \

there has a bootable system in the usb, and the disk is idle. after boot failed from Hard Disk, it will skip USB device, and boot from the drive next in the boot order.
(do "system_reset", and enter boot menu, it shows: the disk rank first, usb device rank second )


Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.482.el6.x86_64
seabios-0.6.1.2-30.el6.x86_64
kernel-2.6.32-595.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot one guest with a bootable "usb-host", and one idle ide disk.
2.let the guest boot automatically.
3.guest failed to boot from Hard Disk, and skip the usb device,boot from the drive next in the boot order

Actual results:
guest skip the usb device, and boots from the drive next in the boot order

Expected results:
guest can boot from usb-host.

Additional info:
"usb-host" device exist in boot menu.

CLI:
/usr/libexec/qemu-kvm \
-M pc \
-cpu SandyBridge,enforce \
-m 4G \
-smp 1,cores=1,threads=1,sockets=1,maxcpus=65 \
-nodefaults \
-vga std \
-uuid 162494fb-ae6a-47dd-a040-cb26b497b60a \
-chardev socket,id=seabioslog,path=/tmp/seabiosdebug,server,nowait \
-device isa-debugcon,chardev=seabioslog,iobase=0x402 \
-device sga \
-spice port=5901,disable-ticketing \
-usbdevice tablet \
-monitor stdio \
-S \
-boot menu=on \
-drive id=drive_hd1,if=none,media=disk,file=/root/empty_file1 \
-device ide-drive,id=hd1,drive=drive_hd1,bus=ide.0,unit=0 \
-device usb-ehci,id=ehci \
-device usb-host,hostbus=3,hostaddr=10,id=hostdev0,bus=ehci.0   \
-netdev tap,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=virtio-net \

Comment 1 Yanan Fu 2016-01-14 02:30:26 UTC
Created attachment 1114635 [details]
add screendump when boot guest

Comment 3 Yanan Fu 2016-01-14 02:31:21 UTC
Created attachment 1114636 [details]
add screendump for boot menu

Comment 4 Yanan Fu 2016-01-14 02:42:07 UTC
I have checked "usb-host" does not support "bootindex", so if we want to install one guest from "usb-host", and if it rank after the disk in boot menu. it will always fail when do not enter boot menu to choose "USB device" manually.

Comment 5 Gerd Hoffmann 2016-01-18 10:25:27 UTC
> there has a bootable system in the usb, and the disk is idle. after boot
> failed from Hard Disk, it will skip USB device, and boot from the drive next
> in the boot order.
> (do "system_reset", and enter boot menu, it shows: the disk rank first, usb
> device rank second )

BIOS boot interfaces are decades old and unfortunately not designed in a way
to allow this (have multiple hard-disks and try booting them in order).

Only possible fix is stop using seabios and go for ovmf (UEFI) instead.
Which again isn't an option for RHEL-6, but should be available for
RHEL-7 soon.

Comment 6 Gerd Hoffmann 2016-01-18 10:28:41 UTC
(In reply to Yanan Fu from comment #4)
> I have checked "usb-host" does not support "bootindex", so if we want to
> install one guest from "usb-host", and if it rank after the disk in boot
> menu. it will always fail when do not enter boot menu to choose "USB device"
> manually.

usb-host got bootindex support at some point, backporting that to RHEL-6 might be an option.  Have to check how invasive it is though.  Also this doesn't look highly important to me.  What is the use case?

Comment 7 Yanan Fu 2016-01-19 03:01:45 UTC
(In reply to Gerd Hoffmann from comment #6)
> (In reply to Yanan Fu from comment #4)
> > I have checked "usb-host" does not support "bootindex", so if we want to
> > install one guest from "usb-host", and if it rank after the disk in boot
> > menu. it will always fail when do not enter boot menu to choose "USB device"
> > manually.
> 
> usb-host got bootindex support at some point, backporting that to RHEL-6
> might be an option.  Have to check how invasive it is though.  Also this
> doesn't look highly important to me.  What is the use case?

In the case, we want to install one guest from usb-host to a disk.

There has a bootable system in the usb, the disk is idle. after boot failed from Hard Disk, it will skip USB device, and boot from the drive next(may be nic) in the boot order. In this situation, we can not choose to install the given system in the usb if we do not enter boot menu to choose it manually.

> >BIOS boot interfaces are decades old and unfortunately not designed in a way
> >to allow this (have multiple hard-disks and try booting them in order).

do you mean, bios only check the first disk in boot menu? i just confirmed bios only check one hd and cd if there has not only one in the boot menu.
And does "usb-host" belong to hard disk ?

Comment 8 Gerd Hoffmann 2016-01-19 07:28:04 UTC
> > doesn't look highly important to me.  What is the use case?
> 
> In the case, we want to install one guest from usb-host to a disk.

Why a physical stick instead of a virtual one?  Isn't that a bit inconvinient?  Or do you do it just to test whenever it works?  In case it is the latter:  Can we disable that test case for RHEL-6?

> > >BIOS boot interfaces are decades old and unfortunately not designed in a way
> > >to allow this (have multiple hard-disks and try booting them in order).
> 
> do you mean, bios only check the first disk in boot menu? i just confirmed
> bios only check one hd and cd if there has not only one in the boot menu.
> And does "usb-host" belong to hard disk ?

After picking the boot device from the menu the bios will order the hard disks, finalize and populate data structures such as EDD.  Then it'll try only the first hard disk (possibly after trying other devices such as cdroms).

usb sticks are handled like hard drives, no matter whenever they are virtual (usb-storage) or physical (usb-host).

Comment 9 Yanan Fu 2016-01-20 02:25:55 UTC
(In reply to Gerd Hoffmann from comment #8)

> Why a physical stick instead of a virtual one?  Isn't that a bit
> inconvinient?  Or do you do it just to test whenever it works?  In case it
> is the latter:  Can we disable that test case for RHEL-6?

It is one of our test case "Boot from a passthrough usb storage" 
I think this is possible when we already have one bootable system in a physical usb device, and want to install a guest with the exist system.

> After picking the boot device from the menu the bios will order the hard
> disks, finalize and populate data structures such as EDD.  Then it'll try
> only the first hard disk (possibly after trying other devices such as
> cdroms).
> 
> usb sticks are handled like hard drives, no matter whenever they are virtual
> (usb-storage) or physical (usb-host).

As you said,usb sticks are handled like hard driver, and bios only check one hard driver in boot menu, so i can understand why it skip usb device when it rank after one hard disk in boot menu.

Anyway, there has workaround about this issue, we can enter bootmenu when guest boot, and choose the usb device manually.

Thanks

Comment 10 Gerd Hoffmann 2016-01-20 07:02:11 UTC
Ok, closing then as NEXTRELEASE (rhel-7 has bootindex for usb-host).