Change in vdsm[master]: vmfex hook: remove filter from directly-attached vnics
danken at redhat.com
danken at redhat.com
Tue Feb 16 10:14:10 UTC 2016
Dan Kenigsberg has uploaded a new change for review.
Change subject: vmfex hook: remove filter from directly-attached vnics
......................................................................
vmfex hook: remove filter from directly-attached vnics
It seems that libvirt has become more strict, and would not accept a
filterref that it cannot enforce. This patch makes the hook drop the
<filterref> element that is added by Vdsm.
Change-Id: I47f38a76b06c4d8e8dd14adb7e9c0a1eb6e3ad9e
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1308839
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm_hooks/vmfex_dev/vmfex_vnic.py
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/53571/1
diff --git a/vdsm_hooks/vmfex_dev/vmfex_vnic.py b/vdsm_hooks/vmfex_dev/vmfex_vnic.py
index 6d41639..2ecd88c 100755
--- a/vdsm_hooks/vmfex_dev/vmfex_vnic.py
+++ b/vdsm_hooks/vmfex_dev/vmfex_vnic.py
@@ -131,6 +131,11 @@
interface.setAttribute('type', 'network')
+def removeFilter(interface):
+ for filterElement in interface.getElementsByTagName('filterref'):
+ removeFilter(interface, filterElement)
+
+
def test():
interface = minidom.parseString("""
<interface type="bridge">
@@ -149,6 +154,8 @@
interface.toprettyxml(encoding='UTF-8'))
attachProfileToInterfaceXml(interface, 'Profail')
+ removeFilter(interface)
+
print("Interface after attaching to VM-FEX port: %s" %
interface.toprettyxml(encoding='UTF-8'))
@@ -171,6 +178,7 @@
doc = hooking.read_domxml()
interface, = doc.getElementsByTagName('interface')
attachProfileToInterfaceXml(interface, portProfile)
+ removeFilter(interface)
hooking.write_domxml(doc)
--
To view, visit https://gerrit.ovirt.org/53571
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I47f38a76b06c4d8e8dd14adb7e9c0a1eb6e3ad9e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
More information about the vdsm-patches
mailing list