On Tue, May 09, 2017 at 06:23:57PM +0800, Chen Hanxiao wrote: > From: Chen Hanxiao <chenhanxiao@xxxxxxxxx> > > We could turn on/off multifunction of hostdev > in page details. > > Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxx> > --- > 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. 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. Pavel
Attachment:
signature.asc
Description: Digital signature
_______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list