Moti Asayag has posted comments on this change.

Change subject: Define network filter on libvirt
......................................................................


Patch Set 3: (6 inline comments)

....................................................
File vdsm/Makefile.am
Line 52:        tc.py \
Line 53:        vdsmDebugPlugin.py \
Line 54:        vmChannels.py \
Line 55:        vm.py \
Line 56:        nwfilter.py
Done
Line 57: 
Line 58: dist_vdsmpylib_PYTHON = \
Line 59:        __init__.py \
Line 60:        define.py \


....................................................
File vdsm/nwfilter.py
Line 34: 
Line 35:     try:
Line 36:         NoMacSpoofingFilter().defineNwFilter(conn)
Line 37:     except libvirt.libvirtError, e:
Line 38:         traceback.print_exc()
Done
Line 39:         logging.error("Failed to define network filter: %s" % 
e.message)
Line 40:         raise
Line 41:     finally:
Line 42:         try:


Line 39:         logging.error("Failed to define network filter: %s" % 
e.message)
Line 40:         raise
Line 41:     finally:
Line 42:         try:
Line 43:             conn.close()
i wouldn't like to exit this program with exit code <> 0 just due to connection 
close error.

How would the interpreter behave if the GC fails to close the connection ?
Line 44:         except libvirt.libvirtError:
Line 45:             pass
Line 46: 
Line 47: class NwFilter(object):


Line 71:             # is being used by running VMs
Line 72:             pass
Line 73: 
Line 74:         try:
Line 75:             nwFilter = conn.nwfilterDefineXML(self.buildFilterXml())
if wishes to remove the debug info from the else-part of this block - will do 
so.

I think for debug purpose this info could be useful to the user to know the 
filter was defined as he expected it (instead 'virsh nwfilter-list | grep 
my_filter_name)
Line 76:         except libvirt.libvirtError:
Line 77:             logging.error("Failed to define filter %s" % 
(self.filterName))
Line 78:             raise
Line 79:         else:


Line 73: 
Line 74:         try:
Line 75:             nwFilter = conn.nwfilterDefineXML(self.buildFilterXml())
Line 76:         except libvirt.libvirtError:
Line 77:             logging.error("Failed to define filter %s" % 
(self.filterName))
Done
Line 78:             raise
Line 79:         else:
Line 80:             logging.debug("Filter %s was defined" % (nwFilter.name()))
Line 81: 


Line 90:         NwFilter.__init__(self, 'vdsm-no-mac-spoofing')
Line 91: 
Line 92:     def getFilterXml(self):
Line 93:         return '''<filter name='%s' chain='root'>
Line 94:                       <!-- preventing MAC spoofing -->
Done
Line 95:                       <filterref filter='no-mac-spoofing'/>
Line 96:                       <!-- preventing ARP MAC spoofing -->
Line 97:                       <filterref filter='no-arp-mac-spoofing'/>
Line 98:                   </filter> '''


--
To view, visit http://gerrit.ovirt.org/7354
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f1708385dec6a87bc404e4ab25c4da8ab8a8acc
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to