|
|
|
|
|
|
|
|
|
|
xen-changelog
[Xen-changelog] Added sxprs, for xm block-list.
# HG changeset patch
# User emellor@ewan
# Node ID 41735ccc5ee3b78eadeea72cef2883c344b821a3
# Parent 7c5d9879967dc91184253c2798344545d6e30b95
Added sxprs, for xm block-list.
diff -r 7c5d9879967d -r 41735ccc5ee3
tools/python/xen/xend/server/DevController.py
--- a/tools/python/xen/xend/server/DevController.py Tue Sep 27 21:02:57 2005
+++ b/tools/python/xen/xend/server/DevController.py Tue Sep 27 21:03:55 2005
@@ -81,6 +81,22 @@
xstransact.Remove(backpath)
+ def sxprs(self):
+ """@return an s-expression describing all the devices of this
+ controller's device-class.
+ """
+ path = self.frontendRoot()
+ while True:
+ t = xstransact(path)
+ try:
+ listing = t.list_recursive()
+ if t.commit():
+ return listing
+ except:
+ t.abort()
+ raise
+
+
def sxpr(self, devid):
"""@return an s-expression describing the specified device.
"""
@@ -126,8 +142,8 @@
compulsory to use it; subclasses may prefer to allocate IDs based upon
the device configuration instead.
"""
+ path = self.frontendMiscPath()
while True:
- path = self.frontendMiscPath()
t = xstransact(path)
try:
result = t.read("nextDeviceID")
@@ -196,8 +212,11 @@
def frontendPath(self, devid):
- return "%s/device/%s/%d" % (self.vm.getPath(), self.deviceClass,
- devid)
+ return "%s/%d" % (self.frontendRoot(), devid)
+
+
+ def frontendRoot(self):
+ return "%s/device/%s" % (self.vm.getPath(), self.deviceClass)
def frontendMiscPath(self):
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-changelog] Added sxprs, for xm block-list.,
Xen patchbot -unstable <=
|
|
|
|
|