Change in vdsm[master]: revert: libvirt is happy with redefinition of nwfilter
phoracek at redhat.com
phoracek at redhat.com
Tue Sep 9 11:32:04 UTC 2014
Petr Horáček has uploaded a new change for review.
Change subject: revert: libvirt is happy with redefinition of nwfilter
......................................................................
revert: libvirt is happy with redefinition of nwfilter
Change-Id: If7ab71951ae4edef750be9a4f944e3180d568c91
Bug-Url: https://bugzilla.redhat.com/1138807
Signed-off-by: Petr Horáček <phoracek at redhat.com>
---
M lib/vdsm/tool/nwfilter.py
1 file changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/32691/1
diff --git a/lib/vdsm/tool/nwfilter.py b/lib/vdsm/tool/nwfilter.py
index 85f6303..19c95f6 100755
--- a/lib/vdsm/tool/nwfilter.py
+++ b/lib/vdsm/tool/nwfilter.py
@@ -21,6 +21,8 @@
import logging
+import libvirt
+
from .. import libvirtconnection
from . import expose, ExtraArgsError
@@ -57,6 +59,14 @@
define vdsm network filter on libvirt to control VM traffic
"""
+ try:
+ conn.nwfilterLookupByName(self.filterName).undefine()
+ except libvirt.libvirtError:
+ # Ignore failure if filter isn't exists or if failed to remove.
+ # Failure might occur when attempting to remove a filter which
+ # is being used by running VMs
+ pass
+
nwFilter = conn.nwfilterDefineXML(self.buildFilterXml())
logging.debug("Filter %s was defined", nwFilter.name())
--
To view, visit http://gerrit.ovirt.org/32691
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7ab71951ae4edef750be9a4f944e3180d568c91
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
More information about the vdsm-patches
mailing list