[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.