merge with xen-unstable.hg

This commit is contained in:
Alex Williamson committed 2007-06-15 13:33:11 -06:00
commit b51cbb0e12
29 files changed
+477 -401

No files matched your search

+17
View File
@@ -1483,6 +1483,12 @@ class XendAPI(object):
else:
return xen_api_success_void()
def VM_set_VCPUs_at_startup(self, session, vm_ref, num):
return self.VM_set('VCPUs_at_startup', session, vm_ref, num)
def VM_set_VCPUs_max(self, session, vm_ref, num):
return self.VM_set('VCPUs_max', session, vm_ref, num)
def VM_set_actions_after_shutdown(self, session, vm_ref, action):
if action not in XEN_API_ON_NORMAL_EXIT:
return xen_api_error(['VM_ON_NORMAL_EXIT_INVALID', vm_ref])
@@ -1887,6 +1893,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')]
+5 -5
View File
@@ -65,11 +65,11 @@ def _solaris_balloon_stat(label):
import fcntl
import array
DEV_XEN_BALLOON = '/dev/xen/balloon'
BLN_IOCTL_CURRENT = 0x4201
BLN_IOCTL_TARGET = 0x4202
BLN_IOCTL_LOW = 0x4203
BLN_IOCTL_HIGH = 0x4204
BLN_IOCTL_LIMIT = 0x4205
BLN_IOCTL_CURRENT = 0x42410001
BLN_IOCTL_TARGET = 0x42410002
BLN_IOCTL_LOW = 0x42410003
BLN_IOCTL_HIGH = 0x42410004
BLN_IOCTL_LIMIT = 0x42410005
label_to_ioctl = { 'Current allocation' : BLN_IOCTL_CURRENT,
'Requested target' : BLN_IOCTL_TARGET,
'Low-mem balloon' : BLN_IOCTL_LOW,
+15 -15
View File
@@ -213,7 +213,7 @@ class DevController:
devid = int(devid)
frontpath = self.frontendPath(devid)
if frontpath:
if frontpath:
backpath = xstransact.Read(frontpath, "backend")
# Modify online status /before/ updating state (latter is watched by
@@ -224,22 +224,22 @@ class DevController:
if force:
if backpath:
xstransact.Remove(backpath)
if frontpath:
if frontpath:
xstransact.Remove(frontpath)
return
return
# Wait till both frontpath and backpath are removed from
# xenstore, or timed out
if frontpath:
status = self.waitUntilDestroyed(frontpath)
if status == Timeout:
# Exception will be caught by destroyDevice in XendDomainInfo.py
raise EnvironmentError
if backpath:
status = self.waitUntilDestroyed(backpath)
if status == Timeout:
# Exception will be caught by destroyDevice in XendDomainInfo.py
raise EnvironmentError
# Wait till both frontpath and backpath are removed from
# xenstore, or timed out
if frontpath:
status = self.waitUntilDestroyed(frontpath)
if status == Timeout:
# Exception will be caught by destroyDevice in XendDomainInfo.py
raise EnvironmentError
if backpath:
status = self.waitUntilDestroyed(backpath)
if status == Timeout:
# Exception will be caught by destroyDevice in XendDomainInfo.py
raise EnvironmentError
self.vm._removeVm("device/%s/%d" % (self.deviceClass, devid))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.