
Am 05.08.2013 09:40, schrieb Laine Stump:
On 08/04/2013 07:55 PM, Doug Goldstein wrote:
On Sat, Aug 3, 2013 at 9:01 PM, Laine Stump <laine@laine.org> wrote:
q35 machines have an implicit ahci (sata) controller at 00:1F.2 which has no "id" associated with it. For this reason, we can't refer to it as "ahci0". Instead, we don't give an id on the commandline, which qemu interprets as "use the first ahci controller". We then need to specify the unit with "unit=%d" rather than adding it onto the bus arg. Maybe its called ich9-ahci0 instead of ahci0? Or ide0 or ide1? The reason I ask is this code in QEMU.
/* ahci and SATA device, for q35 1 ahci controller is built-in */ ahci = pci_create_simple_multifunction(host_bus, PCI_DEVFN(ICH9_SATA1_DEV, ICH9_SATA1_FUNC), true, "ich9-ahci"); idebus[0] = qdev_get_child_bus(&ahci->qdev, "ide.0"); idebus[1] = qdev_get_child_bus(&ahci->qdev, "ide.1");
Which is from the q35 bring up code.
I'm not familiar enough the the qemu code to know where the "ich9-ahci" string is going, but my information source was running "virsh qemu-monitor-command --pretty $domain '{"execute":"query-pci"}'" on a running domain, then looking at the "qdev_id" attribute of the device. That attribute is '' on the sata controller, but (for example) "pci.2" on the pci-bridge, and "ahci1" on a 2nd sata controller that is added by libvirt.
Andreas - does this implicit sata device really have no "id"? If not, then your suggestion of omiting the id for the first controller (I'm remembering correctly that it was you, right?) seems to work just fine (although I agree with Doug that it makes the code feel a bit "dirty").
The code snippet above (which I have not further verified) indicates two busses, named "ide.0" and "ide.1" respectively. So bus=ide.0 or bus=ide.1 should work, just like pcie.0 works for the built-in PCIe host bridge. "ich9-ahci" is the type name of the device, which you can use with -device and device-add or see in qom-list-types. Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg