[libvirt] [PATCH] expose SR IOV physical/virtual function relationships
Dave Allan
dallan at redhat.com
Tue Dec 1 17:03:49 UTC 2009
Daniel P. Berrange wrote:
> On Tue, Dec 01, 2009 at 10:33:08AM -0500, Dave Allan wrote:
>> Attached is a patch that exposes the relationships between physical and
>> virtual functions on SR IOV capable devices.
>>
>
>
>> + if (data->pci_dev.physical_function) {
>> + virBufferEscapeString(&buf, " <physical_function>%s</physical_function>\n",
>> + data->pci_dev.physical_function);
>> + }
>> + if (data->pci_dev.num_virtual_functions > 0) {
>> + for (i = 0 ; i < data->pci_dev.num_virtual_functions ; i++) {
>> + virBufferEscapeString(&buf, " <virtual_function>%s</virtual_function>\n",
>> + data->pci_dev.virtual_functions[i]);
>> + }
>> + }
>
>
> What is the actual content of those two new elements ? Are they
> the names of the corresponding device, suitble for a virNodeDevLooupByName() ?
They are the PCI device BDF or config address, e.g.:
<virtual_function>0000:01:10.0</virtual_function>
so, no, they aren't suitable for lookup by name. Using the names of the
corresponding devices was my first attempt, but there is a dependency
problem there. At the time that we process one device, the others
aren't necessarily created in libvirt, so it's not possible to look them
up. If we wanted to go that route, we'd have to do additional work at
the time of dumping the xml, which I think is a little kludgy. I'd
rather we created an API to lookup a libvirt device by its BDF.
Dave
>
> REgards,
> Daniel
More information about the libvir-list
mailing list