qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [BUG] ahci -device ide-hd|ide-cd select a bus already i


From: Markus Armbruster
Subject: Re: [Qemu-devel] [BUG] ahci -device ide-hd|ide-cd select a bus already in use
Date: Tue, 03 Dec 2013 11:32:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Fabio Fantoni <address@hidden> writes:

> I started to test/implement q35 cipset on xen hvm domUs.
> I found that ide disks and cdrom don't works with q35 using old qemu
> parameters without -device, this is not a blocking problem.
> I tried with new qemu parameters and ahci and the disk works.
> When I tried to add more that one ahci disk/cdrom devices qemu gave
> this error:
>> qemu-system-i386: -device ide-cd,drive=drive-sata-disk1,id=sata1:
>> Can't create IDE unit 1, bus supports only 1 units
>> qemu-system-i386: -device ide-cd,drive=drive-sata-disk1,id=sata1:
>> Device initialization failed.
>> qemu-system-i386: -device ide-cd,drive=drive-sata-disk1,id=sata1:
>> Device 'ide-cd' could not be initialized
> I used qemu 1.6.1 for the test and searching online I found the same
> problem was reported also on fedora, ubuntu and red hat bugtrackers.
> Looking for the solution on qemu-devel and git I found this patch:
> http://git.qemu.org/?p=qemu.git;a=commit;h=0ee20e665840d8a887c145b368ee121cb86a028e
> It is applied on qemu 1.6 but it seems it doesn't solve the problem of
> the selection of full bus but it only show an error when it happens.
> Xen with old qemu parameters use index instead of bus and unit but it
> seems missing if I try to use it on -device.
> I also read docs/qdev-device-use.txt but it doesn't mention index with
> new -device ide-hd|ide-cd parameters and I found nothing about if=none
> or any ahci disks informations, I think that this document needs to be
> updated/improved.
>
> Thanks for any reply.

You didn't tell us your complete command line.  Your error messages
suggest you try to add more than one device to the same IDE bus, like
this:

    $ qemu -nodefaults -S -display none -monitor stdio -M q35 -drive 
if=none,id=drive0,file=test.qcow2 -drive if=none,id=drive1 -device 
ide-hd,drive=drive0 -device ide-cd,drive=drive1
    QEMU 1.7.50 monitor - type 'help' for more information
    (qemu) upstream-qemu: -device ide-cd,drive=drive1: Can't create IDE unit 1, 
bus supports only 1 units
    upstream-qemu: -device ide-cd,drive=drive1: Device initialization failed.
    upstream-qemu: -device ide-cd,drive=drive1: Device 'ide-cd' could not be 
initialized

Old IDE provides buses ide.0 and ide.1, and each bus can have up to two
units, master and slave.

AHCI provides buses ide.0 .. ide.6, but each bus can have only one unit.

-device is stupid: it picks the first bus it finds, and then the first
free unit.  Good enough for two devices with IDE, but only one with
AHCI.

Use explicit bus and unit parameters.  Except you can omit unit=0 with
AHCI, because it's the only permissible unit anyway:

    $ qemu -nodefaults -S -display none -monitor stdio -M q35 -drive 
if=none,id=drive0,file=test.qcow2 -drive if=none,id=drive1 -device 
ide-hd,drive=drive0,bus=ide.0 -device ide-cd,drive=drive1,bus=ide.1



reply via email to

[Prev in Thread] Current Thread [Next in Thread]