Reviewed-By: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
On 19/12/2016 11:52, Aline Manera wrote:
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
model/vmhostdevs.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/model/vmhostdevs.py b/model/vmhostdevs.py
index 1f893f2..6b02f4d 100644
--- a/model/vmhostdevs.py
+++ b/model/vmhostdevs.py
@@ -636,6 +636,13 @@ class VMHostDevModel(object):
return
wok_log.info("Device %s removed successfuly" % alias)
+ # Re-attach device to host
+ try:
+ dev = conn.get().nodeDeviceLookupByName(alias)
+ dev.reAttach()
+ except libvirt.libvirtError, e:
+ wok_log.error("Unable to attach device %s back to host. Error:
%s",
+ alias, e.message)
opaque._cb('OK', True)
def _detach_device(self, cb, params):
--
Lucio Correia