From: Stefan Berger Subject: [PATCH] [xend] [ACM] Prevent labeling of vlans with the same color Date: Wed, 02 Apr 2008 20:32:08 -0400 Message-ID: <1207182728.8634.3.camel@gsal-3.watson.ibm.com> Reply-To: stefanb@us.ibm.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-DRqp59RfdBwmEZ2xyZr9" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org --=-DRqp59RfdBwmEZ2xyZr9 Content-Type: text/plain Content-Transfer-Encoding: 7bit This patch prevents the labeling of vlans with the same color. Signed-off-by: Stefan Berger --=-DRqp59RfdBwmEZ2xyZr9 Content-Disposition: inline; filename=vlan_same_color_reject.diff Content-Type: text/x-patch; name=vlan_same_color_reject.diff; charset=UTF-8 Content-Transfer-Encoding: 7bit Index: root/xen-unstable.hg/tools/python/xen/util/xsm/acm/acm.py =================================================================== --- root.orig/xen-unstable.hg/tools/python/xen/util/xsm/acm/acm.py +++ root/xen-unstable.hg/tools/python/xen/util/xsm/acm/acm.py @@ -1236,6 +1236,9 @@ def set_resource_label(resource, policyt return -xsconstants.XSERR_BAD_LABEL if tmp[2] != oreslabel: return -xsconstants.XSERR_BAD_LABEL + if resource.startswith('vlan:'): + if tuple([policytype, policyref, reslabel]) in access_control.values(): + return -xsconstants.XSERR_BAD_LABEL if reslabel != "": new_entry = { resource : tuple([policytype, policyref, reslabel])} access_control.update(new_entry) --=-DRqp59RfdBwmEZ2xyZr9 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-DRqp59RfdBwmEZ2xyZr9--