direct-io.hg

changeset 15274:ffdbe8aebde2

xenapi: Implement XenAPI method VBD.set_mode in python.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
author kfraser@localhost.localdomain
date Wed Jun 13 11:27:47 2007 +0100 (2007-06-13)
parents 7f9362a8ae3d
children b643179d7452
files tools/python/xen/xend/XendAPI.py
line diff
     1.1 --- a/tools/python/xen/xend/XendAPI.py	Wed Jun 13 11:27:08 2007 +0100
     1.2 +++ b/tools/python/xen/xend/XendAPI.py	Wed Jun 13 11:27:47 2007 +0100
     1.3 @@ -1887,6 +1887,17 @@ class XendAPI(object):
     1.4          xd.managed_config_save(vm)
     1.5          return xen_api_success_void()
     1.6  
     1.7 +    def VBD_set_mode(self, session, vbd_ref, mode):
     1.8 +        if mode == 'RW':
     1.9 +            mode = 'w'
    1.10 +        else:
    1.11 +            mode = 'r'
    1.12 +        xd = XendDomain.instance()
    1.13 +        vm = xd.get_vm_with_dev_uuid('vbd', vbd_ref)
    1.14 +        vm.set_dev_property('vbd', vbd_ref, 'mode', mode)
    1.15 +        xd.managed_config_save(vm)
    1.16 +        return xen_api_success_void()
    1.17 +
    1.18      def VBD_get_all(self, session):
    1.19          xendom = XendDomain.instance()
    1.20          vbds = [d.get_vbds() for d in XendDomain.instance().list('all')]