Received: from eggs.gnu.org ([2001:4830:134:3::10]:45970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnnaf-0007Mu-V1 for qemu-devel@nongnu.org; Tue, 03 Dec 2013 05:52:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnnaa-0005fk-KY for qemu-devel@nongnu.org; Tue, 03 Dec 2013 05:52:29 -0500 Received: from mail-bk0-f49.google.com ([209.85.214.49]:48071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnnaa-0005ff-Az for qemu-devel@nongnu.org; Tue, 03 Dec 2013 05:52:24 -0500 Received: by mail-bk0-f49.google.com with SMTP id my13so5817029bkb.8 for ; Tue, 03 Dec 2013 02:52:23 -0800 (PST) Message-ID: <529DB7E8.40108@m2r.biz> Date: Tue, 03 Dec 2013 11:52:24 +0100 From: Fabio Fantoni MIME-Version: 1.0 References: <529DAF0B.5000909@m2r.biz> <87a9gii5sk.fsf@blackfin.pond.sub.org> In-Reply-To: <87a9gii5sk.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [BUG] ahci -device ide-hd|ide-cd select a bus already in use List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: "qemu-devel@nongnu.org" Il 03/12/2013 11:32, Markus Armbruster ha scritto: > Fabio Fantoni 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 Sorry, these are qemu parameters of my domU: libxl: debug: libxl_dm.c:1327:libxl__spawn_local_dm: Spawning device-model /usr/lib/xen/bin/qemu-system-i386 with arguments: libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: /usr/lib/xen/bin/qemu-system-i386 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -xen-domid libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 9 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -chardev libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-9,server,nowait libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -mon libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: chardev=libxl-cmd,mode=control libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -nodefaults libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -name libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: W7-q35 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -vnc libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 0.0.0.0:0,to=99 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -k libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: it libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -device libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: VGA libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -boot libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: order=d libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -smp libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 2,maxcpus=2 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -device libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: rtl8139,id=nic0,netdev=net0,mac=00:16:3e:3b:27:20 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -netdev libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: type=tap,id=net0,ifname=vif9.0-emu,script=no,downscript=no libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -machine libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: q35,accel=xen libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -device libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: xen-platform libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -device libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: i82801b11-bridge libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -drive libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: file=/mnt/vm/disks/W7-q35.disk1.xm,if=none,id=drive-sata-disk0,format=raw,cache=writeback libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -device libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: ide-drive,drive=drive-sata-disk0,id=sata0 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -drive libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: file=/mnt/vm/iso/ubcd.iso,if=none,id=drive-sata-disk1,format=raw,cache=writeback libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -device libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: ide-cd,drive=drive-sata-disk1,id=sata1 libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -m libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 2032 Probably I can try to use libxl variable used for index on bus instead. > > 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. Default ahci controller of q35 machine is named always ide or can change? If I use bus in new -device parameters on xen I must be sure to use very stable parameter also on long term. Thanks for any reply. > > -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