WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Xend: Fix Device Duplicate Check

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Xend: Fix Device Duplicate Check
From: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>
Date: Mon, 17 Dec 2007 18:28:05 +0900
Delivery-date: Mon, 17 Dec 2007 01:28:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)
Hi,

This patch fixes device duplicate check as follows.

- Add duplicate check for the blktap device
- Do case-insensitve comparison for mac addresses

Regards,
-------------------
Yosuke Iwamatsu
        NEC Corporation





# HG changeset patch
# User y-iwamatsu@xxxxxxxxxxxxx
# Date 1197871440 -32400
# Node ID f9b5560cfe23eba8870bcca48fb42bf9fb4fbd65
# Parent  966a6d3b74087474df337e00b31cbecf495b442a
Xend: Fix device duplicate check.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>

diff -r 966a6d3b7408 -r f9b5560cfe23 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Fri Dec 14 11:50:24 2007 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Mon Dec 17 15:04:00 2007 +0900
@@ -1023,7 +1023,7 @@ class XendConfig(dict):
     def device_duplicate_check(self, dev_type, dev_info, defined_config):
         defined_devices_sxpr = self.all_devices_sxpr(target = defined_config)
         
-        if dev_type == 'vbd':
+        if dev_type == 'vbd' or dev_type == 'tap':
             dev_uname = dev_info.get('uname')
             blkdev_name = dev_info.get('dev')
             devid = self._blkdev_name_to_number(blkdev_name)
@@ -1046,7 +1046,7 @@ class XendConfig(dict):
             
             for o_dev_type, o_dev_info in defined_devices_sxpr:
                 if dev_type == o_dev_type:
-                    if dev_mac == sxp.child_value(o_dev_info, 'mac'):
+                    if dev_mac.lower() == sxp.child_value(o_dev_info, 
'mac').lower():
                         raise XendConfigError('The mac "%s" is already 
defined' %
                                               dev_mac)
     
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>