commit cd0ab9be665571ebb8c5fbea6e0351aee7fdbb54
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Mon Sep 16 15:03:03 2013 +0200
Machine: ensure virt device cleanup
This commit ensures that virtual devices are cleaned up even when the
slave connection was lost. They won't be cleaned up when the deconfigure
parameter is set to false - this happens when lnst-ctl is run with
config_only.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/Machine.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 6a870ef..b104966 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -158,6 +158,11 @@ class Machine(object):
#connection to the slave was closed
if not self._msg_dispatcher.get_connection(self._id):
+ #we still need to remove virtual interfaces
+ if deconfigure:
+ for iface in reversed(self._interfaces):
+ if isinstance(iface, VirtualInterface):
+ iface.cleanup()
return
self._rpc_call("kill_cmds")
Show replies by date