This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 893334 - fail to detect AHCI interface data disk in guest using the unit=1
fail to detect AHCI interface data disk in guest using the unit=1
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
high Severity medium
: rc
: ---
Assigned To: Gerd Hoffmann
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-09 01:52 EST by Suqin Huang
Modified: 2013-10-14 01:45 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-14 01:45:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Suqin Huang 2013-01-09 01:52:08 EST
Description of problem:
boot cdrom with 
-device ide-cd,bus=ide.1,unit=1,.... the cdrom can not be recognized, but it works
if unit=0

Version-Release number of selected component (if applicable):

qemu-kvm-1.3.0-3.el7.x86_64
seabios-1.7.2-0.2.gita810e4e7.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. cmd
/usr/libexec/qemu-kvm -nodefaults \
-device ich9-usb-uhci1,id=usb1,bus=pcie.0,addr=0x4 \
-drive file='/home/autotest-devel/client/tests/kvm/images/RHEL-Server-6.4-64-virtio.qcow2',if=none,id=drive-ide0-0-0,media=disk,cache=none,format=qcow2,aio=native \
-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
-device virtio-net-pci,netdev=idUMvixC,mac=9a:87:88:89:8a:8b,bus=pcie.0,addr=0x3,id='idMztaHV' -netdev tap,id=idUMvixC,vhost=on,script=/home/autotest-devel/client/virt/scripts/qemu-ifup-switch \
-m 2048 -smp 2,cores=1,threads=1,sockets=2 -cpu 'Opteron_G3' \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :0 -vga cirrus -rtc base=utc,clock=host,driftfix=slew  -boot order=cdn,once=c,menu=off   -no-kvm-pit-reinjection -enable-kvm -M q35 -monitor stdio  \
-chardev socket,id=serial_id,path=/tmp/serial-shuang,server,nowait \
-device isa-serial,chardev=serial_id \
-drive file='/home/autotest-devel/client/tests/kvm/isos/linux/RHEL6.4-Server-i386.iso',if=none,id=drive-ide0-0-1,media=cdrom,snapshot=off,format=raw -device ide-cd,bus=ide.1,unit=1,drive=drive-ide0-0-1,id=ide0-0-1
2.
3.
  
Actual results:
no /dev/cdrom or /dev/sr0 in guest

Expected results:


Additional info:
1). it works if change unit=1 to unit=0
2). info block
(qemu) info block
drive-ide0-0-0: removable=0 io-status=ok file=/home/autotest-devel/client/tests/kvm/images/RHEL-Server-6.4-64-virtio.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
drive-ide0-0-1: removable=1 locked=0 tray-open=0 io-status=ok file=/home/autotest-devel/client/tests/kvm/isos/linux/RHEL6.4-Server-i386.iso ro=1 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
Comment 2 Hai Huang 2013-01-10 11:18:28 EST
Gerd provided the following note in BZ893302:

q35 in qemu 1.3 needs the dsdt passed in to work correctly:
"-acpitable file=/path/to/q35-acpi-dsdt.aml"
Comment 3 Suqin Huang 2013-01-11 00:49:46 EST
still doesn't work while add "-acpitable file=/path/to/q35-acpi-dsdt.aml"
Comment 4 Sibiao Luo 2013-03-06 22:41:26 EST
Hit it with '-M pc-1.3', boot guest with AHCI interface data disk using the unit=1, the disk fail to be detected in guest, but it can detect it successfully using unit=0.

qemu-kvm command line:
e.g:...-device ahci,id=ahci0,addr=0x5 -drive file=my-data-disk.raw,if=none,id=drive-data-disk,format=raw,werror=stop,rerror=stop,cache=none,aio=native -device ide-hd,bus=ahci0.0,unit=1,drive=drive-data-disk,id=data-disk

host info:
kernel-3.8.0-0.37.el7.x86_64
qemu-kvm-1.3.0-7.el7.x86_64
guest info:
kernel-3.8.0-0.37.el7.x86_64

Best Regards.
sluo
Comment 5 Lukas Doktor 2013-08-22 14:15:30 EDT
Hi, I had this problem too. I figured out that the early versions of AHCI supported two units per bus, but as the original AHCI supports only one disk per line this feature was disabled. Newer versions of qemu raise exception, when you try to assign unit > 0 (you can find a commit in upstream git which describes it).

But someone with deeper knowledge please verify that I'm not mistaken.
Comment 6 Gerd Hoffmann 2013-10-14 01:45:19 EDT
(In reply to Lukas Doktor from comment #5)
> Hi, I had this problem too. I figured out that the early versions of AHCI
> supported two units per bus,

It never did.  IDE has the concept of master/slave, and unit=$nr can be used to select that.  AHCI reuses IDE code, but you can attach only one device per bus (each ahci port is modeled as ide bus in qemu).

> Newer versions of qemu raise exception,
> when you try to assign unit > 0 (you can find a commit in upstream git which
> describes it).

Yep.  This check was missing in older versions, so you could attach a slave device to ahci, but it didn't gave you a *working* device (as this bug report proves ;)

Bottom line: unit != 0 is not valid for AHCI -> NOTABUG

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