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

[Xen-changelog] [xen-unstable] xenapi: Implement XenAPI method VBD.set_mode in python.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1181730467 -3600
# Node ID ffdbe8aebde21710deca4ae84bba95e38f4b089b
# Parent  7f9362a8ae3daeb5dc7bc62069eae872c42a5a14
xenapi: Implement XenAPI method VBD.set_mode in python.
Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -r 7f9362a8ae3d -r ffdbe8aebde2 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Wed Jun 13 11:27:08 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Wed Jun 13 11:27:47 2007 +0100
@@ -1887,6 +1887,17 @@ class XendAPI(object):
         xd.managed_config_save(vm)
         return xen_api_success_void()
 
+    def VBD_set_mode(self, session, vbd_ref, mode):
+        if mode == 'RW':
+            mode = 'w'
+        else:
+            mode = 'r'
+        xd = XendDomain.instance()
+        vm = xd.get_vm_with_dev_uuid('vbd', vbd_ref)
+        vm.set_dev_property('vbd', vbd_ref, 'mode', mode)
+        xd.managed_config_save(vm)
+        return xen_api_success_void()
+
     def VBD_get_all(self, session):
         xendom = XendDomain.instance()
         vbds = [d.get_vbds() for d in XendDomain.instance().list('all')]

_______________________________________________
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®.