This commit is contained in:
Tim Deegan committed 2007-02-01 15:03:55 +00:00
commit 45d4d259a2
16 files changed
+426 -93

No files matched your search

+36 -8
View File
@@ -974,7 +974,8 @@ class XendAPI(object):
'PV_ramdisk',
'PV_args',
'PV_bootloader_args',
'HVM_boot',
'HVM_boot_policy',
'HVM_boot_params',
'platform_std_VGA',
'platform_serial',
'platform_localtime',
@@ -1020,7 +1021,8 @@ class XendAPI(object):
'PV_ramdisk',
'PV_args',
'PV_bootloader_args',
'HVM_boot',
'HVM_boot_policy',
'HVM_boot_params',
'platform_std_VGA',
'platform_serial',
'platform_localtime',
@@ -1158,8 +1160,11 @@ class XendAPI(object):
def VM_get_PV_bootloader_args(self, session, vm_ref):
return self.VM_get('PV_bootloader_args', session, vm_ref)
def VM_get_HVM_boot(self, session, vm_ref):
return self.VM_get('HVM_boot', session, vm_ref)
def VM_get_HVM_boot_policy(self, session, vm_ref):
return self.VM_get('HVM_boot_policy', session, vm_ref)
def VM_get_HVM_boot_params(self, session, vm_ref):
return self.VM_get('HVM_boot_params', session, vm_ref)
def VM_get_platform_std_VGA(self, session, vm_ref):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
@@ -1246,8 +1251,30 @@ class XendAPI(object):
return xen_api_error(['VM_ON_CRASH_BEHAVIOUR_INVALID', vm_ref])
return self.VM_set('actions_after_crash', session, vm_ref, action)
def VM_set_HVM_boot(self, session, vm_ref, value):
return self.VM_set('HVM_boot', session, vm_ref, value)
def VM_set_HVM_boot_policy(self, session, vm_ref, value):
if value != "" and value != "BIOS order":
return xen_api_error(
['VALUE_NOT_SUPPORTED', 'VM.HVM_boot_policy', value,
'Xend supports only the "BIOS order" boot policy.'])
else:
return self.VM_set('HVM_boot_policy', session, vm_ref, value)
def VM_set_HVM_boot_params(self, session, vm_ref, value):
return self.VM_set('HVM_boot_params', session, vm_ref, value)
def VM_add_to_HVM_boot_params(self, session, vm_ref, key, value):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
if 'HVM_boot_params' not in dom.info:
dom.info['HVM_boot_params'] = {}
dom.info['HVM_boot_params'][key] = value
return xen_api_success_void()
def VM_remove_from_HVM_boot_params(self, session, vm_ref, key):
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
if 'HVM_boot_params' in dom.info \
and key in dom.info['HVM_boot_params']:
del dom.info['HVM_boot_params'][key]
return xen_api_success_void()
def VM_set_PV_bootloader(self, session, vm_ref, value):
return self.VM_set('PV_bootloader', session, vm_ref, value)
@@ -1354,7 +1381,8 @@ class XendAPI(object):
'PV_ramdisk': xeninfo.info.get('PV_ramdisk'),
'PV_args': xeninfo.info.get('PV_args'),
'PV_bootloader_args': xeninfo.info.get('PV_bootloader_args'),
'HVM_boot': xeninfo.info.get('HVM_boot'),
'HVM_boot_policy': xeninfo.info.get('HVM_boot_policy'),
'HVM_boot_params': xeninfo.info.get('HVM_boot_params'),
'platform_std_VGA': xeninfo.get_platform_std_vga(),
'platform_serial': xeninfo.get_platform_serial(),
'platform_localtime': xeninfo.get_platform_localtime(),
@@ -1622,7 +1650,7 @@ class XendAPI(object):
xendom = XendDomain.instance()
return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
'io_write_kbs'))
def VIF_get_all(self, session):
xendom = XendDomain.instance()
vifs = [d.get_vifs() for d in XendDomain.instance().list('all')]
+12 -4
View File
@@ -28,7 +28,7 @@ from xen.xend.PrettyPrint import prettyprintstring
from xen.xend.XendConstants import DOM_STATE_HALTED
log = logging.getLogger("xend.XendConfig")
log.setLevel(logging.WARN)
log.setLevel(logging.DEBUG)
"""
@@ -164,7 +164,8 @@ XENAPI_CFG_TYPES = {
'PV_ramdisk': str,
'PV_args': str,
'PV_bootloader_args': str,
'HVM_boot': str,
'HVM_boot_policy': str,
'HVM_boot_params': dict,
'platform_std_vga': bool0,
'platform_serial': str,
'platform_localtime': bool0,
@@ -361,7 +362,8 @@ class XendConfig(dict):
'PV_ramdisk': '',
'PV_args': '',
'PV_bootloader_args': '',
'HVM_boot': '',
'HVM_boot_policy': '',
'HVM_boot_params': {},
'memory_static_min': 0,
'memory_dynamic_min': 0,
'shadow_memory': 0,
@@ -496,6 +498,12 @@ class XendConfig(dict):
log.warn("Unable to parse key %s: %s: %s" %
(key, str(val), e))
# Compatibility hack -- can go soon.
boot_order = sxp.child_value(sxp_cfg, 'HVM_boot')
if boot_order:
cfg['HVM_boot_policy'] = 'BIOS order'
cfg['HVM_boot_params'] = { 'order' : boot_order }
# Parsing the device SXP's. In most cases, the SXP looks
# like this:
#
@@ -768,7 +776,7 @@ class XendConfig(dict):
if 'image' in xapi_dict:
self['image'].update(xapi_dict['image'])
else:
hvm = self['HVM_boot'] != ''
hvm = self['HVM_boot_policy'] != ''
self['image']['type'] = hvm and 'hvm' or 'linux'
if hvm:
self['image']['hvm'] = {'devices': {}}
+3 -2
View File
@@ -1648,14 +1648,15 @@ class XendDomainInfo:
kernel = self.info['PV_kernel']
ramdisk = self.info['PV_ramdisk']
args = self.info['PV_args']
boot = self.info['HVM_boot']
boot = self.info['HVM_boot_policy']
if boot:
# HVM booting.
self.info['image']['type'] = 'hvm'
if not 'devices' in self.info['image']:
self.info['image']['devices'] = {}
self.info['image']['devices']['boot'] = boot
self.info['image']['devices']['boot'] = \
self.info['HVM_boot_params'].get('order', 'dc')
elif not blexec and kernel:
# Boot from dom0. Nothing left to do -- the kernel and ramdisk
# will be picked up by image.py.
+4 -1
View File
@@ -19,7 +19,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Xen-xm 3.0\n"
"PO-Revision-Date: 2007-01-30 17:15+0000\n"
"PO-Revision-Date: 2007-01-31 12:34+0000\n"
"Last-Translator: Ewan Mellor <ewan@xensource.com>\n"
"Language-Team: xen-devel <xen-devel@lists.xensource.com>\n"
"MIME-Version: 1.0\n"
@@ -41,6 +41,9 @@ msgstr "The method %(1)s takes %(2)s argument(s) (%(3)s given)."
msgid "SESSION_AUTHENTICATION_FAILED"
msgstr "Permission denied."
msgid "VALUE_NOT_SUPPORTED"
msgstr "Value \"%(2)s\" for %(1)s is not supported by this server. The server said \"%(3)s\"."
msgid "HOST_CPU_HANDLE_INVALID"
msgstr "The host_cpu handle %(1)s is invalid."
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.