On 10/26/2009 05:20 PM, Cole Robinson wrote:
Well, I didn't find it in devs (get_devices()) so that I can't check how to compare it using bus/addr. I've been using testdriver.xml you wrote about but get_devices() returns empty list and I can't make PCI passthrough working right on my machine.On 10/26/2009 10:59 AM, Michal Novotny wrote:Hi, this is new version of host device information bits, tested with PCI devices as well. Thanks, MichalI think we should support USB devices by bus/addr and PCI devices before pushing.
What data would you like to limit it to? Source Device should be dev.pretty_name() and what about other information? I have tested it on WinXP virtual machine with Bluetooth device passed to the VM and all the fields were populated. I am attaching a screenshot of my WinXP VM with Bluetooth device assigned...The libvirt test driver now supports host device routines as of 0.7.2, so if you pull that version and install, you should be able to use my updated test driver to emulate PCI and USB device passthrough: http://fedorapeople.org/~crobinso/virt-manager/testdriver.xml Another thing, after looking at the UI changes, we are exposing a lot of redundant info. If the device info lookup succeeds, we should just set 'Source Device' to use dev.pretty_name(), which gives all the info they might want. This saves us having to add a bunch of UI fields that may not be populated anyways.
diff -r e363de9ac549 src/virtManager/details.py --- a/src/virtManager/details.py Wed Oct 21 12:01:53 2009 -0400 +++ b/src/virtManager/details.py Mon Oct 26 15:58:02 2009 +0100 @@ -1173,12 +1173,35 @@ if not hostdevinfo: return + try: + typ = hostdevinfo['type'] + if typ == 'usb': + typ = 'usb_device' + vendor_id = hostdevinfo['vendor']['id'] + product_id = hostdevinfo['product']['id'] + except Exception, e: + vendor_id = -1 + product_id = -1 + + dev_pretty_name = None + dev_vendor_name = None + dev_product_name = None + devs = self.vm.get_connection().get_devices( typ, None ) + for dev in devs: + if dev.product_id == product_id and dev.vendor_id == vendor_id: + dev_pretty_name = dev.pretty_name() + dev_vendor_name = dev.vendor_name + dev_product_name = dev.product_name +When you go to support PCI devices, I'd just break this logic out into a helper function in domain.py. Thanks, Cole
Description: PNG image