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][XenAPI] Implement VBD.set_mode

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH][XenAPI] Implement VBD.set_mode
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Tue, 12 Jun 2007 15:52:31 -0600
Delivery-date: Tue, 12 Jun 2007 14:50:41 -0700
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 1.5.0.8 (X11/20060911)
This patch implements the XenAPI method VBD.set_mode in xend.  This
method is already implemented in XenAPI c-bindings.

Regards,
Jim

# HG changeset patch
# User Jim Fehlig <jfehlig@xxxxxxxxxx>
# Date 1181684926 21600
# Node ID b1ffa0282ce1c94db7df4e751e16e13ba1aef14c
# Parent  93f77a5a8437df0b34919a6987f48e84342b4a43
Implement XenAPI method VBD.set_mode.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>

diff -r 93f77a5a8437 -r b1ffa0282ce1 tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Sun Jun 10 19:58:22 2007 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Tue Jun 12 15:48:46 2007 -0600
@@ -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-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][XenAPI] Implement VBD.set_mode, Jim Fehlig <=