I have some time this week to work on libvirt and thought Daniel's
suggestion [1] for adding AHCI support in the qemu driver would be a
useful endeavor.
I've managed to start a qemu instance using AHCI with attached hackery,
iff I have a controller defined. E.g.
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test/disk0.raw'/>
<target dev='sda' bus='sata'/>
</disk>
<controller type='sata' index='0'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x03'
function='0x0'/>
</controller>
which results in qemu args
-device ahci,id=ahci0,bus=pci.0,multifunction=on,addr=0x3.0x0 -drive
file=/var/lib/libvirt/images/test/disk0.raw,if=none,id=drive-sata-dik0,format=raw
-device
ide-drive,bus=ahci0.0,drive=drive-sata-disk0,id=sata-disk0,bootindex=1
If the controller is not explicitly defined, the AHCI device (-device
ahci,...) is not created and qemu fails with
qemu-kvm: -device
ide-drive,bus=ahci0.0,drive=drive-sata-disk0,id=sata-disk0,bootindex=1:
Bus 'a
hci0.0' not found
I'm not quite sure how to create the controller when not explicitly
defined in the config.
Also, I suspect there are many things I'm missing in adding support for
this controller. E.g., I've ignored hotplug for the moment. What would
be considered minimal functionality for supporting this controller?
Thanks!
Jim
[1]
http://www.redhat.com/archives/libvir-list/2011-August/msg01034.html