Red Hat Bugzilla – Bug 946993
Q35 does not honor -drive if=ide,... and its sugared forms -cdrom, -hda, ...
Last modified: 2015-03-05 04:42:19 EST
Description of problem: when i install guest under Q35 with '-cdrom ...', but fail to detect CD-ROM device in seabios. btw, 1.if i use '-cdrom ...' under 'pc-i440fx-1.4' machine type, it have no such issue, it can etect CD-ROM device in seabios correctly. 2.if i use the '-drive file=...media=cdrom,readonly=on -device ide-cd ...' under Q35, it also have no such issue, it can etect CD-ROM device in seabios sucessfully. Version-Release number of selected component (if applicable): host info: kernel-3.9.0-0.rc4.45.el7.x86_64 qemu-kvm-1.4.0-1.el7.x86_64 seabios-1.7.2-0.2.gita810e4e7.el7.x86_64 guest info: windows_server_2012_x64 How reproducible: 100% Steps to Reproduce: 1.install guest under Q35 with '-cdrom ...' + '-boot menu=on'. e.g:# /usr/libexec/qemu-kvm -S -M q35 -cpu SandyBridge -enable-kvm -m 4096 -smp 2,sockets=2,cores=1,threads=1 ... -boot menu=on -vnc :1 -spice disable-ticketing,port=5931 -monitor stdio -fda /usr/share/virtio-win/virtio-win-1.6.3_amd64.vfd -cdrom /home/en_windows_server_2012_x64_dvd_915478.iso 2.press F12 during POST. 3.select the CD-ROMs to install the guest. Actual results: after step 2, there is no DVD/CD device in boot menu, Press F12 for boot menu. Select boot device: 1. virtio-scsi Drive QEMU HARDDISK 1.4. 2. Legacy option rom 3. Floppy [drive A] 4. iPXE (PCI 00:05.0) Expected results: there should list the DVD/CD device in boot menu. 1. virtio-scsi Drive QEMU HARDDISK 1.4. 2. Legacy option rom 3. Floppy [drive A] 4. iPXE (PCI 00:05.0) 5. DVD/CD [ata1-0 .... DVD/CD] <----------for example Additional info:
we can see the cdrom use the IDE interface under Q35 with '-cdrom ...' . (qemu) info block drive-system-disk: removable=0 io-status=ok file=/home/windows_server_2012_x64.raw ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0 floppy0: removable=1 locked=0 tray-open=0 file=/usr/share/virtio-win/virtio-win-1.6.3_amd64.vfd ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0 ide1-cd0: removable=1 locked=0 tray-open=0 file=/home/en_windows_server_2012_x64_dvd_915478.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0 sd0: removable=1 locked=0 tray-open=0 [not inserted]
The AHCI adapter and the Q35 board lack calls to ide_create_drive and drive_get respectively. Reassigning to Kevin since he worked on other AHCI -drive bugs, and the fix is relatively trivial.
discussion happening upstream (IDE vs AHCI for cd-roms in Q35). Leaving it for 7.1.0 as Q35 is tech-preview.
Q35 does not honor -drive if=ide (see comment#2). '-cdrom F' is sugar for '-drive if=ide,index=2,file=F,media=cdrom'. -hda & friends is similar sugar, see vl.c for details. You don't need SeaBIOS to observe that, info qtree suffices. Summary updated. -drive creates a backend, visible in "info block". With if=ide, it additionally posts a request to the board code to create the appropriate frontend. It's up to the board to honor it. i440FX does, Q35 doesn't. -device ide-hd,.. works differently: board-independent code creates the IDE device and plugs it into a suitable socket if it finds one. Same for ide-cd. Suitable sockets may be provided by onboard controllers created by board code or additional controllers created with -device. You can constrain the choice by specifying bus, unit with -device. i440FX's onboard controller is PATA. Q35's is SATA. -device doesn't care; both provide the same kind of plug for ide-{hd,cd}. A system may have both PATA and SATA controllers. If you care about the kind of controller, pick one by specifying bus=... with -device. The reason why Q35 doesn't honor if=ide requests is lack of upstream consensus on what the request should mean: always PATA, or leave the choice to the board. I'm in the "leave it to the board" camp. Kevin has arguments for "always PATA". If "always PATA", then we need to implement ICH9 legacy PATA mode for it to work. If "leave it to the board", we need to rethink the mapping between index and (bus,unit), which differs between PATA and SATA. A possible compromise is a machine option controlling ICH9 legacy PATA mode. Q35 would then use PATA for if=ide if and only if the option is enabled.
*** Bug 1056900 has been marked as a duplicate of this bug. ***
Fix included in qemu-kvm-rhev-2.1.2-5.el7
Reproduce this bug on qemu-kvm-rhev-2.1.2-3.el7.x86_64. Host: qemu-kvm-rhev-2.1.2-3.el7.x86_64 qemu-kvm-tools-rhev-2.1.2-3.el7.x86_64 qemu-kvm-common-rhev-2.1.2-3.el7.x86_64 qemu-kvm-rhev-debuginfo-2.1.2-3.el7.x86_64 qemu-img-rhev-2.1.2-3.el7.x86_64 kernel-3.10.0-191.el7.x86_64 seabios-bin-1.7.5-5.el7.noarch Command line: /usr/libexec/qemu-kvm \ -M q35 \ -cpu SandyBridge \ -m 2G \ -smp 4,maxcpus=160,cores=2,threads=1,sockets=2 \ -enable-kvm \ -name rhel7 \ -uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \ -smbios type=1,manufacturer='Red Hat',product='RHEV Hypervisor',version=el6,serial=koTUXQrb,uuid=feebc8fd-f8b0-4e75-abc3-e63fcdb67170 \ -k en-us \ -rtc base=localtime,clock=host,driftfix=slew \ -nodefaults \ -monitor stdio \ -qmp tcp:0:5555,server,nowait \ -boot menu=on \ -bios /usr/share/seabios/bios.bin \ -monitor unix:/tmp/monitor2,server,nowait \ -vga qxl \ -spice port=5900,disable-ticketing \ -usb \ -device usb-tablet,id=tablet0 \ -drive file=gluster://10.66.106.25/gv0/rhel7-64.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \ -device virtio-blk-pci,scsi=off,bus=pcie.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \ -netdev tap,id=hostnet0,vhost=on \ -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:01:02:B6:40:21 \ -cdrom /home/boot.iso \ -chardev socket,id=seabios,path=/tmp/seabios,server,nowait \ -device isa-debugcon,chardev=seabios,iobase=0x402 \ Result: Searching bootorder for: /pci@i0cf8/*@3 Searching bootorder for: /rom@genroms/kvmvapic.bin Press F12 for boot menu. Select boot device: 1. Virtio disk PCI:0:2 2. Legacy option rom 3. iPXE (PCI 00:03.0) Verified this bug on qemu-kvm-rhev-2.1.2-5.el7.x86_64. Result: DVD/CD device list in boot menu. Searching bootorder for: /pci@i0cf8/*@3 Searching bootorder for: /rom@genroms/kvmvapic.bin Press F12 for boot menu. Select boot device: 1. Virtio disk PCI:0:2 2. Legacy option rom 3. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD] 4. iPXE (PCI 00:03.0) This bug has been fixed.
Test with -hda also works well. Command line: -cdrom /home/boot.iso \ -chardev socket,id=seabios,path=/tmp/seabios,server,nowait \ -device isa-debugcon,chardev=seabios,iobase=0x402 \ -hda /home/storage0.qcow2 \ Result: Searching bootorder for: /pci@i0cf8/*@2 Searching bootorder for: /rom@genroms/kvmvapic.bin Press F12 for boot menu. Select boot device: 1. AHCI/0: QEMU HARDDISK ATA-7 Hard-Disk (30720 MiBytes) 2. Legacy option rom 3. DVD/CD [AHCI/2: QEMU DVD-ROM ATAPI-4 DVD/CD] 4. iPXE (PCI 00:02.0)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0624.html