Blame virtinst-0.400.3-hostdev-libvirt-calls.patch
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# HG changeset patch
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# User Cole Robinson <crobinso@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# Date 1237302675 14400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# Node ID 1288ff456cdb1a387771624594300ab6be324181
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# Parent 143cad71a2a6e83bfff7f46a0f7105e3eeb43ab2
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
Fix node device dettach/reset libvirt calls
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
diff -r 143cad71a2a6 -r 1288ff456cdb virtinst/NodeDeviceParser.py
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
--- a/virtinst/NodeDeviceParser.py Mon Mar 09 23:31:51 2009 -0400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+++ b/virtinst/NodeDeviceParser.py Tue Mar 17 11:11:15 2009 -0400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
@@ -405,10 +405,11 @@
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
if not isinstance(conn, libvirt.virConnect):
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
raise ValueError(_("'conn' must be a virConnect instance."))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
- if dir(libvirt).count("virNodeDeviceDettach") == 0:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
- return False
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+ if (hasattr(libvirt, "virNodeDevice") and
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+ hasattr(libvirt.virNodeDevice, "dettach")):
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+ return True
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
- return True
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+ return False
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
def lookupNodeName(conn, name):
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
"""
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
diff -r 143cad71a2a6 -r 1288ff456cdb virtinst/VirtualHostDevice.py
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
--- a/virtinst/VirtualHostDevice.py Mon Mar 09 23:31:51 2009 -0400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+++ b/virtinst/VirtualHostDevice.py Tue Mar 17 11:11:15 2009 -0400
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
@@ -201,8 +201,8 @@
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
try:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# Do this as a sanity check, so that we don't fail at domain
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
# start time
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
- self._nodedev.deviceDetach()
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
- self._nodedev.deviceReset()
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+ self._nodedev.dettach()
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
+ self._nodedev.reset()
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
except Exception, e:
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
raise RuntimeError(_("Could not detach PCI device: %s" % str(e)))
|
|
![](https://seccdn.libravatar.org/avatar/e0cb5334e5a1824445e4ed5d9488fcffc5d667adb8665f37581b8d299b22ec59?s=16&d=retro) |
fb96538 |
|