x86, hvm: Add a per-domain parameter to specify shadow or hap.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
This commit is contained in:
Keir Fraser committed 2008-01-29 13:46:16 +00:00
1 parent 53a11bbde4
commit e0979793ea
16 files changed
+45 -20

No files matched your search

+3 -7
View File
@@ -97,18 +97,17 @@ static PyObject *pyxc_domain_create(XcObject *self,
PyObject *kwds)
{
uint32_t dom = 0, ssidref = 0, flags = 0, target = 0;
int ret, i, hvm = 0;
int ret, i;
PyObject *pyhandle = NULL;
xen_domain_handle_t handle = {
0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef,
0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef };
static char *kwd_list[] = { "domid", "ssidref", "handle", "hvm", "target", NULL };
static char *kwd_list[] = { "domid", "ssidref", "handle", "flags", "target", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiOii", kwd_list,
&dom, &ssidref, &pyhandle, &hvm, &target))
&dom, &ssidref, &pyhandle, &flags, &target))
return NULL;
if ( pyhandle != NULL )
{
if ( !PyList_Check(pyhandle) ||
@@ -124,9 +123,6 @@ static PyObject *pyxc_domain_create(XcObject *self,
}
}
if ( hvm )
flags |= XEN_DOMCTL_CDF_hvm_guest;
if ( (ret = xc_domain_create(self->xc_handle, ssidref,
handle, flags, &dom)) < 0 )
return pyxc_error_to_exception();
+4 -1
View File
@@ -130,7 +130,7 @@ XENAPI_PLATFORM_CFG = [ 'acpi', 'apic', 'boot', 'device_model', 'display',
'soundhw','stdvga', 'usb', 'usbdevice', 'vnc',
'vncconsole', 'vncdisplay', 'vnclisten', 'timer_mode',
'vncpasswd', 'vncunused', 'xauthority', 'pci', 'vhpt',
'guest_os_type' ]
'guest_os_type', 'hap']
# Xen API console 'other_config' keys.
XENAPI_CONSOLE_OTHER_CFG = ['vncunused', 'vncdisplay', 'vnclisten',
@@ -1593,3 +1593,6 @@ class XendConfig(dict):
def image_type(self):
stored_type = self['platform'].get('image_type')
return stored_type or (self.is_hvm() and 'hvm' or 'linux')
def is_hap(self):
return self['platform']['hap']
+8 -1
View File
@@ -1626,11 +1626,18 @@ class XendDomainInfo:
@raise: VmError on error
"""
hvm_bit_offset = 0
hap_bit_offset = 1
log.debug('XendDomainInfo.constructDomain')
self.shutdownStartTime = None
hvm = self.info.is_hvm()
hap = self.info.is_hap()
if hvm:
info = xc.xeninfo()
if 'hvm' not in info['xen_caps']:
@@ -1656,7 +1663,7 @@ class XendDomainInfo:
domid = 0,
ssidref = ssidref,
handle = uuid.fromString(self.info['uuid']),
hvm = int(hvm),
flags = int((hvm << hvm_bit_offset) | (hap << hap_bit_offset)),
target = self.info.target())
except Exception, e:
# may get here if due to ACM the operation is not permitted
+6 -1
View File
@@ -525,6 +525,11 @@ gopts.var('target', val='TARGET',
fn=set_int, default=0,
use="Set domain target.")
gopts.var('hap', val='HAP',
fn=set_int, default=1,
use="""Hap status (0=hap is disabled;
1=hap is enabled.""")
def err(msg):
"""Print an error to stderr and exit.
"""
@@ -728,7 +733,7 @@ def configure_hvm(config_image, vals):
'vnc', 'vncdisplay', 'vncunused', 'vncconsole', 'vnclisten',
'sdl', 'display', 'xauthority', 'rtc_timeoffset', 'monitor',
'acpi', 'apic', 'usb', 'usbdevice', 'keymap', 'pci',
'guest_os_type']
'guest_os_type', 'hap']
for a in args:
if a in vals.__dict__ and vals.__dict__[a] is not None:
+1 -1
View File
@@ -818,7 +818,7 @@ class sxp2xml:
def extract_platform(self, image, document):
platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode']
platform_keys = ['acpi', 'apic', 'pae', 'vhpt', 'timer_mode', 'hap']
def extract_platform_key(key):
platform = document.createElement("platform")
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.