[virt-tools-list] [virt-manager PATCH 2/2] virtManager: UI: add support enable setting multifunction on hostdev

Chen Hanxiao chen_han_xiao at 126.com
Wed May 10 10:40:00 UTC 2017





At 2017-05-10 18:04:37, "Pavel Hrdina" <phrdina at redhat.com> wrote:
>On Tue, May 09, 2017 at 06:23:57PM +0800, Chen Hanxiao wrote:
>> From: Chen Hanxiao <chenhanxiao at gmail.com>
>> 
>>   We could turn on/off multifunction of hostdev
>>   in page details.
>> 
>> Signed-off-by: Chen Hanxiao <chenhanxiao at gmail.com>
>> ---
>>  ui/details.ui          | 74 ++++++++++++++++++++++++++++++--------------------
>>  virtManager/details.py | 13 ++++++++-
>>  virtManager/domain.py  |  8 +++++-
>>  3 files changed, 64 insertions(+), 31 deletions(-)
>
>In the future please don't include the unrelated changes to the
>generated UI files, it adds a lot of noise.
>

Maybe I need to update may glade.

>The patch itself is wrong, it configures the multifunction attribute
>for the source address introduced by previous patch, but the source
>address describes the PCI address of the device in the host.
>
>What we actually need is to properly configure the <address> element
>presented to the guest which is not possible via the virt-manager UI.
>Adding just the "multifunction" checkbox doesn't help at all.
>
>Lets consider, that the guest has the following Nvidia GPU card:
>
>06:00.0 VGA compatible controller: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1)
>06:00.1 Audio device: NVIDIA Corporation GM204 High Definition Audio Controller [10de:0fbb] (rev a1)}}
>
>And we need to get the following XML:
>
>    ...
>    <hostdev mode='subsystem' type='pci' managed='yes'>
>      <source>
>        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
>      </source>
>      <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0' multifunction='on'/>
>    </hostdev>
>    <hostdev mode='subsystem' type='pci' managed='yes'>
>      <source>
>        <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
>      </source>
>      <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x1'/>
>    </hostdev>
>    ...
>
>In order to achieve this configuration virt-manager would have to do
>some post-parsing of the created configuration to detect that there
>are two host devices with the same address except the function and
>ensure that they are presented as different functions to the guest
>or add UI bits to configure the address presented to the guest manually.
>
>Currently virt-manager don't create the guest address because that
>one is automatically generated by libvirt and is not required, only
>the source address is required.

The auto-generated adrress from libvirt don't add multifunction.
We could edit the address in details via:

hostdev.address.multifunction

Regards,
- Chen


>
>Pavel




More information about the virt-tools-list mailing list