Bug 499576 - RHEL5.4 vt-d: Assigning a PCI device using virt-manager/virt-install fails
RHEL5.4 vt-d: Assigning a PCI device using virt-manager/virt-install fails
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: python-virtinst (Show other bugs)
5.4
All Linux
high Severity medium
: rc
: ---
Assigned To: Daniel Berrange
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-07 05:44 EDT by Mark McLoughlin
Modified: 2009-12-14 16:03 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 499267
Environment:
Last Closed: 2009-06-08 11:30:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark McLoughlin 2009-05-07 05:44:06 EDT
+++ This bug was initially created as a clone of Bug #499267 +++

Just tested virt-manager's device assignment with the following steps:

  * Run virt-manager, open an existing guest and go to the details tab
  * Click "Add hardware", choose "Physical host device" and click "Forward"
  * Choose the appropriate device from the drop down list (e.g. "00:19.0 Interface eth0 (82566DM-2 Gigabit Network Connection)")
  * Click "Forward" and "Finish" 

and it failed with:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 571, in finish
    self.add_hostdev()
  File "/usr/share/virt-manager/virtManager/addhardware.py", line 607, in add_hostdev
    self._dev.setup()
  File "/usr/lib/python2.6/site-packages/virtinst/VirtualHostDevice.py", line 207, in setup
    raise RuntimeError(_("Could not detach PCI device: %s" % str(e)))
RuntimeError: Could not detach PCI device: 'PCIDevice' object has no attribute 'dettach'

--- Additional comment from markmc@redhat.com on 2009-05-05 17:07:50 EDT ---

Just tried with virt-install --host-device and got the same error

--- Additional comment from markmc@redhat.com on 2009-05-06 09:41:36 EDT ---

Okay, the problem turns out to be that VirtualHostDevice._nodedev is a NodeDevice, not a virNodeDevice yet we do this:

  self._nodedev.dettach()
  self._nodedev.reset()

We need a comprehensive fix which doesn't throw away the virNodeDevice in NodeDeviceParser.lookupNodeName(), but I think we should temporarily disable this dettach/reset code for F11 GA and the test day tomorrow

--- Additional comment from crobinso@redhat.com on 2009-05-06 10:09:36 EDT ---

Created an attachment (id=342658)
Call detach/reset on the correct object

Seems to have done the job, since choosing an arbitrary pci entry in 'virsh nodedev-list' and passing to --host-device managed to lock my machine up :)

--- Additional comment from markmc@redhat.com on 2009-05-06 11:12:13 EDT ---

Looks good to me

--- Additional comment from crobinso@redhat.com on 2009-05-06 12:36:36 EDT ---

Built into python-virtinst-0.400.3-8.fc11.

--- Additional comment from markmc@redhat.com on 2009-05-06 16:21:38 EDT ---

Tag request: https://fedorahosted.org/rel-eng/ticket/1749

* Wed May 06 2009 Cole Robinson <crobinso@redhat.com> - 0.400.3-8.fc11
- Fix PCI assignment (bz 499267)

--- Additional comment from markmc@redhat.com on 2009-05-06 17:37:25 EDT ---

Tagged now
Comment 1 Cole Robinson 2009-05-28 13:50:15 EDT
The patch for this is upstream here:

http://hg.et.redhat.com/cgi-bin/hg-virt.cgi/applications/virtinst--devel/rev/ab3111177ec1

Fix is very low risk, and without it, PCI device assignment doesn't work via virtinst + virt-manager. Since PCI assignment support in the tools is one of the big features for 5.4, we should probably get this in.
Comment 2 Cole Robinson 2009-06-08 11:30:09 EDT
Fixed in python-virtinst-0.400.3-2.el5. Closing as NEXTRELEASE, since this bug (and the affected functionality) has not existed in any released package as it was brought in by the rebase.

Note You need to log in before you can comment on or make changes to this bug.