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-changelog

[Xen-changelog] Use DevController.allocateDeviceID rather than using a l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Use DevController.allocateDeviceID rather than using a local variable.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Sep 2005 13:26:24 +0000
Delivery-date: Mon, 19 Sep 2005 13:26:48 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID db4a0526d4e5e520de578ee01987e58445b8735c
# Parent  951c8ee275b72c0475924c3939db2b558d86cb11
Use DevController.allocateDeviceID rather than using a local variable.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 951c8ee275b7 -r db4a0526d4e5 tools/python/xen/xend/server/usbif.py
--- a/tools/python/xen/xend/server/usbif.py     Mon Sep 19 12:41:41 2005
+++ b/tools/python/xen/xend/server/usbif.py     Mon Sep 19 12:44:05 2005
@@ -25,9 +25,6 @@
 from xen.xend.server.DevController import DevController
 
 
-next_devid = 1
-
-
 class UsbifController(DevController):
     """USB device interface controller. Handles all USB devices
     for a domain.
@@ -42,9 +39,4 @@
     def getDeviceDetails(self, _):
         """@see DevController.getDeviceDetails"""
 
-        global next_devid
-
-        devid = next_devid
-        next_devid += 1
-
-        return (devid, {}, {})
+        return (self.allocateDeviceID(), {}, {})

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>