Using AHCI drives in qemu
Possible a stupid question, but noting the new AHCI support in qemu, how do I specify an AHCI drive to attach to a qemu VM?
I can create IDE, SCSI and virtio drives with
-drive if=ide,bus=M,unit=N,...
-drive if=scsi,bus=M,unit=N,...
-drive if=virtio,index=N,...
but when I attempted to test AHCI, a variety of plausible things I tried like
-drive if=ahci,...
-drive if=ide-ahci,...
-drive if=ide,bus=ahci.0,...
all failed. There's no mention of AHCI in qemu-options.hx or qemu-doc.texi, nor anything in the git commit log history about using this new drive type.
Best wishes,
Chris.
Quoted 12 lines · Chris Webb
Possible a stupid question, but noting the new AHCI support in qemu, how do I specify an AHCI drive to attach to a qemu VM?
I can create IDE, SCSI and virtio drives with
-drive if=ide,bus=M,unit=N,...
-drive if=scsi,bus=M,unit=N,...
-drive if=virtio,index=N,...but when I attempted to test AHCI, a variety of plausible things I tried like
Quoted 6 lines
-drive if=ahci,...
-drive if=ide-ahci,...
-drive if=ide,bus=ahci.0,...all failed. There's no mention of AHCI in qemu-options.hx or qemu-doc.texi, nor anything in the git commit log history about using this new drive type.
Using -drive with an if=XXX which is anything other than 'none' is the deprecated / legacy syntax. The way libvirt does AHCI is to use the more verbose/modern syntax:
-device ahci,id=ahci0
-drive if=none,file=/var/lib/libvirt/images/test/disk0.raw,format=raw,id=drive-sata0-0-0
-device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0The first -device there creates the AHCI controller. The -drive specifies the disk backing store that will be used. The last -device there connects the drive to the ACHI controller as an ide-drive.
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Thanks for the swift reply!
Quoted 7 lines · Daniel P. Berrange
Using -drive with an if=XXX which is anything other than 'none' is the deprecated / legacy syntax. The way libvirt does AHCI is to use the more verbose/modern syntax:
-device ahci,id=ahci0 -drive if=none,file=/var/lib/libvirt/images/test/disk0.raw,format=raw,id=drive-sata0-0-0 -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0
Gosh, this is incredibly verbose for normal command line use. Whilst I can see it's nice to have fine control over the detail (and bus/device ids) when you need it, having to write out a command line of that length just to attach a drive is a real pity.
I could cook up a patch to do something sane with -drive if=ahci as a more manageable command-line alternative, but is there any chance of this being accepted if that you're describing the compact syntax as deprecated?
Cheers,
Chris.
Quoted 12 lines · Chris Webb
Thanks for the swift reply!
Quoted 7 lines · Daniel P. Berrange
Using -drive with an if=XXX which is anything other than 'none' is the deprecated / legacy syntax. The way libvirt does AHCI is to use the more verbose/modern syntax:
-device ahci,id=ahci0 -drive if=none,file=/var/lib/libvirt/images/test/disk0.raw,format=raw,id=drive-sata0-0-0 -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0
Quoted 8 lines
Gosh, this is incredibly verbose for normal command line use. Whilst I can see it's nice to have fine control over the detail (and bus/device ids) when you need it, having to write out a command line of that length just to attach a drive is a real pity.
I could cook up a patch to do something sane with -drive if=ahci as a more manageable command-line alternative, but is there any chance of this being accepted if that you're describing the compact syntax as deprecated?
I'm fairly sure such a patch would still be accepted.
Regards,
Daniel
Signature · 4 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Am 30.11.2011 13:20, schrieb Daniel P. Berrange:
Quoted 24 lines · Chris Webb
Quoted 12 lines
Possible a stupid question, but noting the new AHCI support in qemu, how do I specify an AHCI drive to attach to a qemu VM?
I can create IDE, SCSI and virtio drives with
-drive if=ide,bus=M,unit=N,...
-drive if=scsi,bus=M,unit=N,...
-drive if=virtio,index=N,...but when I attempted to test AHCI, a variety of plausible things I tried like
Quoted 6 lines
-drive if=ahci,...
-drive if=ide-ahci,...
-drive if=ide,bus=ahci.0,...all failed. There's no mention of AHCI in qemu-options.hx or qemu-doc.texi, nor anything in the git commit log history about using this new drive type.
Using -drive with an if=XXX which is anything other than 'none' is the deprecated / legacy syntax. The way libvirt does AHCI is to use the more verbose/modern syntax:
Quoted 7 lines
-device ahci,id=ahci0 -drive if=none,file=/var/lib/libvirt/images/test/disk0.raw,format=raw,id=drive-sata0-0-0 -device ide-drive,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0The first -device there creates the AHCI controller. The -drive specifies the disk backing store that will be used. The last -device there connects the drive to the ACHI controller as an ide-drive.
Also note that -device ide-cd on ahci bus is known broken, and ahci is not yet migratable (working on it).
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg