This commit is contained in:
parent
724a41d19b
commit
44b305a3f0
34
13161_xenapi.patch
Normal file
34
13161_xenapi.patch
Normal file
@ -0,0 +1,34 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1167179881 0
|
||||
# Node ID a9a43705f26b0892f722da1b6db8e98db49bad35
|
||||
# Parent 6f8d650f3ab1cf23d00baf904abe62fb85b89377
|
||||
Fix HVM booting through Xen-API when the kernel is unspecified.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r 6f8d650f3ab1 -r a9a43705f26b tools/python/xen/xend/XendDomainInfo.py
|
||||
--- a/tools/python/xen/xend/XendDomainInfo.py Wed Dec 27 00:35:27 2006 +0000
|
||||
+++ b/tools/python/xen/xend/XendDomainInfo.py Wed Dec 27 00:38:01 2006 +0000
|
||||
@@ -1555,6 +1555,8 @@ class XendDomainInfo:
|
||||
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
|
||||
elif not blexec and kernel:
|
||||
# Boot from dom0. Nothing left to do -- the kernel and ramdisk
|
||||
diff -r 6f8d650f3ab1 -r a9a43705f26b tools/python/xen/xend/image.py
|
||||
--- a/tools/python/xen/xend/image.py Wed Dec 27 00:35:27 2006 +0000
|
||||
+++ b/tools/python/xen/xend/image.py Wed Dec 27 00:38:01 2006 +0000
|
||||
@@ -311,6 +311,9 @@ class HVMImageHandler(ImageHandler):
|
||||
|
||||
def configure(self, vmConfig, imageConfig, deviceConfig):
|
||||
ImageHandler.configure(self, vmConfig, imageConfig, deviceConfig)
|
||||
+
|
||||
+ if not self.kernel:
|
||||
+ self.kernel = '/usr/lib/xen/boot/hvmloader'
|
||||
|
||||
info = xc.xeninfo()
|
||||
if 'hvm' not in info['xen_caps']:
|
53
13201_xenapi.patch
Normal file
53
13201_xenapi.patch
Normal file
@ -0,0 +1,53 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1167743041 0
|
||||
# Node ID 7cd6c032689eca5509a1b8cffaaa50b3f45f5765
|
||||
# Parent 711c31232d71608fe4ea9f4f22ca2620d3faf8ff
|
||||
Don't lose the image settings when rebooting domains. This fixes recent HVM
|
||||
reboot problems -- we were passing 0 to shadow_mem_control, because Xend was
|
||||
treating the domain as PV.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r 711c31232d71 -r 7cd6c032689e tools/python/xen/xend/XendConfig.py
|
||||
--- a/tools/python/xen/xend/XendConfig.py Tue Jan 02 10:57:50 2007 +0000
|
||||
+++ b/tools/python/xen/xend/XendConfig.py Tue Jan 02 13:04:01 2007 +0000
|
||||
@@ -299,7 +299,7 @@ class XendConfig(dict):
|
||||
self._sxp_to_xapi_unsupported(sxp_obj)
|
||||
elif xapi:
|
||||
self.update_with_xenapi_config(xapi)
|
||||
- self._add_xapi_unsupported()
|
||||
+ self._add_xapi_unsupported(xapi)
|
||||
elif dominfo:
|
||||
# output from xc.domain_getinfo
|
||||
self._dominfo_to_xapi(dominfo)
|
||||
@@ -728,19 +728,22 @@ class XendConfig(dict):
|
||||
_set_cfg_if_exists('up_time')
|
||||
_set_cfg_if_exists('status') # TODO, deprecated
|
||||
|
||||
- def _add_xapi_unsupported(self):
|
||||
+ def _add_xapi_unsupported(self, xapi_dict):
|
||||
"""Updates the configuration object with entries that are not
|
||||
officially supported by the Xen API but is required for
|
||||
the rest of Xend to function.
|
||||
"""
|
||||
|
||||
# populate image
|
||||
- hvm = self['HVM_boot'] != ''
|
||||
- self['image']['type'] = hvm and 'hvm' or 'linux'
|
||||
- if hvm:
|
||||
- self['image']['hvm'] = {}
|
||||
- for xapi, cfgapi in XENAPI_HVM_CFG.items():
|
||||
- self['image']['hvm'][cfgapi] = self[xapi]
|
||||
+ if 'image' in xapi_dict:
|
||||
+ self['image'].update(xapi_dict['image'])
|
||||
+ else:
|
||||
+ hvm = self['HVM_boot'] != ''
|
||||
+ self['image']['type'] = hvm and 'hvm' or 'linux'
|
||||
+ if hvm:
|
||||
+ self['image']['hvm'] = {}
|
||||
+ for xapi, cfgapi in XENAPI_HVM_CFG.items():
|
||||
+ self['image']['hvm'][cfgapi] = self[xapi]
|
||||
|
||||
|
||||
def _get_old_state_string(self):
|
17
13226_xenapi.patch
Normal file
17
13226_xenapi.patch
Normal file
@ -0,0 +1,17 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1167928289 0
|
||||
# Node ID b2ea5ae25a2665d927501a5ebaf4ff38bfd086fc
|
||||
# Parent 292edc60d2603f744b5408cbf7795365fa8598ce
|
||||
[XEND] Add VBD_MODE enum from XenAPI.
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
diff -r 292edc60d260 -r b2ea5ae25a26 tools/python/xen/xend/XendAPIConstants.py
|
||||
--- a/tools/python/xen/xend/XendAPIConstants.py Thu Jan 04 16:30:20 2007 +0000
|
||||
+++ b/tools/python/xen/xend/XendAPIConstants.py Thu Jan 04 16:31:29 2007 +0000
|
||||
@@ -73,3 +73,4 @@ XEN_API_VBD_MODE = ['RO', 'RW']
|
||||
XEN_API_VBD_MODE = ['RO', 'RW']
|
||||
XEN_API_VDI_TYPE = ['system', 'user', 'ephemeral']
|
||||
XEN_API_DRIVER_TYPE = ['ioemu', 'paravirtualised']
|
||||
+XEN_API_VBD_TYPE = ['CD', 'Disk']
|
27
13235_xenapi.patch
Normal file
27
13235_xenapi.patch
Normal file
@ -0,0 +1,27 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1168000166 0
|
||||
# Node ID 36e00d04278d4fbdb0b034355a0e683372211752
|
||||
# Parent 68f0d46de55ab1e158c19e7e5890902e05d6f623
|
||||
Added permissiveness for floats.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r 68f0d46de55a -r 36e00d04278d tools/libxen/src/xen_common.c
|
||||
--- a/tools/libxen/src/xen_common.c Fri Jan 05 11:03:16 2007 +0000
|
||||
+++ b/tools/libxen/src/xen_common.c Fri Jan 05 12:29:26 2007 +0000
|
||||
@@ -557,8 +557,14 @@ static void parse_into(xen_session *s, x
|
||||
xmlChar *string = string_from_value(value_node, "double");
|
||||
if (string == NULL)
|
||||
{
|
||||
+#if PERMISSIVE
|
||||
+ fprintf(stderr,
|
||||
+ "Expected a Float from the server, but didn't get one\n");
|
||||
+ ((double *)value)[slot] = 0.0;
|
||||
+#else
|
||||
server_error(
|
||||
s, "Expected a Float from the server, but didn't get one");
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
72
13236_xenapi.patch
Normal file
72
13236_xenapi.patch
Normal file
@ -0,0 +1,72 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1168000232 0
|
||||
# Node ID bb8ae710d829d5a7805c5588d8ded2ea393686cf
|
||||
# Parent 36e00d04278d4fbdb0b034355a0e683372211752
|
||||
Treat <value> tags with no type tag inside as if they were strings (as required
|
||||
by the XML-RPC spec).
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r 36e00d04278d -r bb8ae710d829 tools/libxen/src/xen_common.c
|
||||
--- a/tools/libxen/src/xen_common.c Fri Jan 05 12:29:26 2007 +0000
|
||||
+++ b/tools/libxen/src/xen_common.c Fri Jan 05 12:30:32 2007 +0000
|
||||
@@ -373,11 +373,18 @@ static void server_error_2(xen_session *
|
||||
}
|
||||
|
||||
|
||||
-static bool is_container_node(xmlNode *n, char *type)
|
||||
+static bool is_node(xmlNode *n, char *type)
|
||||
{
|
||||
return
|
||||
n->type == XML_ELEMENT_NODE &&
|
||||
- 0 == strcmp((char *)n->name, type) &&
|
||||
+ 0 == strcmp((char *)n->name, type);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static bool is_container_node(xmlNode *n, char *type)
|
||||
+{
|
||||
+ return
|
||||
+ is_node(n, type) &&
|
||||
n->children != NULL &&
|
||||
n->children == n->last &&
|
||||
n->children->type == XML_ELEMENT_NODE;
|
||||
@@ -390,13 +397,30 @@ static bool is_container_node(xmlNode *n
|
||||
*/
|
||||
static xmlChar *string_from_value(xmlNode *n, char *type)
|
||||
{
|
||||
- return
|
||||
- is_container_node(n, "value") &&
|
||||
- 0 == strcmp((char *)n->children->name, type) ?
|
||||
- (n->children->children == NULL ?
|
||||
- xmlStrdup(BAD_CAST("")) :
|
||||
- xmlNodeGetContent(n->children->children)) :
|
||||
- NULL;
|
||||
+ /*
|
||||
+ <value><type>XYZ</type></value> is normal, but the XML-RPC spec also
|
||||
+ allows <value>XYZ</value> where XYZ is to be interpreted as a string.
|
||||
+ */
|
||||
+
|
||||
+ if (is_container_node(n, "value") &&
|
||||
+ 0 == strcmp((char *)n->children->name, type))
|
||||
+ {
|
||||
+ return
|
||||
+ n->children->children == NULL ?
|
||||
+ xmlStrdup(BAD_CAST("")) :
|
||||
+ xmlNodeGetContent(n->children->children);
|
||||
+ }
|
||||
+ else if (0 == strcmp(type, "string") && is_node(n, "value"))
|
||||
+ {
|
||||
+ return
|
||||
+ n->children == NULL ?
|
||||
+ xmlStrdup(BAD_CAST("")) :
|
||||
+ xmlNodeGetContent(n->children);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
|
52
13577_xenapi.patch
Normal file
52
13577_xenapi.patch
Normal file
@ -0,0 +1,52 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1169640474 0
|
||||
# Node ID 4f5772324e679e9794ccd72848023c081d7300da
|
||||
# Parent 8331aca2f29ca29704f4bafabe0e542f312d6950
|
||||
[XEND] Strip suffix from device name and add support for 'VBD.type'
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -1040,6 +1040,7 @@ class XendAPI:
|
||||
'VDI',
|
||||
'device',
|
||||
'mode',
|
||||
+ 'type',
|
||||
'driver']
|
||||
|
||||
VBD_attr_inst = VBD_attr_rw + ['image']
|
||||
@@ -1117,6 +1118,11 @@ class XendAPI:
|
||||
return xen_api_success(xendom.get_dev_property('vbd', vbd_ref,
|
||||
'driver'))
|
||||
|
||||
+ def VBD_get_type(self, session, vbd_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('vbd', vbd_ref,
|
||||
+ 'type'))
|
||||
+
|
||||
# Xen API: Class VIF
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -1988,6 +1988,14 @@ class XendDomainInfo:
|
||||
if dev_class == 'vbd':
|
||||
config['VDI'] = config.get('VDI', '')
|
||||
config['device'] = config.get('dev', '')
|
||||
+ if ':' in config['device']:
|
||||
+ vbd_name, vbd_type = config['device'].split(':', 1)
|
||||
+ config['device'] = vbd_name
|
||||
+ if vbd_type == 'cdrom':
|
||||
+ config['type'] = XEN_API_VBD_TYPE[0]
|
||||
+ else:
|
||||
+ config['type'] = XEN_API_VBD_TYPE[1]
|
||||
+
|
||||
config['driver'] = 'paravirtualised' # TODO
|
||||
config['image'] = config.get('uname', '')
|
||||
config['io_read_kbs'] = 0.0
|
451
13585_xenapi.patch
Normal file
451
13585_xenapi.patch
Normal file
@ -0,0 +1,451 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1169648721 0
|
||||
# Node ID bea3d48576c66663e559fbba1bcd9f840a3d1b25
|
||||
# Parent 6a54b1d8d1053c4facfef8c3c1da871950a5b29c
|
||||
[XEND] Add missing Xen API methods
|
||||
|
||||
* Added session.get_all, task.get_by_name_label,
|
||||
host.get_by_name_label, VM.add_to_otherConfig,
|
||||
VM.remove_from_otherConfig
|
||||
|
||||
* Added implementations for VM.get_VCPUs_policy,
|
||||
VM.get_platform_std_vga, VM.get_vm_by_uuid,
|
||||
VM.get_platform_localtime, VM.get_platform_clock_offset,
|
||||
VM.get_platform_enable_audio, VM.get_platform_keymap,
|
||||
VM.get_otherConfig, VM.set_actions_after_shutdown,
|
||||
VM.set_actions_after_reboot, VM.set_actions_after_suspend,
|
||||
VM.set_actions_after_crash, VM.set_platform_std_VGA,
|
||||
VM.set_platform_serial, VM.set_platform_keymap,
|
||||
VM.set_platform_localtime, VM.set_platform_clock_offset,
|
||||
VM.set_platform_enable_audio, VM.set_otherConfig, VBD.destroy,
|
||||
VBD.get_io_read_kbs, VBD.get_io_write_kbs, VBD.get_all, VIF.destroy,
|
||||
VIF.get_VM, VIF.get_name, VIF.get_MTU, VIF.get_MAC, VIF.get_type,
|
||||
VIF.get_device, VIF.get_io_read_kbs, VIF.get_io_write_kbs,
|
||||
VIF.get_all, VTPM.destroy, VTPM.get_all
|
||||
|
||||
* Save devid of a device on creation in XendDomainInfo
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -406,7 +406,6 @@ class XendAPI:
|
||||
return xen_api_error(XEND_ERROR_AUTHENTICATION_FAILED)
|
||||
session_login_with_password.api = 'session.login_with_password'
|
||||
|
||||
-
|
||||
# object methods
|
||||
def session_logout(self, session):
|
||||
auth_manager().logout(session)
|
||||
@@ -417,7 +416,9 @@ class XendAPI:
|
||||
record = {'this_host': XendNode.instance().uuid,
|
||||
'this_user': auth_manager().get_user(session)}
|
||||
return xen_api_success(record)
|
||||
-
|
||||
+ def session_get_all(self):
|
||||
+ return xen_api_error(XEND_ERROR_UNSUPPORTED)
|
||||
+
|
||||
# attributes (ro)
|
||||
def session_get_this_host(self, session):
|
||||
return xen_api_success(XendNode.instance().uuid)
|
||||
@@ -504,6 +505,11 @@ class XendAPI:
|
||||
return xen_api_success((XendNode.instance().uuid,))
|
||||
def host_create(self, session, struct):
|
||||
return xen_api_error(XEND_ERROR_UNSUPPORTED)
|
||||
+ def host_get_by_name_label(self, session, name):
|
||||
+ if XendNode.instance().name == name:
|
||||
+ return xen_api_success((XendNode.instance().uuid,))
|
||||
+ return xen_api_success([])
|
||||
+
|
||||
|
||||
# Xen API: Class Host_CPU
|
||||
# ----------------------------------------------------------------
|
||||
@@ -514,9 +520,6 @@ class XendAPI:
|
||||
'utilisation']
|
||||
|
||||
# attributes
|
||||
- def host_cpu_get_uuid(self, session, host_cpu_ref):
|
||||
- uuid = XendNode.instance().get_host_cpu_uuid(host_cpu_ref)
|
||||
- return xen_api_success(uuid)
|
||||
def host_cpu_get_host(self, session, host_cpu_ref):
|
||||
return xen_api_success(XendNode.instance().uuid)
|
||||
def host_cpu_get_features(self, session, host_cpu_ref):
|
||||
@@ -752,7 +755,7 @@ class XendAPI:
|
||||
|
||||
def VM_get_VCPUs_policy(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo() # need to access scheduler
|
||||
+ return dom.get_vcpus_policy()
|
||||
|
||||
def VM_get_VCPUs_params(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
@@ -776,7 +779,7 @@ class XendAPI:
|
||||
|
||||
def VM_get_actions_after_suspend(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success(dom.get_on_suspend())
|
||||
+ return xen_api_success(dom.get_on_suspend())
|
||||
|
||||
def VM_get_actions_after_crash(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
@@ -802,31 +805,30 @@ class XendAPI:
|
||||
|
||||
def VM_get_platform_std_VGA(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return xen_api_success(dom.get_platform_std_vga())
|
||||
|
||||
def VM_get_platform_serial(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return xen_api_success(dom.get_platform_serial())
|
||||
|
||||
def VM_get_platform_localtime(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return xen_api_success(dom.get_platform_localtime())
|
||||
|
||||
def VM_get_platform_clock_offset(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return xen_api_success(dom.get_platform_clock_offset())
|
||||
|
||||
def VM_get_platform_enable_audio(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return xen_api_success(dom.get_platform_enable_audio())
|
||||
|
||||
def VM_get_platform_keymap(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return xen_api_success(dom.get_platform_keymap())
|
||||
|
||||
def VM_get_otherConfig(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return self.VM_get('otherConfig', session, vm_ref)
|
||||
|
||||
def VM_set_name_label(self, session, vm_ref, label):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
@@ -870,20 +872,24 @@ class XendAPI:
|
||||
return xen_api_success_void()
|
||||
|
||||
def VM_set_actions_after_shutdown(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ if action not in XEN_API_ON_NORMAL_EXIST:
|
||||
+ return xen_api_error(['VM_ON_NORMAL_EXIT_INVALID', vm_ref])
|
||||
+ return self.VM_set('actions_after_shutdown', session, vm_ref, action)
|
||||
|
||||
def VM_set_actions_after_reboot(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ if action not in XEN_API_ON_NORMAL_EXIST:
|
||||
+ return xen_api_error(['VM_ON_NORMAL_EXIT_INVALID', vm_ref])
|
||||
+ return self.VM_set('actions_after_reboot', session, vm_ref, action)
|
||||
|
||||
def VM_set_actions_after_suspend(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ if action not in XEN_API_ON_NORMAL_EXIT:
|
||||
+ return xen_api_error(['VM_ON_NORMAL_EXIT_INVALID', vm_ref])
|
||||
+ return self.VM_set('actions_after_suspend', session, vm_ref, action)
|
||||
|
||||
def VM_set_actions_after_crash(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ if action not in XEN_API_ON_CRASH_BEHAVIOUR:
|
||||
+ 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)
|
||||
@@ -903,29 +909,26 @@ class XendAPI:
|
||||
def VM_set_PV_bootloader_args(self, session, vm_ref, value):
|
||||
return self.VM_set('PV_bootloader_args', session, vm_ref, value)
|
||||
|
||||
- def VM_set_platform_std_VGA(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
-
|
||||
- def VM_set_platform_serial(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ def VM_set_platform_std_VGA(self, session, vm_ref, value):
|
||||
+ return self.VM_set('platform_std_vga', session, vm_ref, value)
|
||||
|
||||
- def VM_set_platform_localtime(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ def VM_set_platform_serial(self, session, vm_ref, value):
|
||||
+ return self.VM_set('platform_serial', session, vm_ref, value)
|
||||
+
|
||||
+ def VM_set_platform_keymap(self, session, vm_ref, value):
|
||||
+ return self.VM_set('platform_keymap', session, vm_ref, value)
|
||||
+
|
||||
+ def VM_set_platform_localtime(self, session, vm_ref, value):
|
||||
+ return self.VM_set('platform_localtime', session, vm_ref, value)
|
||||
|
||||
- def VM_set_platform_clock_offset(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ def VM_set_platform_clock_offset(self, session, vm_ref, value):
|
||||
+ return self.VM_set('platform_clock_offset', session, vm_ref, value)
|
||||
|
||||
- def VM_set_platform_enable_audio(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ def VM_set_platform_enable_audio(self, session, vm_ref, value):
|
||||
+ return self.VM_set('platform_enable_audio', session, vm_ref, value)
|
||||
|
||||
- def VM_set_otherConfig(self, session, vm_ref):
|
||||
- dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_success_void()
|
||||
+ def VM_set_otherConfig(self, session, vm_ref, value):
|
||||
+ return self.VM_set('otherconfig', session, vm_ref, value)
|
||||
|
||||
# class methods
|
||||
def VM_get_all(self, session):
|
||||
@@ -995,7 +998,7 @@ class XendAPI:
|
||||
'platform_keymap': xeninfo.get_platform_keymap(),
|
||||
'PCI_bus': xeninfo.get_pci_bus(),
|
||||
'tools_version': xeninfo.get_tools_version(),
|
||||
- 'otherConfig': xeninfo.get_other_config()
|
||||
+ 'otherConfig': xeninfo.info.get('otherconfig'),
|
||||
}
|
||||
return xen_api_success(record)
|
||||
|
||||
@@ -1030,8 +1033,6 @@ class XendAPI:
|
||||
|
||||
# Xen API: Class VBD
|
||||
# ----------------------------------------------------------------
|
||||
- # Note: accepts a non-API standard 'image' attribute to emulate
|
||||
- # regular xm created VBDs
|
||||
|
||||
VBD_attr_ro = ['image',
|
||||
'io_read_kbs',
|
||||
@@ -1097,6 +1098,16 @@ class XendAPI:
|
||||
xendom.managed_config_save(dom)
|
||||
return xen_api_success(vbd_ref)
|
||||
|
||||
+
|
||||
+ def VBD_destroy(self, session, vbd_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vm = xendom.get_vm_with_dev_uuid('vbd', vbd_ref)
|
||||
+ if not vm:
|
||||
+ return xen_api_error(['VBD_HANDLE_INVALID', vbd_ref])
|
||||
+
|
||||
+ vm.destroy_vbd(vbd_ref)
|
||||
+ return xen_api_success_void()
|
||||
+
|
||||
# attributes (rw)
|
||||
def VBD_get_VM(self, session, vbd_ref):
|
||||
xendom = XendDomain.instance()
|
||||
@@ -1123,6 +1134,18 @@ class XendAPI:
|
||||
return xen_api_success(xendom.get_dev_property_by_uuid('vbd', vbd_ref,
|
||||
'type'))
|
||||
|
||||
+ def VBD_get_io_read_kbs(self, session, vbd_ref):
|
||||
+ return xen_api_todo()
|
||||
+
|
||||
+ def VBD_get_io_write_kbs(self, session, vbd_ref):
|
||||
+ return xen_api_todo()
|
||||
+
|
||||
+ def VBD_get_all(self, session):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vbds = [d.get_vbds() for d in XendDomain.instance().list('all')]
|
||||
+ vbds = reduce(lambda x, y: x + y, vbds)
|
||||
+ return xen_api_success(vbds)
|
||||
+
|
||||
# Xen API: Class VIF
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
@@ -1173,6 +1196,59 @@ class XendAPI:
|
||||
return xen_api_error(XEND_ERROR_DOMAIN_INVALID)
|
||||
|
||||
|
||||
+ def VIF_destroy(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vm = xendom.get_vm_with_dev_uuid('vif', vif_ref)
|
||||
+ if not vm:
|
||||
+ return xen_api_error(['VIF_HANDLE_INVALID', vif_ref])
|
||||
+
|
||||
+ vm.destroy_vif(vif_ref)
|
||||
+ return xen_api_success_void()
|
||||
+
|
||||
+ # getters/setters
|
||||
+ def VIF_get_VM(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vm = xendom.get_vm_with_dev_uuid('vif', vif_ref)
|
||||
+ return xen_api_success(vm.get_uuid())
|
||||
+
|
||||
+ def VIF_get_name(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
+ 'name'))
|
||||
+ def VIF_get_MTU(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
+ 'MTU'))
|
||||
+ def VIF_get_MAC(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
+ 'MAC'))
|
||||
+
|
||||
+ def VIF_get_type(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
+ 'type'))
|
||||
+
|
||||
+
|
||||
+ def VIF_get_device(self, session, vif_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
+ 'device'))
|
||||
+
|
||||
+
|
||||
+ def VIF_get_io_read_kbs(self, session, vif_ref):
|
||||
+ return xen_api_todo()
|
||||
+
|
||||
+ def VIF_get_io_write_kbs(self, session, vif_ref):
|
||||
+ return xen_api_todo()
|
||||
+
|
||||
+ def VIF_get_all(self, session):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vifs = [d.get_vifs() for d in XendDomain.instance().list('all')]
|
||||
+ vifs = reduce(lambda x, y: x + y, vifs)
|
||||
+ return xen_api_success(vifs)
|
||||
+
|
||||
+
|
||||
# Xen API: Class VDI
|
||||
# ----------------------------------------------------------------
|
||||
VDI_attr_ro = ['VBDs',
|
||||
@@ -1401,6 +1477,15 @@ class XendAPI:
|
||||
xendom = XendDomain.instance()
|
||||
return xen_api_success(xendom.get_dev_property('vtpm', vtpm_ref, 'VM'))
|
||||
|
||||
+ def VTPM_destroy(self, session, vtpm_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
|
||||
+ if not vm:
|
||||
+ return xen_api_error(['VTPM_HANDLE_INVALID', vtpm_ref])
|
||||
+
|
||||
+ vm.destroy_vtpm(vtpm_ref)
|
||||
+ return xen_api_success_void()
|
||||
+
|
||||
# class methods
|
||||
def VTPM_create(self, session, vtpm_struct):
|
||||
xendom = XendDomain.instance()
|
||||
@@ -1415,6 +1500,12 @@ class XendAPI:
|
||||
else:
|
||||
return xen_api_error(XEND_ERROR_DOMAIN_INVALID)
|
||||
|
||||
+ def VTPM_get_all(self, session):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vtpms = [d.get_vtpms() for d in XendDomain.instance().list('all')]
|
||||
+ vtpms = reduce(lambda x, y: x + y, vtpms)
|
||||
+ return xen_api_success(vtpms)
|
||||
+
|
||||
|
||||
# Xen API: Class SR
|
||||
# ----------------------------------------------------------------
|
||||
@@ -1451,9 +1542,6 @@ class XendAPI:
|
||||
def SR_create(self, session):
|
||||
return xen_api_error(XEND_ERROR_UNSUPPORTED)
|
||||
|
||||
- def SR_get_by_uuid(self, session):
|
||||
- return xen_api_success(XendNode.instance().get_sr().uuid)
|
||||
-
|
||||
# Class Methods
|
||||
def SR_clone(self, session, sr_ref):
|
||||
return xen_api_error(XEND_ERROR_UNSUPPORTED)
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -954,6 +954,8 @@ class XendConfig(dict):
|
||||
# dev_info['vifname'] = cfg_xenapi.get('device')
|
||||
if cfg_xenapi.get('type'):
|
||||
dev_info['type'] = cfg_xenapi.get('type')
|
||||
+ if cfg_xenapi.get('name'):
|
||||
+ dev_info['name'] = cfg_xenapi.get('name')
|
||||
|
||||
dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
|
||||
dev_info['uuid'] = dev_uuid
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -525,8 +525,6 @@ class XendDomainInfo:
|
||||
|
||||
return self.getDeviceController(deviceClass).destroyDevice(devid, force)
|
||||
|
||||
-
|
||||
-
|
||||
def getDeviceSxprs(self, deviceClass):
|
||||
if self.state == DOM_STATE_RUNNING:
|
||||
return self.getDeviceController(deviceClass).sxprs()
|
||||
@@ -1215,7 +1213,12 @@ class XendDomainInfo:
|
||||
devclass, config = self.info['devices'][dev_uuid]
|
||||
if devclass in XendDevices.valid_devices():
|
||||
log.info("createDevice: %s : %s" % (devclass, scrub_password(config)))
|
||||
- self._createDevice(devclass, config)
|
||||
+ dev_uuid = config.get('uuid')
|
||||
+ devid = self._createDevice(devclass, config)
|
||||
+
|
||||
+ # store devid in XendConfig for caching reasons
|
||||
+ if dev_uuid in self.info['devices']:
|
||||
+ self.info['devices'][dev_uuid][1]['devid'] = devid
|
||||
|
||||
if self.image:
|
||||
self.image.createDeviceModel()
|
||||
@@ -1887,11 +1890,9 @@ class XendDomainInfo:
|
||||
def get_platform_keymap(self):
|
||||
return self.info.get('platform_keymap', '')
|
||||
def get_pci_bus(self):
|
||||
- return '' # TODO
|
||||
+ return self.info.get('pci_bus', '')
|
||||
def get_tools_version(self):
|
||||
- return {} # TODO
|
||||
- def get_other_config(self):
|
||||
- return {} # TODO
|
||||
+ return self.info.get('tools_version', {})
|
||||
|
||||
def get_on_shutdown(self):
|
||||
after_shutdown = self.info.get('action_after_shutdown')
|
||||
@@ -2112,6 +2113,32 @@ class XendDomainInfo:
|
||||
|
||||
return dev_uuid
|
||||
|
||||
+ def destroy_device_by_uuid(self, dev_type, dev_uuid):
|
||||
+ if dev_uuid not in self.info['devices']:
|
||||
+ raise XendError('Device does not exist')
|
||||
+
|
||||
+ try:
|
||||
+ if self.state == XEN_API_VM_POWER_STATE_RUNNING:
|
||||
+ _, config = self.info['devices'][dev_uuid]
|
||||
+ devid = config.get('devid')
|
||||
+ if devid != None:
|
||||
+ self.getDeviceController(dev_type).destroyDevice(devid, force = False)
|
||||
+ else:
|
||||
+ raise XendError('Unable to get devid for device: %s:%s' %
|
||||
+ (dev_type, dev_uuid))
|
||||
+ finally:
|
||||
+ del self.info['devices'][dev_uuid]
|
||||
+ self.info['%s_refs' % dev_type].remove(dev_uuid)
|
||||
+
|
||||
+ def destroy_vbd(self, dev_uuid):
|
||||
+ self.destroy_device_by_uuid('vbd', dev_uuid)
|
||||
+
|
||||
+ def destroy_vif(self, dev_uuid):
|
||||
+ self.destroy_device_by_uuid('vif', dev_uuid)
|
||||
+
|
||||
+ def destroy_vtpm(self, dev_uuid):
|
||||
+ self.destroy_device_by_uuid('vtpm', dev_uuid)
|
||||
+
|
||||
def has_device(self, dev_class, dev_uuid):
|
||||
return (dev_uuid in self.info['%s_refs' % dev_class.lower()])
|
||||
|
151
13615_xenapi.patch
Normal file
151
13615_xenapi.patch
Normal file
@ -0,0 +1,151 @@
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/image.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/image.py
|
||||
@@ -412,8 +412,11 @@ class HVMImageHandler(ImageHandler):
|
||||
|
||||
# Handle booleans gracefully
|
||||
if a in ['localtime', 'std-vga', 'isa', 'usb', 'acpi']:
|
||||
- if v != None: v = int(v)
|
||||
- if v: ret.append("-%s" % a)
|
||||
+ try:
|
||||
+ if v != None: v = int(v)
|
||||
+ if v: ret.append("-%s" % a)
|
||||
+ except (ValueError, TypeError):
|
||||
+ pass # if we can't convert it to a sane type, ignore it
|
||||
else:
|
||||
if v:
|
||||
ret.append("-%s" % a)
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -106,7 +106,6 @@ XENAPI_HVM_CFG = {
|
||||
'platform_std_vga': 'stdvga',
|
||||
'platform_serial' : 'serial',
|
||||
'platform_localtime': 'localtime',
|
||||
- 'platform_enable_audio': 'soundhw',
|
||||
'platform_keymap' : 'keymap',
|
||||
}
|
||||
|
||||
@@ -248,17 +247,19 @@ LEGACY_IMAGE_HVM_DEVICES_CFG = [
|
||||
('boot', str),
|
||||
('fda', str),
|
||||
('fdb', str),
|
||||
- ('isa', str),
|
||||
+ ('isa', int),
|
||||
('keymap', str),
|
||||
- ('localtime', str),
|
||||
+ ('localtime', int),
|
||||
('serial', str),
|
||||
('stdvga', int),
|
||||
('soundhw', str),
|
||||
- ('usb', str),
|
||||
+ ('usb', int),
|
||||
('usbdevice', str),
|
||||
('vcpus', int),
|
||||
]
|
||||
|
||||
+LEGACY_DM = '/usr/lib/xen/bin/qemu-dm'
|
||||
+
|
||||
##
|
||||
## Config Choices
|
||||
##
|
||||
@@ -731,9 +732,18 @@ class XendConfig(dict):
|
||||
hvm = self['HVM_boot'] != ''
|
||||
self['image']['type'] = hvm and 'hvm' or 'linux'
|
||||
if hvm:
|
||||
- self['image']['hvm'] = {}
|
||||
+ self['image']['hvm'] = {'devices': {}}
|
||||
for xapi, cfgapi in XENAPI_HVM_CFG.items():
|
||||
- self['image']['hvm'][cfgapi] = self[xapi]
|
||||
+ if xapi in self:
|
||||
+ self['image']['hvm']['devices'][cfgapi] = self[xapi]
|
||||
+
|
||||
+ # currently unsupported options
|
||||
+ self['image']['hvm']['device_model'] = LEGACY_DM
|
||||
+ self['image']['vnc'] = 0
|
||||
+ self['image']['hvm']['pae'] = 1
|
||||
+
|
||||
+ if self['platform_enable_audio']:
|
||||
+ self['image']['hvm']['devices']['soundhw'] = 'sb16'
|
||||
|
||||
|
||||
def _get_old_state_string(self):
|
||||
@@ -946,7 +956,8 @@ class XendConfig(dict):
|
||||
return dev_uuid
|
||||
|
||||
if cfg_xenapi:
|
||||
- dev_info = {}
|
||||
+ dev_info = {}
|
||||
+ dev_uuid = ''
|
||||
if dev_type == 'vif':
|
||||
if cfg_xenapi.get('MAC'): # don't add if blank
|
||||
dev_info['mac'] = cfg_xenapi.get('MAC')
|
||||
@@ -964,7 +975,6 @@ class XendConfig(dict):
|
||||
dev_info['uuid'] = dev_uuid
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vif_refs'].append(dev_uuid)
|
||||
- return dev_uuid
|
||||
|
||||
elif dev_type in ('vbd', 'tap'):
|
||||
if dev_type == 'vbd':
|
||||
@@ -986,7 +996,6 @@ class XendConfig(dict):
|
||||
dev_info['uuid'] = dev_uuid
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vbd_refs'].append(dev_uuid)
|
||||
- return dev_uuid
|
||||
|
||||
elif dev_type in ('vtpm'):
|
||||
if cfg_xenapi.get('type'):
|
||||
@@ -996,9 +1005,12 @@ class XendConfig(dict):
|
||||
dev_info['uuid'] = dev_uuid
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vtpm_refs'].append(dev_uuid)
|
||||
- return dev_uuid
|
||||
|
||||
+ return dev_uuid
|
||||
+
|
||||
+ # no valid device to add
|
||||
return ''
|
||||
+
|
||||
|
||||
def device_update(self, dev_uuid, cfg_sxp):
|
||||
"""Update an existing device with the new configuration.
|
||||
@@ -1094,13 +1106,18 @@ class XendConfig(dict):
|
||||
if 'hvm' in self['image']:
|
||||
for arg, conv in LEGACY_IMAGE_HVM_CFG:
|
||||
if self['image']['hvm'].get(arg):
|
||||
- image.append([arg, self['image']['hvm'][arg]])
|
||||
+ image.append([arg, conv(self['image']['hvm'][arg])])
|
||||
|
||||
if 'hvm' in self['image'] and 'devices' in self['image']['hvm']:
|
||||
for arg, conv in LEGACY_IMAGE_HVM_DEVICES_CFG:
|
||||
- if self['image']['hvm']['devices'].get(arg):
|
||||
- image.append([arg,
|
||||
- self['image']['hvm']['devices'][arg]])
|
||||
+ val = self['image']['hvm']['devices'].get(arg)
|
||||
+ if val != None:
|
||||
+ try:
|
||||
+ if conv: val = conv(val)
|
||||
+ except (ValueError, TypeError):
|
||||
+ if type(val) == bool: val = int(val)
|
||||
+
|
||||
+ image.append([arg, val])
|
||||
|
||||
return image
|
||||
|
||||
@@ -1144,8 +1161,11 @@ class XendConfig(dict):
|
||||
for arg, conv in LEGACY_IMAGE_HVM_DEVICES_CFG:
|
||||
val = sxp.child_value(image_sxp, arg, None)
|
||||
if val != None:
|
||||
- image_hvm_devices[arg] = conv(val)
|
||||
-
|
||||
+ try:
|
||||
+ image_hvm_devices[arg] = conv(val)
|
||||
+ except (ValueError, TypeError):
|
||||
+ image_hvm_devices[arg] = val
|
||||
+
|
||||
if image_hvm or image_hvm_devices:
|
||||
image['hvm'] = image_hvm
|
||||
image['hvm']['devices'] = image_hvm_devices
|
309
13616_xenapi.patch
Normal file
309
13616_xenapi.patch
Normal file
@ -0,0 +1,309 @@
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/server/DevController.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/server/DevController.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/server/DevController.py
|
||||
@@ -75,7 +75,7 @@ class DevController:
|
||||
|
||||
def __init__(self, vm):
|
||||
self.vm = vm
|
||||
-
|
||||
+ self.hotplug = True
|
||||
|
||||
def createDevice(self, config):
|
||||
"""Trigger the creation of a device with the given configuration.
|
||||
@@ -151,6 +151,9 @@ class DevController:
|
||||
|
||||
def waitForDevice(self, devid):
|
||||
log.debug("Waiting for %s.", devid)
|
||||
+
|
||||
+ if not self.hotplug:
|
||||
+ return
|
||||
|
||||
status = self.waitForBackend(devid)
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPIConstants.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPIConstants.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPIConstants.py
|
||||
@@ -74,3 +74,4 @@ XEN_API_VBD_MODE = ['RO', 'RW']
|
||||
XEN_API_VDI_TYPE = ['system', 'user', 'ephemeral']
|
||||
XEN_API_DRIVER_TYPE = ['ioemu', 'paravirtualised']
|
||||
XEN_API_VBD_TYPE = ['CD', 'Disk']
|
||||
+XEN_API_CONSOLE_PROTOCOL = ['vt100', 'rfb', 'rdp']
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -227,6 +227,27 @@ def valid_vtpm(func):
|
||||
|
||||
return check_vtpm_ref
|
||||
|
||||
+def valid_console(func):
|
||||
+ """Decorator to verify if console_ref is valid before calling method.
|
||||
+
|
||||
+ @param func: function with params: (self, session, console_ref, ...)
|
||||
+ @rtype: callable object
|
||||
+ """
|
||||
+ def check_console_ref(self, session, console_ref, *args, **kwargs):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ if type(console_ref) == type(str()) and \
|
||||
+ xendom.is_valid_dev('console', console_ref):
|
||||
+ return func(self, session, console_ref, *args, **kwargs)
|
||||
+ else:
|
||||
+ return {'Status': 'Failure',
|
||||
+ 'ErrorDescription': ('ECONSOLEINVALID', 'Console Invalid')}
|
||||
+
|
||||
+ # make sure we keep the 'api' attribute
|
||||
+ if hasattr(func, 'api'):
|
||||
+ check_console_ref.api = func.api
|
||||
+
|
||||
+ return check_console_ref
|
||||
+
|
||||
def valid_sr(func):
|
||||
"""Decorator to verify if sr_ref is valid before calling
|
||||
method.
|
||||
@@ -299,6 +320,7 @@ class XendAPI:
|
||||
'VIF': (valid_vif, session_required),
|
||||
'VDI': (valid_vdi, session_required),
|
||||
'VTPM':(valid_vtpm, session_required),
|
||||
+ 'console':(valid_console, session_required),
|
||||
'SR': (valid_sr, session_required)}
|
||||
|
||||
# Cheat methods
|
||||
@@ -719,14 +741,18 @@ class XendAPI:
|
||||
def VM_get_VTPMs(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
return xen_api_success(dom.get_vtpms())
|
||||
+
|
||||
+ def VM_get_consoles(self, session, vm_ref):
|
||||
+ dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
+ return xen_api_success(dom.get_consoles())
|
||||
|
||||
def VM_get_PCI_bus(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo() # unsupported by xc
|
||||
+ return dom.get_pci_bus()
|
||||
|
||||
def VM_get_tools_version(self, session, vm_ref):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
- return xen_api_todo()
|
||||
+ return dom.get_tools_version()
|
||||
|
||||
# attributes (rw)
|
||||
def VM_get_name_label(self, session, vm_ref):
|
||||
@@ -1507,6 +1533,55 @@ class XendAPI:
|
||||
return xen_api_success(vtpms)
|
||||
|
||||
|
||||
+ # Xen API: Class console
|
||||
+ # ----------------------------------------------------------------
|
||||
+
|
||||
+
|
||||
+ console_attr_ro = ['uri', 'protocol', 'VM']
|
||||
+ console_attr_rw = []
|
||||
+
|
||||
+ def console_get_all(self, session):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ cons = [d.get_consoles() for d in XendDomain.instance().list('all')]
|
||||
+ cons = reduce(lambda x, y: x + y, cons)
|
||||
+ return xen_api_success(cons)
|
||||
+
|
||||
+ def console_get_uri(self, session, console_ref):
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('console',
|
||||
+ console_ref,
|
||||
+ 'uri'))
|
||||
+
|
||||
+ def console_get_protocol(self, session, console_ref):
|
||||
+ return xen_api_success(xendom.get_dev_property_by_uuid('console',
|
||||
+ console_ref,
|
||||
+ 'protocol'))
|
||||
+
|
||||
+ def console_get_VM(self, session, console_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vm = xendom.get_vm_with_dev_uuid('console', console_ref)
|
||||
+ return xen_api_success(vm.get_uuid())
|
||||
+
|
||||
+ # object methods
|
||||
+ def console_get_record(self, session, console_ref):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ vm = xendom.get_vm_with_dev_uuid('console', console_ref)
|
||||
+ if not vm:
|
||||
+ return xen_api_error(['CONSOLE_HANDLE_INVALID', console_ref])
|
||||
+ cfg = vm.get_dev_xenapi_config('console', console_ref)
|
||||
+ if not cfg:
|
||||
+ return xen_api_error(['CONSOLE_HANDLE_INVALID', console_ref])
|
||||
+
|
||||
+ valid_console_keys = self.console_attr_ro + self.console_attr_rw + \
|
||||
+ self.Base_attr_ro + self.Base_attr_rw
|
||||
+
|
||||
+ return_cfg = {}
|
||||
+ for k in cfg.keys():
|
||||
+ if k in valid_console_keys:
|
||||
+ return_cfg[k] = cfg[k]
|
||||
+
|
||||
+ return xen_api_success(return_cfg)
|
||||
+
|
||||
+
|
||||
# Xen API: Class SR
|
||||
# ----------------------------------------------------------------
|
||||
SR_attr_ro = ['VDIs',
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -900,8 +900,7 @@ class XendConfig(dict):
|
||||
if target == None:
|
||||
target = self
|
||||
|
||||
- if dev_type not in XendDevices.valid_devices() and \
|
||||
- dev_type not in XendDevices.pseudo_devices():
|
||||
+ if dev_type not in XendDevices.valid_devices():
|
||||
raise XendConfigError("XendConfig: %s not a valid device type" %
|
||||
dev_type)
|
||||
|
||||
@@ -909,10 +908,10 @@ class XendConfig(dict):
|
||||
raise XendConfigError("XendConfig: device_add requires some "
|
||||
"config.")
|
||||
|
||||
- if cfg_sxp:
|
||||
- log.debug("XendConfig.device_add: %s" % str(cfg_sxp))
|
||||
- if cfg_xenapi:
|
||||
- log.debug("XendConfig.device_add: %s" % str(cfg_xenapi))
|
||||
+ #if cfg_sxp:
|
||||
+ # log.debug("XendConfig.device_add: %s" % str(cfg_sxp))
|
||||
+ #if cfg_xenapi:
|
||||
+ # log.debug("XendConfig.device_add: %s" % str(cfg_xenapi))
|
||||
|
||||
if cfg_sxp:
|
||||
if sxp.child0(cfg_sxp) == 'device':
|
||||
@@ -952,6 +951,11 @@ class XendConfig(dict):
|
||||
target['vbd_refs'] = []
|
||||
if dev_uuid not in target['vbd_refs']:
|
||||
target['vbd_refs'].append(dev_uuid)
|
||||
+ elif dev_type in ('console',):
|
||||
+ if 'console_refs' not in target:
|
||||
+ target['console_refs'] = []
|
||||
+ if dev_uuid not in target['console_refs']:
|
||||
+ target['console_refs'].append(dev_uuid)
|
||||
|
||||
return dev_uuid
|
||||
|
||||
@@ -1012,6 +1016,25 @@ class XendConfig(dict):
|
||||
return ''
|
||||
|
||||
|
||||
+ def console_add(self, protocol, uri):
|
||||
+ dev_uuid = uuid.createString()
|
||||
+ dev_info = {
|
||||
+ 'uuid': dev_uuid,
|
||||
+ 'protocol': protocol,
|
||||
+ 'uri': uri
|
||||
+ }
|
||||
+ if 'devices' not in self:
|
||||
+ self['devices'] = {}
|
||||
+
|
||||
+ self['devices'][dev_uuid] = ('console', dev_info)
|
||||
+ self['console_refs'].append(dev_uuid)
|
||||
+ return dev_info
|
||||
+
|
||||
+ def console_get_all(self, protocol):
|
||||
+ consoles = [dinfo for dtype, dinfo in self['devices'].values()
|
||||
+ if dtype == 'console']
|
||||
+ return [c for c in consoles if c.get('protocol') == protocol]
|
||||
+
|
||||
def device_update(self, dev_uuid, cfg_sxp):
|
||||
"""Update an existing device with the new configuration.
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendDevices.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendDevices.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendDevices.py
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
from xen.xend.server import blkif, netif, tpmif, pciif, iopif, irqif, usbif, vfbif
|
||||
from xen.xend.server.BlktapController import BlktapController
|
||||
+from xen.xend.server.ConsoleController import ConsoleController
|
||||
|
||||
class XendDevices:
|
||||
""" An ugly halfway point between the module local device name
|
||||
@@ -43,6 +44,7 @@ class XendDevices:
|
||||
'tap': BlktapController,
|
||||
'vfb': vfbif.VfbifController,
|
||||
'vkbd': vfbif.VkbdifController,
|
||||
+ 'console': ConsoleController,
|
||||
}
|
||||
|
||||
#@classmethod
|
||||
@@ -51,11 +53,6 @@ class XendDevices:
|
||||
valid_devices = classmethod(valid_devices)
|
||||
|
||||
#@classmethod
|
||||
- def pseudo_devices(cls):
|
||||
- return ['console']
|
||||
- pseudo_devices = classmethod(pseudo_devices)
|
||||
-
|
||||
- #@classmethod
|
||||
def make_controller(cls, name, domain):
|
||||
"""Factory function to make device controllers per domain.
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -680,6 +680,29 @@ class XendDomainInfo:
|
||||
for device in devices:
|
||||
self.info.device_add(device[0], cfg_sxp = device)
|
||||
|
||||
+ self._update_consoles()
|
||||
+
|
||||
+ def _update_consoles(self):
|
||||
+ if self.domid == None or self.domid == 0:
|
||||
+ return
|
||||
+
|
||||
+ # Update VT100 port if it exists
|
||||
+ self.console_port = self.readDom('console/port')
|
||||
+ if self.console_port is not None:
|
||||
+ serial_consoles = self.info.console_get_all('vt100')
|
||||
+ if not serial_consoles:
|
||||
+ cfg = self.info.console_add('vt100', self.console_port)
|
||||
+ self._createDevice('console', cfg)
|
||||
+
|
||||
+ # Update VNC port if it exists
|
||||
+ vnc_port = self.readDom('console/vnc-port')
|
||||
+ if vnc_port is not None:
|
||||
+ vnc_consoles = self.info.console_get_all('rfb')
|
||||
+ if not vnc_consoles:
|
||||
+ cfg = self.info.console_add('rfb', 'localhost:%s' %
|
||||
+ str(vnc_port))
|
||||
+ self._createDevice('console', cfg)
|
||||
+
|
||||
#
|
||||
# Function to update xenstore /vm/*
|
||||
#
|
||||
@@ -1825,7 +1848,8 @@ class XendDomainInfo:
|
||||
# TODO: we should eventually get rid of old_dom_states
|
||||
|
||||
self.info.update_config(info)
|
||||
-
|
||||
+ self._update_consoles()
|
||||
+
|
||||
if refresh:
|
||||
self.refreshShutdown(info)
|
||||
|
||||
@@ -1837,11 +1861,11 @@ class XendDomainInfo:
|
||||
ignore_devices = ignore_store,
|
||||
legacy_only = legacy_only)
|
||||
|
||||
- if not ignore_store and self.dompath:
|
||||
- vnc_port = self.readDom('console/vnc-port')
|
||||
- if vnc_port is not None:
|
||||
- result.append(['device',
|
||||
- ['console', ['vnc-port', str(vnc_port)]]])
|
||||
+ #if not ignore_store and self.dompath:
|
||||
+ # vnc_port = self.readDom('console/vnc-port')
|
||||
+ # if vnc_port is not None:
|
||||
+ # result.append(['device',
|
||||
+ # ['console', ['vnc-port', str(vnc_port)]]])
|
||||
|
||||
return result
|
||||
|
42
13628_xenapi.patch
Normal file
42
13628_xenapi.patch
Normal file
@ -0,0 +1,42 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1169779475 0
|
||||
# Node ID ba3ec84c9423a4eb7f7a4c1de052f9e935d17891
|
||||
# Parent 9d1d9877131de3aec3d56b277c03075d7f63f3a1
|
||||
[XEND] Add missing ConsoleController.py
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
diff -r 9d1d9877131d -r ba3ec84c9423 tools/python/xen/xend/server/ConsoleController.py
|
||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
||||
+++ b/tools/python/xen/xend/server/ConsoleController.py Fri Jan 26 02:44:35 2007 +0000
|
||||
@@ -0,0 +1,29 @@
|
||||
+from xen.xend.server.DevController import DevController
|
||||
+from xen.xend.XendLogging import log
|
||||
+
|
||||
+from xen.xend.XendError import VmError
|
||||
+
|
||||
+class ConsoleController(DevController):
|
||||
+ """A dummy controller for us to represent serial and vnc
|
||||
+ console devices with persistent UUIDs.
|
||||
+ """
|
||||
+
|
||||
+ valid_cfg = ['uri', 'uuid', 'protocol']
|
||||
+
|
||||
+ def __init__(self, vm):
|
||||
+ DevController.__init__(self, vm)
|
||||
+ self.hotplug = False
|
||||
+
|
||||
+ def getDeviceDetails(self, config):
|
||||
+ back = dict([(k, config[k]) for k in self.valid_cfg if k in config])
|
||||
+ return (self.allocateDeviceID(), back, {})
|
||||
+
|
||||
+
|
||||
+ def getDeviceConfiguration(self, devid):
|
||||
+ result = DevController.getDeviceConfiguration(self, devid)
|
||||
+ devinfo = self.readBackend(devid, *self.valid_cfg)
|
||||
+ config = dict(zip(self.valid_cfg, devinfo))
|
||||
+ config = dict([(key, val) for key, val in config.items()
|
||||
+ if val != None])
|
||||
+ return config
|
||||
+
|
93
13630-domctl.patch
Normal file
93
13630-domctl.patch
Normal file
@ -0,0 +1,93 @@
|
||||
# HG changeset patch
|
||||
# User kaf24@localhost.localdomain
|
||||
# Node ID e0291e3ed603f5437d1e88c7b746b6617346792c
|
||||
# Parent 2f8a7e5fd8bab112208c7cf51941aaa79afc615f
|
||||
32-on-64: New set_address_size domctl for switching to compat mode.
|
||||
From: Gerd Hoffmann <kraxel@suse.de>
|
||||
Signed-off-by: Keir Fraser <keir@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/xen/arch/x86/domctl.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/xen/arch/x86/domctl.c
|
||||
+++ xen-3.0.4-testing/xen/arch/x86/domctl.c
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <xen/lib.h>
|
||||
#include <xen/mm.h>
|
||||
#include <xen/guest_access.h>
|
||||
+#include <xen/compat.h>
|
||||
#include <public/domctl.h>
|
||||
#include <xen/sched.h>
|
||||
#include <xen/domain.h>
|
||||
@@ -293,6 +294,46 @@ _long arch_do_domctl(
|
||||
}
|
||||
break;
|
||||
|
||||
+ case XEN_DOMCTL_set_address_size:
|
||||
+ {
|
||||
+ struct domain *d;
|
||||
+
|
||||
+ ret = -ESRCH;
|
||||
+ if ( (d = find_domain_by_id(domctl->domain)) == NULL )
|
||||
+ break;
|
||||
+
|
||||
+ switch ( domctl->u.address_size.size )
|
||||
+ {
|
||||
+#ifdef CONFIG_COMPAT
|
||||
+ case 32:
|
||||
+ ret = switch_compat(d);
|
||||
+ break;
|
||||
+ case 64:
|
||||
+ ret = switch_native(d);
|
||||
+ break;
|
||||
+#endif
|
||||
+ default:
|
||||
+ ret = (domctl->u.address_size.size == BITS_PER_LONG) ? 0 : -EINVAL;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ put_domain(d);
|
||||
+ }
|
||||
+
|
||||
+ case XEN_DOMCTL_get_address_size:
|
||||
+ {
|
||||
+ struct domain *d;
|
||||
+
|
||||
+ ret = -ESRCH;
|
||||
+ if ( (d = find_domain_by_id(domctl->domain)) == NULL )
|
||||
+ break;
|
||||
+
|
||||
+ domctl->u.address_size.size = BITS_PER_GUEST_LONG(d);
|
||||
+
|
||||
+ ret = 0;
|
||||
+ put_domain(d);
|
||||
+ }
|
||||
+
|
||||
default:
|
||||
ret = -ENOSYS;
|
||||
break;
|
||||
Index: xen-3.0.4-testing/xen/include/public/domctl.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/xen/include/public/domctl.h
|
||||
+++ xen-3.0.4-testing/xen/include/public/domctl.h
|
||||
@@ -387,6 +387,13 @@ struct xen_domctl_settimeoffset {
|
||||
typedef struct xen_domctl_settimeoffset xen_domctl_settimeoffset_t;
|
||||
DEFINE_XEN_GUEST_HANDLE(xen_domctl_settimeoffset_t);
|
||||
|
||||
+#define XEN_DOMCTL_set_address_size 35
|
||||
+#define XEN_DOMCTL_get_address_size 36
|
||||
+typedef struct xen_domctl_address_size {
|
||||
+ uint32_t size;
|
||||
+} xen_domctl_address_size_t;
|
||||
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_address_size_t);
|
||||
+
|
||||
#define XEN_DOMCTL_real_mode_area 26
|
||||
struct xen_domctl_real_mode_area {
|
||||
uint32_t log; /* log2 of Real Mode Area size */
|
||||
@@ -423,6 +430,7 @@ struct xen_domctl {
|
||||
struct xen_domctl_arch_setup arch_setup;
|
||||
struct xen_domctl_settimeoffset settimeoffset;
|
||||
struct xen_domctl_real_mode_area real_mode_area;
|
||||
+ struct xen_domctl_address_size address_size;
|
||||
uint8_t pad[128];
|
||||
} u;
|
||||
};
|
19
13655_xenapi.patch
Normal file
19
13655_xenapi.patch
Normal file
@ -0,0 +1,19 @@
|
||||
# HG changeset patch
|
||||
# User kaf24@localhost.localdomain
|
||||
# Date 1169977642 0
|
||||
# Node ID fbe161b1af160a605878c7f18c42f4e1a9d1e55f
|
||||
# Parent 47e26ced172a971f7d347d367e7b29b9741ca9f6
|
||||
To avoid problems (hang) when doing migration, the Console Controller
|
||||
needs to implement a (dummy) migrate method.
|
||||
|
||||
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
|
||||
|
||||
diff -r 47e26ced172a -r fbe161b1af16 tools/python/xen/xend/server/ConsoleController.py
|
||||
--- a/tools/python/xen/xend/server/ConsoleController.py Sun Jan 28 09:46:09 2007 +0000
|
||||
+++ b/tools/python/xen/xend/server/ConsoleController.py Sun Jan 28 09:47:22 2007 +0000
|
||||
@@ -27,3 +27,5 @@ class ConsoleController(DevController):
|
||||
if val != None])
|
||||
return config
|
||||
|
||||
+ def migrate(self, deviceConfig, network, dst, step, domName):
|
||||
+ return 0
|
951
13689_xenapi.patch
Normal file
951
13689_xenapi.patch
Normal file
@ -0,0 +1,951 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170029140 0
|
||||
# Node ID bb15af2c2b4a52ef8a3ce9646507b956e6eae322
|
||||
# Parent 9db1847845d695f28cf59010fd7c0837811a8e1d
|
||||
Remove VBD.driver, VIF.type, VIF.name, VTPM.driver. This modelling was never
|
||||
correct, and the values are best left implicit.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/docs/xen-api/xenapi-datamodel.tex
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/docs/xen-api/xenapi-datamodel.tex
|
||||
+++ xen-3.0.4-testing/docs/xen-api/xenapi-datamodel.tex
|
||||
@@ -274,16 +274,6 @@ The following enumeration types are used
|
||||
\end{longtable}
|
||||
|
||||
\vspace{1cm}
|
||||
-\begin{longtable}{|ll|}
|
||||
-\hline
|
||||
-{\tt enum driver\_type} & \\
|
||||
-\hline
|
||||
-\hspace{0.5cm}{\tt ioemu} & use hardware emulation \\
|
||||
-\hspace{0.5cm}{\tt paravirtualised} & use paravirtualised driver \\
|
||||
-\hline
|
||||
-\end{longtable}
|
||||
-
|
||||
-\vspace{1cm}
|
||||
|
||||
\newpage
|
||||
\section{Class: session}
|
||||
@@ -5950,8 +5940,6 @@ references to objects with match names
|
||||
Quals & Field & Type & Description \\
|
||||
\hline
|
||||
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
|
||||
-$\mathit{RW}$ & {\tt name} & string & human-readable name of the interface \\
|
||||
-$\mathit{RW}$ & {\tt type} & driver\_type & interface type \\
|
||||
$\mathit{RW}$ & {\tt device} & string & name of network device as exposed to guest e.g. eth0 \\
|
||||
$\mathit{RW}$ & {\tt network} & network ref & virtual network to which this vif is connected \\
|
||||
$\mathit{RW}$ & {\tt VM} & VM ref & virtual machine to which this vif is connected \\
|
||||
@@ -6060,72 +6048,6 @@ void
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
-\subsubsection{RPC name:~get\_type}
|
||||
-
|
||||
-{\bf Overview:}
|
||||
-Get the type field of the given VIF.
|
||||
-
|
||||
- \noindent {\bf Signature:}
|
||||
-\begin{verbatim} (driver_type) get_type (session_id s, VIF ref self)\end{verbatim}
|
||||
-
|
||||
-
|
||||
-\noindent{\bf Arguments:}
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\begin{tabular}{|c|c|p{7cm}|}
|
||||
- \hline
|
||||
-{\bf type} & {\bf name} & {\bf description} \\ \hline
|
||||
-{\tt VIF ref } & self & reference to the object \\ \hline
|
||||
-
|
||||
-\end{tabular}
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-
|
||||
- \noindent {\bf Return Type:}
|
||||
-{\tt
|
||||
-driver\_type
|
||||
-}
|
||||
-
|
||||
-
|
||||
-value of the field
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\subsubsection{RPC name:~set\_type}
|
||||
-
|
||||
-{\bf Overview:}
|
||||
-Set the type field of the given VIF.
|
||||
-
|
||||
- \noindent {\bf Signature:}
|
||||
-\begin{verbatim} void set_type (session_id s, VIF ref self, driver_type value)\end{verbatim}
|
||||
-
|
||||
-
|
||||
-\noindent{\bf Arguments:}
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\begin{tabular}{|c|c|p{7cm}|}
|
||||
- \hline
|
||||
-{\bf type} & {\bf name} & {\bf description} \\ \hline
|
||||
-{\tt VIF ref } & self & reference to the object \\ \hline
|
||||
-
|
||||
-{\tt driver\_type } & value & New value to set \\ \hline
|
||||
-
|
||||
-\end{tabular}
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-
|
||||
- \noindent {\bf Return Type:}
|
||||
-{\tt
|
||||
-void
|
||||
-}
|
||||
-
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
\subsubsection{RPC name:~get\_device}
|
||||
|
||||
{\bf Overview:}
|
||||
@@ -8782,7 +8704,6 @@ $\mathit{RW}$ & {\tt VDI} & VDI ref & t
|
||||
$\mathit{RW}$ & {\tt device} & string & device seen by the guest e.g. hda1 \\
|
||||
$\mathit{RW}$ & {\tt mode} & vbd\_mode & the mode the disk should be mounted with \\
|
||||
$\mathit{RW}$ & {\tt type} & vbd\_type & how the VBD will appear to the guest (e.g. disk or CD) \\
|
||||
-$\mathit{RW}$ & {\tt driver} & driver\_type & the style of driver \\
|
||||
$\mathit{RO}_\mathit{run}$ & {\tt io/read\_kbs} & float & Read bandwidth (KiB/s) \\
|
||||
$\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB/s) \\
|
||||
\hline
|
||||
@@ -9184,72 +9105,6 @@ void
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
-\subsubsection{RPC name:~get\_driver}
|
||||
-
|
||||
-{\bf Overview:}
|
||||
-Get the driver field of the given VBD.
|
||||
-
|
||||
- \noindent {\bf Signature:}
|
||||
-\begin{verbatim} (driver_type) get_driver (session_id s, VBD ref self)\end{verbatim}
|
||||
-
|
||||
-
|
||||
-\noindent{\bf Arguments:}
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\begin{tabular}{|c|c|p{7cm}|}
|
||||
- \hline
|
||||
-{\bf type} & {\bf name} & {\bf description} \\ \hline
|
||||
-{\tt VBD ref } & self & reference to the object \\ \hline
|
||||
-
|
||||
-\end{tabular}
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-
|
||||
- \noindent {\bf Return Type:}
|
||||
-{\tt
|
||||
-driver\_type
|
||||
-}
|
||||
-
|
||||
-
|
||||
-value of the field
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\subsubsection{RPC name:~set\_driver}
|
||||
-
|
||||
-{\bf Overview:}
|
||||
-Set the driver field of the given VBD.
|
||||
-
|
||||
- \noindent {\bf Signature:}
|
||||
-\begin{verbatim} void set_driver (session_id s, VBD ref self, driver_type value)\end{verbatim}
|
||||
-
|
||||
-
|
||||
-\noindent{\bf Arguments:}
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\begin{tabular}{|c|c|p{7cm}|}
|
||||
- \hline
|
||||
-{\bf type} & {\bf name} & {\bf description} \\ \hline
|
||||
-{\tt VBD ref } & self & reference to the object \\ \hline
|
||||
-
|
||||
-{\tt driver\_type } & value & New value to set \\ \hline
|
||||
-
|
||||
-\end{tabular}
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-
|
||||
- \noindent {\bf Return Type:}
|
||||
-{\tt
|
||||
-void
|
||||
-}
|
||||
-
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
\subsubsection{RPC name:~get\_io\_read\_kbs}
|
||||
|
||||
{\bf Overview:}
|
||||
@@ -9457,7 +9312,6 @@ Quals & Field & Type & Description \\
|
||||
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
|
||||
$\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & the virtual machine \\
|
||||
$\mathit{RO}_\mathit{ins}$ & {\tt backend} & VM ref & the domain where the backend is located \\
|
||||
-$\mathit{RO}_\mathit{ins}$ & {\tt driver} & driver\_type & the style of driver \\
|
||||
$\mathit{RO}_\mathit{ins}$ & {\tt instance} & int & the instance number the virtual TPM represents \\
|
||||
\hline
|
||||
\end{longtable}
|
||||
@@ -9558,38 +9412,6 @@ value of the field
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
-\subsubsection{RPC name:~get\_driver}
|
||||
-
|
||||
-{\bf Overview:}
|
||||
-Get the driver field of the given VTPM.
|
||||
-
|
||||
- \noindent {\bf Signature:}
|
||||
-\begin{verbatim} (driver_type) get_driver (session_id s, VTPM ref self)\end{verbatim}
|
||||
-
|
||||
-
|
||||
-\noindent{\bf Arguments:}
|
||||
-
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-\begin{tabular}{|c|c|p{7cm}|}
|
||||
- \hline
|
||||
-{\bf type} & {\bf name} & {\bf description} \\ \hline
|
||||
-{\tt VTPM ref } & self & reference to the object \\ \hline
|
||||
-
|
||||
-\end{tabular}
|
||||
-
|
||||
-\vspace{0.3cm}
|
||||
-
|
||||
- \noindent {\bf Return Type:}
|
||||
-{\tt
|
||||
-driver\_type
|
||||
-}
|
||||
-
|
||||
-
|
||||
-value of the field
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
-\vspace{0.3cm}
|
||||
\subsubsection{RPC name:~get\_instance}
|
||||
|
||||
{\bf Overview:}
|
||||
Index: xen-3.0.4-testing/tools/libxen/include/xen_vbd.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/include/xen_vbd.h
|
||||
+++ xen-3.0.4-testing/tools/libxen/include/xen_vbd.h
|
||||
@@ -20,7 +20,6 @@
|
||||
#define XEN_VBD_H
|
||||
|
||||
#include "xen_common.h"
|
||||
-#include "xen_driver_type.h"
|
||||
#include "xen_vbd_decl.h"
|
||||
#include "xen_vbd_mode.h"
|
||||
#include "xen_vdi_decl.h"
|
||||
@@ -28,8 +27,8 @@
|
||||
|
||||
|
||||
/*
|
||||
- * The VBD class.
|
||||
- *
|
||||
+ * The VBD class.
|
||||
+ *
|
||||
* A virtual block device.
|
||||
*/
|
||||
|
||||
@@ -71,7 +70,6 @@ typedef struct xen_vbd_record
|
||||
char *device;
|
||||
char *image;
|
||||
enum xen_vbd_mode mode;
|
||||
- enum xen_driver_type driver;
|
||||
double io_read_kbs;
|
||||
double io_write_kbs;
|
||||
} xen_vbd_record;
|
||||
@@ -219,13 +217,6 @@ xen_vbd_get_mode(xen_session *session, e
|
||||
|
||||
|
||||
/**
|
||||
- * Get the driver field of the given VBD.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vbd_get_driver(xen_session *session, enum xen_driver_type *result, xen_vbd vbd);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
* Get the io/read_kbs field of the given VBD.
|
||||
*/
|
||||
extern bool
|
||||
@@ -268,13 +259,6 @@ xen_vbd_set_mode(xen_session *session, x
|
||||
|
||||
|
||||
/**
|
||||
- * Set the driver field of the given VBD.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vbd_set_driver(xen_session *session, xen_vbd vbd, enum xen_driver_type driver);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
* Change the media in the device for CDROM-like devices only. For
|
||||
* other devices, detach the VBD and attach a new one
|
||||
*/
|
||||
Index: xen-3.0.4-testing/tools/libxen/include/xen_vif.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/include/xen_vif.h
|
||||
+++ xen-3.0.4-testing/tools/libxen/include/xen_vif.h
|
||||
@@ -20,15 +20,14 @@
|
||||
#define XEN_VIF_H
|
||||
|
||||
#include "xen_common.h"
|
||||
-#include "xen_driver_type.h"
|
||||
#include "xen_network_decl.h"
|
||||
#include "xen_vif_decl.h"
|
||||
#include "xen_vm_decl.h"
|
||||
|
||||
|
||||
/*
|
||||
- * The VIF class.
|
||||
- *
|
||||
+ * The VIF class.
|
||||
+ *
|
||||
* A virtual network interface.
|
||||
*/
|
||||
|
||||
@@ -65,8 +64,6 @@ typedef struct xen_vif_record
|
||||
{
|
||||
xen_vif handle;
|
||||
char *uuid;
|
||||
- char *name;
|
||||
- enum xen_driver_type type;
|
||||
char *device;
|
||||
struct xen_network_record_opt *network;
|
||||
struct xen_vm_record_opt *vm;
|
||||
@@ -191,20 +188,6 @@ xen_vif_get_uuid(xen_session *session, c
|
||||
|
||||
|
||||
/**
|
||||
- * Get the name field of the given VIF.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vif_get_name(xen_session *session, char **result, xen_vif vif);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
- * Get the type field of the given VIF.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vif_get_type(xen_session *session, enum xen_driver_type *result, xen_vif vif);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
* Get the device field of the given VIF.
|
||||
*/
|
||||
extern bool
|
||||
@@ -254,20 +237,6 @@ xen_vif_get_io_write_kbs(xen_session *se
|
||||
|
||||
|
||||
/**
|
||||
- * Set the name field of the given VIF.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vif_set_name(xen_session *session, xen_vif vif, char *name);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
- * Set the type field of the given VIF.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vif_set_type(xen_session *session, xen_vif vif, enum xen_driver_type type);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
* Set the device field of the given VIF.
|
||||
*/
|
||||
extern bool
|
||||
Index: xen-3.0.4-testing/tools/libxen/include/xen_vtpm.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/include/xen_vtpm.h
|
||||
+++ xen-3.0.4-testing/tools/libxen/include/xen_vtpm.h
|
||||
@@ -21,7 +21,6 @@
|
||||
#define XEN_VTPM_H
|
||||
|
||||
#include "xen_common.h"
|
||||
-#include "xen_driver_type.h"
|
||||
#include "xen_vm_decl.h"
|
||||
#include "xen_vtpm_decl.h"
|
||||
|
||||
@@ -67,7 +66,6 @@ typedef struct xen_vtpm_record
|
||||
char *uuid;
|
||||
struct xen_vm_record_opt *vm;
|
||||
struct xen_vm_record_opt *backend;
|
||||
- enum xen_driver_type driver;
|
||||
int64_t instance;
|
||||
} xen_vtpm_record;
|
||||
|
||||
@@ -200,13 +198,6 @@ xen_vtpm_get_backend(xen_session *sessio
|
||||
|
||||
|
||||
/**
|
||||
- * Get the driver field of the given VTPM.
|
||||
- */
|
||||
-extern bool
|
||||
-xen_vtpm_get_driver(xen_session *session, enum xen_driver_type *result, xen_vtpm vtpm);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
* Get the instance field of the given VTPM.
|
||||
*/
|
||||
extern bool
|
||||
Index: xen-3.0.4-testing/tools/libxen/src/xen_vbd.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/src/xen_vbd.c
|
||||
+++ xen-3.0.4-testing/tools/libxen/src/xen_vbd.c
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "xen_common.h"
|
||||
-#include "xen_driver_type_internal.h"
|
||||
#include "xen_internal.h"
|
||||
#include "xen_vbd.h"
|
||||
#include "xen_vbd_mode_internal.h"
|
||||
@@ -58,9 +57,6 @@ static const struct_member xen_vbd_recor
|
||||
{ .key = "mode",
|
||||
.type = &xen_vbd_mode_abstract_type_,
|
||||
.offset = offsetof(xen_vbd_record, mode) },
|
||||
- { .key = "driver",
|
||||
- .type = &xen_driver_type_abstract_type_,
|
||||
- .offset = offsetof(xen_vbd_record, driver) },
|
||||
{ .key = "io_read_kbs",
|
||||
.type = &abstract_type_float,
|
||||
.offset = offsetof(xen_vbd_record, io_read_kbs) },
|
||||
@@ -235,23 +231,6 @@ xen_vbd_get_mode(xen_session *session, e
|
||||
|
||||
|
||||
bool
|
||||
-xen_vbd_get_driver(xen_session *session, enum xen_driver_type *result, xen_vbd vbd)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vbd }
|
||||
- };
|
||||
-
|
||||
- abstract_type result_type = xen_driver_type_abstract_type_;
|
||||
- char *result_str = NULL;
|
||||
- XEN_CALL_("VBD.get_driver");
|
||||
- *result = xen_driver_type_from_string(session, result_str);
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
xen_vbd_get_io_read_kbs(xen_session *session, double *result, xen_vbd vbd)
|
||||
{
|
||||
abstract_value param_values[] =
|
||||
@@ -348,22 +327,6 @@ xen_vbd_set_mode(xen_session *session, x
|
||||
|
||||
|
||||
bool
|
||||
-xen_vbd_set_driver(xen_session *session, xen_vbd vbd, enum xen_driver_type driver)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vbd },
|
||||
- { .type = &xen_driver_type_abstract_type_,
|
||||
- .u.string_val = xen_driver_type_to_string(driver) }
|
||||
- };
|
||||
-
|
||||
- xen_call_(session, "VBD.set_driver", param_values, 2, NULL, NULL);
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi)
|
||||
{
|
||||
abstract_value param_values[] =
|
||||
Index: xen-3.0.4-testing/tools/libxen/src/xen_vif.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/src/xen_vif.c
|
||||
+++ xen-3.0.4-testing/tools/libxen/src/xen_vif.c
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "xen_common.h"
|
||||
-#include "xen_driver_type_internal.h"
|
||||
#include "xen_internal.h"
|
||||
#include "xen_network.h"
|
||||
#include "xen_vif.h"
|
||||
@@ -42,12 +41,6 @@ static const struct_member xen_vif_recor
|
||||
{ .key = "uuid",
|
||||
.type = &abstract_type_string,
|
||||
.offset = offsetof(xen_vif_record, uuid) },
|
||||
- { .key = "name",
|
||||
- .type = &abstract_type_string,
|
||||
- .offset = offsetof(xen_vif_record, name) },
|
||||
- { .key = "type",
|
||||
- .type = &xen_driver_type_abstract_type_,
|
||||
- .offset = offsetof(xen_vif_record, type) },
|
||||
{ .key = "device",
|
||||
.type = &abstract_type_string,
|
||||
.offset = offsetof(xen_vif_record, device) },
|
||||
@@ -90,7 +83,6 @@ xen_vif_record_free(xen_vif_record *reco
|
||||
}
|
||||
free(record->handle);
|
||||
free(record->uuid);
|
||||
- free(record->name);
|
||||
free(record->device);
|
||||
xen_network_record_opt_free(record->network);
|
||||
xen_vm_record_opt_free(record->vm);
|
||||
@@ -171,38 +163,6 @@ xen_vif_destroy(xen_session *session, xe
|
||||
|
||||
|
||||
bool
|
||||
-xen_vif_get_name(xen_session *session, char **result, xen_vif vif)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vif }
|
||||
- };
|
||||
-
|
||||
- abstract_type result_type = abstract_type_string;
|
||||
-
|
||||
- *result = NULL;
|
||||
- XEN_CALL_("VIF.get_name");
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
-xen_vif_get_type(xen_session *session, enum xen_driver_type *result, xen_vif vif)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vif }
|
||||
- };
|
||||
-
|
||||
- abstract_type result_type = xen_driver_type_abstract_type_;
|
||||
- XEN_CALL_("VIF.get_type");
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
xen_vif_get_device(xen_session *session, char **result, xen_vif vif)
|
||||
{
|
||||
abstract_value param_values[] =
|
||||
@@ -319,38 +279,6 @@ xen_vif_get_io_write_kbs(xen_session *se
|
||||
|
||||
|
||||
bool
|
||||
-xen_vif_set_name(xen_session *session, xen_vif vif, char *name)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vif },
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = name }
|
||||
- };
|
||||
-
|
||||
- xen_call_(session, "VIF.set_name", param_values, 2, NULL, NULL);
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
-xen_vif_set_type(xen_session *session, xen_vif vif, enum xen_driver_type type)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vif },
|
||||
- { .type = &xen_driver_type_abstract_type_,
|
||||
- .u.string_val = xen_driver_type_to_string(type) }
|
||||
- };
|
||||
-
|
||||
- xen_call_(session, "VIF.set_type", param_values, 2, NULL, NULL);
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
xen_vif_set_device(xen_session *session, xen_vif vif, char *device)
|
||||
{
|
||||
abstract_value param_values[] =
|
||||
Index: xen-3.0.4-testing/tools/libxen/src/xen_vtpm.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/src/xen_vtpm.c
|
||||
+++ xen-3.0.4-testing/tools/libxen/src/xen_vtpm.c
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "xen_common.h"
|
||||
-#include "xen_driver_type_internal.h"
|
||||
#include "xen_internal.h"
|
||||
#include "xen_vm.h"
|
||||
#include "xen_vtpm.h"
|
||||
@@ -48,9 +47,6 @@ static const struct_member xen_vtpm_reco
|
||||
{ .key = "backend",
|
||||
.type = &abstract_type_ref,
|
||||
.offset = offsetof(xen_vtpm_record, backend) },
|
||||
- { .key = "driver",
|
||||
- .type = &xen_driver_type_abstract_type_,
|
||||
- .offset = offsetof(xen_vtpm_record, driver) },
|
||||
{ .key = "instance",
|
||||
.type = &abstract_type_int,
|
||||
.offset = offsetof(xen_vtpm_record, instance) }
|
||||
@@ -187,21 +183,6 @@ xen_vtpm_get_backend(xen_session *sessio
|
||||
|
||||
|
||||
bool
|
||||
-xen_vtpm_get_driver(xen_session *session, enum xen_driver_type *result, xen_vtpm vtpm)
|
||||
-{
|
||||
- abstract_value param_values[] =
|
||||
- {
|
||||
- { .type = &abstract_type_string,
|
||||
- .u.string_val = vtpm }
|
||||
- };
|
||||
-
|
||||
- abstract_type result_type = xen_driver_type_abstract_type_;
|
||||
- XEN_CALL_("VTPM.get_driver");
|
||||
- return session->ok;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-bool
|
||||
xen_vtpm_get_instance(xen_session *session, int64_t *result, xen_vtpm vtpm)
|
||||
{
|
||||
abstract_value param_values[] =
|
||||
Index: xen-3.0.4-testing/tools/libxen/test/test_bindings.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/test/test_bindings.c
|
||||
+++ xen-3.0.4-testing/tools/libxen/test/test_bindings.c
|
||||
@@ -382,8 +382,7 @@ static xen_vm create_new_vm(xen_session
|
||||
.vm = &vm_record_opt,
|
||||
.vdi = &vdi0_record_opt,
|
||||
.device = "xvda1",
|
||||
- .mode = XEN_VBD_MODE_RW,
|
||||
- .driver = XEN_DRIVER_TYPE_PARAVIRTUALISED
|
||||
+ .mode = XEN_VBD_MODE_RW
|
||||
};
|
||||
|
||||
xen_vbd vbd0;
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -1067,8 +1067,7 @@ class XendAPI:
|
||||
'VDI',
|
||||
'device',
|
||||
'mode',
|
||||
- 'type',
|
||||
- 'driver']
|
||||
+ 'type']
|
||||
|
||||
VBD_attr_inst = VBD_attr_rw + ['image']
|
||||
|
||||
@@ -1150,10 +1149,6 @@ class XendAPI:
|
||||
xendom = XendDomain.instance()
|
||||
return xen_api_success(xendom.get_dev_property('vbd', vbd_ref,
|
||||
'mode'))
|
||||
- def VBD_get_driver(self, session, vbd_ref):
|
||||
- xendom = XendDomain.instance()
|
||||
- return xen_api_success(xendom.get_dev_property('vbd', vbd_ref,
|
||||
- 'driver'))
|
||||
|
||||
def VBD_get_type(self, session, vbd_ref):
|
||||
xendom = XendDomain.instance()
|
||||
@@ -1177,9 +1172,7 @@ class XendAPI:
|
||||
|
||||
VIF_attr_ro = ['io_read_kbs',
|
||||
'io_write_kbs']
|
||||
- VIF_attr_rw = ['name',
|
||||
- 'type',
|
||||
- 'device',
|
||||
+ VIF_attr_rw = ['device',
|
||||
'network',
|
||||
'VM',
|
||||
'MAC',
|
||||
@@ -1237,10 +1230,6 @@ class XendAPI:
|
||||
vm = xendom.get_vm_with_dev_uuid('vif', vif_ref)
|
||||
return xen_api_success(vm.get_uuid())
|
||||
|
||||
- def VIF_get_name(self, session, vif_ref):
|
||||
- xendom = XendDomain.instance()
|
||||
- return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
- 'name'))
|
||||
def VIF_get_MTU(self, session, vif_ref):
|
||||
xendom = XendDomain.instance()
|
||||
return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
@@ -1250,17 +1239,10 @@ class XendAPI:
|
||||
return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
'MAC'))
|
||||
|
||||
- def VIF_get_type(self, session, vif_ref):
|
||||
- xendom = XendDomain.instance()
|
||||
- return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
- 'type'))
|
||||
-
|
||||
-
|
||||
def VIF_get_device(self, session, vif_ref):
|
||||
xendom = XendDomain.instance()
|
||||
return xen_api_success(xendom.get_dev_property_by_uuid('vif', vif_ref,
|
||||
'device'))
|
||||
-
|
||||
|
||||
def VIF_get_io_read_kbs(self, session, vif_ref):
|
||||
return xen_api_todo()
|
||||
@@ -1434,8 +1416,7 @@ class XendAPI:
|
||||
VTPM_attr_rw = [ ]
|
||||
VTPM_attr_ro = ['VM',
|
||||
'backend',
|
||||
- 'instance',
|
||||
- 'driver']
|
||||
+ 'instance']
|
||||
|
||||
VTPM_attr_inst = VTPM_attr_rw
|
||||
|
||||
@@ -1471,20 +1452,6 @@ class XendAPI:
|
||||
instance = -1
|
||||
return xen_api_success(instance)
|
||||
|
||||
- def VTPM_get_driver(self, session, vtpm_ref):
|
||||
- xendom = XendDomain.instance()
|
||||
- vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
|
||||
- if not vm:
|
||||
- return xen_api_error(XEND_ERROR_VTPM_INVALID)
|
||||
- cfg = vm.get_dev_xenapi_config('vtpm', vtpm_ref)
|
||||
- if not cfg:
|
||||
- return xen_api_error(XEND_ERROR_VTPM_INVALID)
|
||||
- if cfg.has_key('type'):
|
||||
- driver = cfg['type']
|
||||
- else:
|
||||
- driver = "Unknown"
|
||||
- return xen_api_success(driver)
|
||||
-
|
||||
def VTPM_get_backend(self, session, vtpm_ref):
|
||||
xendom = XendDomain.instance()
|
||||
vm = xendom.get_vm_with_dev_uuid('vtpm', vtpm_ref)
|
||||
Index: xen-3.0.4-testing/tools/libxen/include/xen_driver_type.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/include/xen_driver_type.h
|
||||
+++ /dev/null
|
||||
@@ -1,77 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2006, XenSource Inc.
|
||||
- *
|
||||
- * This library is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU Lesser General Public
|
||||
- * License as published by the Free Software Foundation; either
|
||||
- * version 2.1 of the License, or (at your option) any later version.
|
||||
- *
|
||||
- * This library is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
- * Lesser General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU Lesser General Public
|
||||
- * License along with this library; if not, write to the Free Software
|
||||
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
- */
|
||||
-
|
||||
-#ifndef XEN_DRIVER_TYPE_H
|
||||
-#define XEN_DRIVER_TYPE_H
|
||||
-
|
||||
-
|
||||
-#include "xen_common.h"
|
||||
-
|
||||
-
|
||||
-enum xen_driver_type
|
||||
-{
|
||||
- /**
|
||||
- * use hardware emulation
|
||||
- */
|
||||
- XEN_DRIVER_TYPE_IOEMU,
|
||||
-
|
||||
- /**
|
||||
- * use paravirtualised driver
|
||||
- */
|
||||
- XEN_DRIVER_TYPE_PARAVIRTUALISED
|
||||
-};
|
||||
-
|
||||
-
|
||||
-typedef struct xen_driver_type_set
|
||||
-{
|
||||
- size_t size;
|
||||
- enum xen_driver_type contents[];
|
||||
-} xen_driver_type_set;
|
||||
-
|
||||
-/**
|
||||
- * Allocate a xen_driver_type_set of the given size.
|
||||
- */
|
||||
-extern xen_driver_type_set *
|
||||
-xen_driver_type_set_alloc(size_t size);
|
||||
-
|
||||
-/**
|
||||
- * Free the given xen_driver_type_set. The given set must have been
|
||||
- * allocated by this library.
|
||||
- */
|
||||
-extern void
|
||||
-xen_driver_type_set_free(xen_driver_type_set *set);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
- * Return the name corresponding to the given code. This string must
|
||||
- * not be modified or freed.
|
||||
- */
|
||||
-extern const char *
|
||||
-xen_driver_type_to_string(enum xen_driver_type val);
|
||||
-
|
||||
-
|
||||
-/**
|
||||
- * Return the correct code for the given string, or set the session
|
||||
- * object to failure and return an undefined value if the given string does
|
||||
- * not match a known code.
|
||||
- */
|
||||
-extern enum xen_driver_type
|
||||
-xen_driver_type_from_string(xen_session *session, const char *str);
|
||||
-
|
||||
-
|
||||
-#endif
|
||||
Index: xen-3.0.4-testing/tools/libxen/include/xen_driver_type_internal.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/include/xen_driver_type_internal.h
|
||||
+++ /dev/null
|
||||
@@ -1,37 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2006, XenSource Inc.
|
||||
- *
|
||||
- * This library is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU Lesser General Public
|
||||
- * License as published by the Free Software Foundation; either
|
||||
- * version 2.1 of the License, or (at your option) any later version.
|
||||
- *
|
||||
- * This library is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
- * Lesser General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU Lesser General Public
|
||||
- * License along with this library; if not, write to the Free Software
|
||||
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
- */
|
||||
-
|
||||
-
|
||||
-/*
|
||||
- * Declarations of the abstract types used during demarshalling of enum
|
||||
- * xen_driver_type. Internal to this library -- do not use from outside.
|
||||
- */
|
||||
-
|
||||
-
|
||||
-#ifndef XEN_DRIVER_TYPE_INTERNAL_H
|
||||
-#define XEN_DRIVER_TYPE_INTERNAL_H
|
||||
-
|
||||
-
|
||||
-#include "xen_internal.h"
|
||||
-
|
||||
-
|
||||
-extern const abstract_type xen_driver_type_abstract_type_;
|
||||
-extern const abstract_type xen_driver_type_set_abstract_type_;
|
||||
-
|
||||
-
|
||||
-#endif
|
||||
Index: xen-3.0.4-testing/tools/libxen/src/xen_driver_type.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/src/xen_driver_type.c
|
||||
+++ /dev/null
|
||||
@@ -1,81 +0,0 @@
|
||||
-/*
|
||||
- * Copyright (c) 2006, XenSource Inc.
|
||||
- *
|
||||
- * This library is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU Lesser General Public
|
||||
- * License as published by the Free Software Foundation; either
|
||||
- * version 2.1 of the License, or (at your option) any later version.
|
||||
- *
|
||||
- * This library is distributed in the hope that it will be useful,
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
- * Lesser General Public License for more details.
|
||||
- *
|
||||
- * You should have received a copy of the GNU Lesser General Public
|
||||
- * License along with this library; if not, write to the Free Software
|
||||
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
- */
|
||||
-
|
||||
-#include <string.h>
|
||||
-
|
||||
-#include "xen_internal.h"
|
||||
-#include "xen_driver_type.h"
|
||||
-#include "xen_driver_type_internal.h"
|
||||
-
|
||||
-
|
||||
-/*
|
||||
- * Maintain this in the same order as the enum declaration!
|
||||
- */
|
||||
-static const char *lookup_table[] =
|
||||
-{
|
||||
- "ioemu",
|
||||
- "paravirtualised"
|
||||
-};
|
||||
-
|
||||
-
|
||||
-extern xen_driver_type_set *
|
||||
-xen_driver_type_set_alloc(size_t size)
|
||||
-{
|
||||
- return calloc(1, sizeof(xen_driver_type_set) +
|
||||
- size * sizeof(enum xen_driver_type));
|
||||
-}
|
||||
-
|
||||
-
|
||||
-extern void
|
||||
-xen_driver_type_set_free(xen_driver_type_set *set)
|
||||
-{
|
||||
- free(set);
|
||||
-}
|
||||
-
|
||||
-
|
||||
-const char *
|
||||
-xen_driver_type_to_string(enum xen_driver_type val)
|
||||
-{
|
||||
- return lookup_table[val];
|
||||
-}
|
||||
-
|
||||
-
|
||||
-extern enum xen_driver_type
|
||||
-xen_driver_type_from_string(xen_session *session, const char *str)
|
||||
-{
|
||||
- return ENUM_LOOKUP(session, str, lookup_table);
|
||||
-}
|
||||
-
|
||||
-
|
||||
-const abstract_type xen_driver_type_abstract_type_ =
|
||||
- {
|
||||
- .typename = ENUM,
|
||||
- .enum_marshaller =
|
||||
- (const char *(*)(int))&xen_driver_type_to_string,
|
||||
- .enum_demarshaller =
|
||||
- (int (*)(xen_session *, const char *))&xen_driver_type_from_string
|
||||
- };
|
||||
-
|
||||
-
|
||||
-const abstract_type xen_driver_type_set_abstract_type_ =
|
||||
- {
|
||||
- .typename = SET,
|
||||
- .child = &xen_driver_type_abstract_type_
|
||||
- };
|
||||
-
|
||||
-
|
157
13724_xenapi.patch
Normal file
157
13724_xenapi.patch
Normal file
@ -0,0 +1,157 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170170830 0
|
||||
# Node ID 2f3794098e22a15064fbf07d2208cf526f59010b
|
||||
# Parent 7fdfa020d4ed63fe758395c4630dab018f13424a
|
||||
Added VM.is_control_domain field.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/docs/xen-api/xenapi-datamodel.tex
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/docs/xen-api/xenapi-datamodel.tex
|
||||
+++ xen-3.0.4-testing/docs/xen-api/xenapi-datamodel.tex
|
||||
@@ -3644,6 +3644,38 @@ void
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
\vspace{0.3cm}
|
||||
+\subsubsection{RPC name:~get\_is\_control\_domain}
|
||||
+
|
||||
+{\bf Overview:}
|
||||
+Get the is\_control\_domain field of the given VM.
|
||||
+
|
||||
+ \noindent {\bf Signature:}
|
||||
+\begin{verbatim} bool get_is_control_domain (session_id s, VM ref self)\end{verbatim}
|
||||
+
|
||||
+
|
||||
+\noindent{\bf Arguments:}
|
||||
+
|
||||
+
|
||||
+\vspace{0.3cm}
|
||||
+\begin{tabular}{|c|c|p{7cm}|}
|
||||
+ \hline
|
||||
+{\bf type} & {\bf name} & {\bf description} \\ \hline
|
||||
+{\tt VM ref } & self & reference to the object \\ \hline
|
||||
+
|
||||
+\end{tabular}
|
||||
+
|
||||
+\vspace{0.3cm}
|
||||
+
|
||||
+ \noindent {\bf Return Type:}
|
||||
+{\tt
|
||||
+bool
|
||||
+}
|
||||
+
|
||||
+
|
||||
+value of the field
|
||||
+\vspace{0.3cm}
|
||||
+\vspace{0.3cm}
|
||||
+\vspace{0.3cm}
|
||||
\subsubsection{RPC name:~get\_boot\_method}
|
||||
|
||||
{\bf Overview:}
|
||||
@@ -9312,7 +9344,6 @@ Quals & Field & Type & Description \\
|
||||
$\mathit{RO}_\mathit{run}$ & {\tt uuid} & string & unique identifier/object reference \\
|
||||
$\mathit{RO}_\mathit{ins}$ & {\tt VM} & VM ref & the virtual machine \\
|
||||
$\mathit{RO}_\mathit{ins}$ & {\tt backend} & VM ref & the domain where the backend is located \\
|
||||
-$\mathit{RO}_\mathit{ins}$ & {\tt instance} & int & the instance number the virtual TPM represents \\
|
||||
\hline
|
||||
\end{longtable}
|
||||
\subsection{Additional RPCs associated with class: VTPM}
|
||||
Index: xen-3.0.4-testing/tools/libxen/include/xen_vm.h
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/include/xen_vm.h
|
||||
+++ xen-3.0.4-testing/tools/libxen/include/xen_vm.h
|
||||
@@ -142,6 +142,7 @@ typedef struct xen_vm_record
|
||||
char *pci_bus;
|
||||
xen_string_string_map *tools_version;
|
||||
xen_string_string_map *otherconfig;
|
||||
+ bool is_control_domain;
|
||||
} xen_vm_record;
|
||||
|
||||
/**
|
||||
@@ -562,6 +563,13 @@ xen_vm_get_otherconfig(xen_session *sess
|
||||
|
||||
|
||||
/**
|
||||
+ * Get the is_control_domain field of the given VM.
|
||||
+ */
|
||||
+extern bool
|
||||
+xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
|
||||
+
|
||||
+
|
||||
+/**
|
||||
* Set the name/label field of the given VM.
|
||||
*/
|
||||
extern bool
|
||||
Index: xen-3.0.4-testing/tools/libxen/src/xen_vm.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/libxen/src/xen_vm.c
|
||||
+++ xen-3.0.4-testing/tools/libxen/src/xen_vm.c
|
||||
@@ -176,7 +176,10 @@ static const struct_member xen_vm_record
|
||||
.offset = offsetof(xen_vm_record, tools_version) },
|
||||
{ .key = "otherConfig",
|
||||
.type = &abstract_type_string_string_map,
|
||||
- .offset = offsetof(xen_vm_record, otherconfig) }
|
||||
+ .offset = offsetof(xen_vm_record, otherconfig) },
|
||||
+ { .key = "is_control_domain",
|
||||
+ .type = &abstract_type_bool,
|
||||
+ .offset = offsetof(xen_vm_record, is_control_domain) }
|
||||
};
|
||||
|
||||
const abstract_type xen_vm_record_abstract_type_ =
|
||||
@@ -1006,6 +1009,22 @@ xen_vm_get_otherconfig(xen_session *sess
|
||||
|
||||
|
||||
bool
|
||||
+xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm)
|
||||
+{
|
||||
+ abstract_value param_values[] =
|
||||
+ {
|
||||
+ { .type = &abstract_type_string,
|
||||
+ .u.string_val = vm }
|
||||
+ };
|
||||
+
|
||||
+ abstract_type result_type = abstract_type_bool;
|
||||
+
|
||||
+ XEN_CALL_("VM.get_is_control_domain");
|
||||
+ return session->ok;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+bool
|
||||
xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label)
|
||||
{
|
||||
abstract_value param_values[] =
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -603,6 +603,7 @@ class XendAPI:
|
||||
'VTPMs',
|
||||
'PCI_bus',
|
||||
'tools_version',
|
||||
+ 'is_control_domain',
|
||||
]
|
||||
|
||||
VM_attr_rw = ['name_label',
|
||||
@@ -856,6 +857,11 @@ class XendAPI:
|
||||
def VM_get_otherConfig(self, session, vm_ref):
|
||||
return self.VM_get('otherConfig', session, vm_ref)
|
||||
|
||||
+ def VM_get_is_control_domain(self, session, vm_ref):
|
||||
+ xd = XendDomain.instance()
|
||||
+ return xen_api_success(
|
||||
+ xd.get_vm_by_uuid(vm_ref) == xd.privilegedDomain())
|
||||
+
|
||||
def VM_set_name_label(self, session, vm_ref, label):
|
||||
dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
|
||||
dom.setName(label)
|
||||
@@ -1025,6 +1031,7 @@ class XendAPI:
|
||||
'PCI_bus': xeninfo.get_pci_bus(),
|
||||
'tools_version': xeninfo.get_tools_version(),
|
||||
'otherConfig': xeninfo.info.get('otherconfig'),
|
||||
+ 'is_control_domain': xeninfo == xendom.privilegedDomain(),
|
||||
}
|
||||
return xen_api_success(record)
|
||||
|
662
13745_xenapi.patch
Normal file
662
13745_xenapi.patch
Normal file
@ -0,0 +1,662 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1170249636 0
|
||||
# Node ID 3cccf8e6429666be58408972570dbd063a2bae1e
|
||||
# Parent 7c992fd3b19ba3f7094e0c01205a481dc74661f8
|
||||
[XEND] Merge VFB support for PV and HVM guests.
|
||||
|
||||
This patch merges the way VFB are represented inside Xend by making
|
||||
HVM VNC consoles use the VFB as its configuration object.
|
||||
|
||||
It preserves the way options are specified through xm but will create
|
||||
a new VFB device that is used by image.py to put vnc config into
|
||||
qemu-dm's command line. The parsing is moved into image.py's
|
||||
parseDeviceModel() rather than in configVNC().
|
||||
|
||||
Through the Xen API, you can create a 'console' of protocol 'rfb' and
|
||||
end up with a VNC console, on both HVM and PV guests. The location of
|
||||
the connecting port is stored in the location attribute of the console
|
||||
object. This is updated on each XendDomainInfo.update() if it
|
||||
changes.
|
||||
|
||||
Also fixes missing read of the vnclisten and HVM_boot from the
|
||||
config when initialised via xm. Makes sure bootable attribute for VBD
|
||||
is store as an int when making SXP config.
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendAPI.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendAPI.py
|
||||
@@ -1511,8 +1511,9 @@ class XendAPI:
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
|
||||
- console_attr_ro = ['uri', 'protocol', 'VM']
|
||||
- console_attr_rw = []
|
||||
+ console_attr_ro = ['location', 'protocol', 'VM']
|
||||
+ console_attr_rw = ['other_config']
|
||||
+ console_funcs = [('create', 'console')]
|
||||
|
||||
def console_get_all(self, session):
|
||||
xendom = XendDomain.instance()
|
||||
@@ -1520,10 +1521,10 @@ class XendAPI:
|
||||
cons = reduce(lambda x, y: x + y, cons)
|
||||
return xen_api_success(cons)
|
||||
|
||||
- def console_get_uri(self, session, console_ref):
|
||||
+ def console_get_location(self, session, console_ref):
|
||||
return xen_api_success(xendom.get_dev_property_by_uuid('console',
|
||||
console_ref,
|
||||
- 'uri'))
|
||||
+ 'location'))
|
||||
|
||||
def console_get_protocol(self, session, console_ref):
|
||||
return xen_api_success(xendom.get_dev_property_by_uuid('console',
|
||||
@@ -1555,6 +1556,22 @@ class XendAPI:
|
||||
|
||||
return xen_api_success(return_cfg)
|
||||
|
||||
+ def console_create(self, session, console_struct):
|
||||
+ xendom = XendDomain.instance()
|
||||
+ if not xendom.is_valid_vm(console_struct['VM']):
|
||||
+ return xen_api_error(['VM_HANDLE_INVALID', console_struct['VM']])
|
||||
+
|
||||
+ dom = xendom.get_vm_by_uuid(console_struct['VM'])
|
||||
+ try:
|
||||
+ if 'protocol' not in console_struct:
|
||||
+ return xen_api_error(['CONSOLE_PROTOCOL_INVALID',
|
||||
+ 'No protocol specified'])
|
||||
+
|
||||
+ console_ref = dom.create_console(console_struct)
|
||||
+ xendom.managed_config_save(dom)
|
||||
+ return xen_api_success(console_ref)
|
||||
+ except XendError, e:
|
||||
+ return xen_api_error([XEND_ERROR_TODO, str(e)])
|
||||
|
||||
# Xen API: Class SR
|
||||
# ----------------------------------------------------------------
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -107,6 +107,7 @@ XENAPI_HVM_CFG = {
|
||||
'platform_serial' : 'serial',
|
||||
'platform_localtime': 'localtime',
|
||||
'platform_keymap' : 'keymap',
|
||||
+ 'HVM_boot': 'boot',
|
||||
}
|
||||
|
||||
# List of XendConfig configuration keys that have no direct equivalent
|
||||
@@ -230,7 +231,8 @@ LEGACY_IMAGE_CFG = [
|
||||
('sdl', int),
|
||||
('vncdisplay', int),
|
||||
('vncunused', int),
|
||||
- ('vncpasswd', str),
|
||||
+ ('vncpasswd', str),
|
||||
+ ('vnclisten', str),
|
||||
]
|
||||
|
||||
LEGACY_IMAGE_HVM_CFG = [
|
||||
@@ -362,6 +364,7 @@ class XendConfig(dict):
|
||||
'vif_refs': [],
|
||||
'vbd_refs': [],
|
||||
'vtpm_refs': [],
|
||||
+ 'other_config': {},
|
||||
}
|
||||
|
||||
defaults['name_label'] = 'Domain-' + defaults['uuid']
|
||||
@@ -643,6 +646,25 @@ class XendConfig(dict):
|
||||
self['vbd_refs'] = cfg.get('vbd_refs', [])
|
||||
self['vtpm_refs'] = cfg.get('vtpm_refs', [])
|
||||
|
||||
+ # coalesce hvm vnc frame buffer with vfb config
|
||||
+ if self['image']['type'] == 'hvm' and self['image'].get('vnc', 0):
|
||||
+ # add vfb device if it isn't there already
|
||||
+ has_rfb = False
|
||||
+ for console_uuid in self['console_refs']:
|
||||
+ if self['devices'][console_uuid][1].get('protocol') == 'rfb':
|
||||
+ has_rfb = True
|
||||
+ break
|
||||
+
|
||||
+ if not has_rfb:
|
||||
+ dev_config = ['vfb']
|
||||
+ # copy VNC related params from image config to vfb dev conf
|
||||
+ for key in ['vncpasswd', 'vncunused', 'vncdisplay',
|
||||
+ 'vnclisten']:
|
||||
+ if key in self['image']:
|
||||
+ dev_config.append([key, self['image'][key]])
|
||||
+
|
||||
+ self.device_add('vfb', cfg_sxp = dev_config)
|
||||
+
|
||||
|
||||
def _sxp_to_xapi_unsupported(self, sxp_cfg):
|
||||
"""Read in an SXP configuration object and populate
|
||||
@@ -951,6 +973,26 @@ class XendConfig(dict):
|
||||
target['vbd_refs'] = []
|
||||
if dev_uuid not in target['vbd_refs']:
|
||||
target['vbd_refs'].append(dev_uuid)
|
||||
+ elif dev_type == 'vfb':
|
||||
+ # Populate other config with aux data that is associated
|
||||
+ # with vfb
|
||||
+
|
||||
+ other_config = {}
|
||||
+ for key in ['vncunused', 'vncdisplay', 'vnclisten',
|
||||
+ 'vncpasswd', 'type', 'display', 'xauthority',
|
||||
+ 'keymap']:
|
||||
+ if key in dev_info:
|
||||
+ other_config[key] = dev_info[key]
|
||||
+ target['devices'][dev_uuid][1]['other_config'] = other_config
|
||||
+
|
||||
+
|
||||
+ if 'console_refs' not in target:
|
||||
+ target['console_refs'] = []
|
||||
+
|
||||
+ # Treat VFB devices as console devices so they are found
|
||||
+ # through Xen API
|
||||
+ if dev_uuid not in target['console_refs']:
|
||||
+ target['console_refs'].append(dev_uuid)
|
||||
elif dev_type in ('console',):
|
||||
if 'console_refs' not in target:
|
||||
target['console_refs'] = []
|
||||
@@ -1010,49 +1052,118 @@ class XendConfig(dict):
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vtpm_refs'].append(dev_uuid)
|
||||
|
||||
+ elif dev_type == 'console':
|
||||
+ dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
|
||||
+ dev_info['uuid'] = dev_uuid
|
||||
+ dev_info['protocol'] = cfg_xenapi.get('protocol', 'rfb')
|
||||
+ dev_info['other_config'] = cfg_xenapi.get('other_config', {})
|
||||
+ if dev_info['protocol'] == 'rfb':
|
||||
+ # collapse other config into devinfo for things
|
||||
+ # such as vncpasswd, vncunused, etc.
|
||||
+ dev_info.update(cfg_xenapi.get('other_config', {}))
|
||||
+ dev_info['type'] = 'vnc'
|
||||
+ target['devices'][dev_uuid] = ('vfb', dev_info)
|
||||
+ target['console_refs'].append(dev_uuid)
|
||||
+
|
||||
+ # Finally, if we are a pvfb, we need to make a vkbd
|
||||
+ # as well that is not really exposed to Xen API
|
||||
+ vkbd_uuid = uuid.createString()
|
||||
+ target['devices'][vkbd_uuid] = ('vkbd', {})
|
||||
+
|
||||
+ elif dev_info['protocol'] == 'vt100':
|
||||
+ # if someone tries to create a VT100 console
|
||||
+ # via the Xen API, we'll have to ignore it
|
||||
+ # because we create one automatically in
|
||||
+ # XendDomainInfo._update_consoles
|
||||
+ raise XendConfigError('Creating vt100 consoles via '
|
||||
+ 'Xen API is unsupported')
|
||||
+
|
||||
return dev_uuid
|
||||
|
||||
# no valid device to add
|
||||
return ''
|
||||
|
||||
|
||||
- def console_add(self, protocol, uri):
|
||||
+ def console_add(self, protocol, location, other_config = {}):
|
||||
dev_uuid = uuid.createString()
|
||||
- dev_info = {
|
||||
- 'uuid': dev_uuid,
|
||||
- 'protocol': protocol,
|
||||
- 'uri': uri
|
||||
- }
|
||||
- if 'devices' not in self:
|
||||
- self['devices'] = {}
|
||||
-
|
||||
- self['devices'][dev_uuid] = ('console', dev_info)
|
||||
- self['console_refs'].append(dev_uuid)
|
||||
- return dev_info
|
||||
-
|
||||
+ if protocol == 'vt100':
|
||||
+ dev_info = {
|
||||
+ 'uuid': dev_uuid,
|
||||
+ 'protocol': protocol,
|
||||
+ 'location': location,
|
||||
+ 'other_config': other_config,
|
||||
+ }
|
||||
+
|
||||
+ if 'devices' not in self:
|
||||
+ self['devices'] = {}
|
||||
+
|
||||
+ self['devices'][dev_uuid] = ('console', dev_info)
|
||||
+ self['console_refs'].append(dev_uuid)
|
||||
+ return dev_info
|
||||
+
|
||||
+ return {}
|
||||
+
|
||||
+ def console_update(self, console_uuid, key, value):
|
||||
+ for dev_uuid, (dev_type, dev_info) in self['devices'].items():
|
||||
+ if dev_uuid == console_uuid:
|
||||
+ dev_info[key] = value
|
||||
+ break
|
||||
+
|
||||
def console_get_all(self, protocol):
|
||||
- consoles = [dinfo for dtype, dinfo in self['devices'].values()
|
||||
- if dtype == 'console']
|
||||
- return [c for c in consoles if c.get('protocol') == protocol]
|
||||
+ if protocol == 'vt100':
|
||||
+ consoles = [dinfo for dtype, dinfo in self['devices'].values()
|
||||
+ if dtype == 'console']
|
||||
+ return [c for c in consoles if c.get('protocol') == protocol]
|
||||
+
|
||||
+ elif protocol == 'rfb':
|
||||
+ vfbs = [dinfo for dtype, dinfo in self['devices'].values()
|
||||
+ if dtype == 'vfb']
|
||||
+
|
||||
+ # move all non-console key values to other_config before
|
||||
+ # returning console config
|
||||
+ valid_keys = ['uuid', 'location']
|
||||
+ for vfb in vfbs:
|
||||
+ other_config = {}
|
||||
+ for key, val in vfb.items():
|
||||
+ if key not in valid_keys:
|
||||
+ other_config[key] = vfb[key]
|
||||
+ del vfb[key]
|
||||
+ vfb['other_config'] = other_config
|
||||
+ vfb['protocol'] = 'rfb'
|
||||
+
|
||||
+ return vfbs
|
||||
+
|
||||
+ else:
|
||||
+ return []
|
||||
|
||||
- def device_update(self, dev_uuid, cfg_sxp):
|
||||
- """Update an existing device with the new configuration.
|
||||
+ def device_update(self, dev_uuid, cfg_sxp = [], cfg_xenapi = {}):
|
||||
+ """Update an existing device with the new configuration.
|
||||
|
||||
@rtype: boolean
|
||||
@return: Returns True if succesfully found and updated a device conf
|
||||
"""
|
||||
- if dev_uuid in self['devices']:
|
||||
- config = sxp.child0(cfg_sxp)
|
||||
- dev_type = sxp.name(config)
|
||||
- dev_info = {}
|
||||
+ if dev_uuid in self['devices'] and cfg_sxp:
|
||||
+ if sxp.child0(cfg_sxp) == 'device':
|
||||
+ config = sxp.child0(cfg_sxp)
|
||||
+ else:
|
||||
+ config = cfg_sxp
|
||||
|
||||
- try:
|
||||
- for opt, val in config[1:]:
|
||||
- self['devices'][opt] = val
|
||||
- except ValueError:
|
||||
- pass # SXP has no options for this device
|
||||
-
|
||||
+ dev_type, dev_info = self['devices'][dev_uuid]
|
||||
+ for opt_val in config[1:]:
|
||||
+ try:
|
||||
+ opt, val = opt_val
|
||||
+ dev_info[opt] = val
|
||||
+ except (TypeError, ValueError):
|
||||
+ pass # no value for this config option
|
||||
+
|
||||
+ self['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
return True
|
||||
+
|
||||
+ elif dev_uuid in self['devices'] and cfg_xenapi:
|
||||
+ dev_type, dev_info = self['devices'][dev_uuid]
|
||||
+ for key, val in cfg_xenapi.items():
|
||||
+ dev_info[key] = val
|
||||
+ self['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
|
||||
return False
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendDomainInfo.py
|
||||
@@ -693,16 +693,29 @@ class XendDomainInfo:
|
||||
if not serial_consoles:
|
||||
cfg = self.info.console_add('vt100', self.console_port)
|
||||
self._createDevice('console', cfg)
|
||||
+ else:
|
||||
+ console_uuid = serial_consoles[0].get('uuid')
|
||||
+ self.info.console_update(console_uuid, 'location',
|
||||
+ self.console_port)
|
||||
+
|
||||
|
||||
- # Update VNC port if it exists
|
||||
+ # Update VNC port if it exists and write to xenstore
|
||||
vnc_port = self.readDom('console/vnc-port')
|
||||
if vnc_port is not None:
|
||||
- vnc_consoles = self.info.console_get_all('rfb')
|
||||
- if not vnc_consoles:
|
||||
- cfg = self.info.console_add('rfb', 'localhost:%s' %
|
||||
- str(vnc_port))
|
||||
- self._createDevice('console', cfg)
|
||||
-
|
||||
+ for dev_uuid, (dev_type, dev_info) in self.info['devices'].items():
|
||||
+ if dev_type == 'vfb':
|
||||
+ old_location = dev_info.get('location')
|
||||
+ listen_host = dev_info.get('vnclisten', 'localhost')
|
||||
+ new_location = '%s:%s' % (listen_host, str(vnc_port))
|
||||
+ if old_location == new_location:
|
||||
+ break
|
||||
+
|
||||
+ dev_info['location'] = new_location
|
||||
+ self.info.device_update(dev_uuid, cfg_xenapi = dev_info)
|
||||
+ vfb_ctrl = self.getDeviceController('vfb')
|
||||
+ vfb_ctrl.reconfigureDevice(0, dev_info)
|
||||
+ break
|
||||
+
|
||||
#
|
||||
# Function to update xenstore /vm/*
|
||||
#
|
||||
@@ -1952,21 +1965,18 @@ class XendDomainInfo:
|
||||
|
||||
@rtype: dictionary
|
||||
"""
|
||||
- dev_type_config = self.info['devices'].get(dev_uuid)
|
||||
+ dev_type, dev_config = self.info['devices'].get(dev_uuid, (None, None))
|
||||
|
||||
# shortcut if the domain isn't started because
|
||||
# the devcontrollers will have no better information
|
||||
# than XendConfig.
|
||||
if self.state in (XEN_API_VM_POWER_STATE_HALTED,):
|
||||
- if dev_type_config:
|
||||
- return copy.deepcopy(dev_type_config[1])
|
||||
+ if dev_config:
|
||||
+ return copy.deepcopy(dev_config)
|
||||
return None
|
||||
|
||||
# instead of using dev_class, we use the dev_type
|
||||
# that is from XendConfig.
|
||||
- # This will accomdate 'tap' as well as 'vbd'
|
||||
- dev_type = dev_type_config[0]
|
||||
-
|
||||
controller = self.getDeviceController(dev_type)
|
||||
if not controller:
|
||||
return None
|
||||
@@ -1975,14 +1985,14 @@ class XendDomainInfo:
|
||||
if not all_configs:
|
||||
return None
|
||||
|
||||
- dev_config = copy.deepcopy(dev_type_config[1])
|
||||
+ updated_dev_config = copy.deepcopy(dev_config)
|
||||
for _devid, _devcfg in all_configs.items():
|
||||
if _devcfg.get('uuid') == dev_uuid:
|
||||
- dev_config.update(_devcfg)
|
||||
- dev_config['id'] = _devid
|
||||
- return dev_config
|
||||
+ updated_dev_config.update(_devcfg)
|
||||
+ updated_dev_config['id'] = _devid
|
||||
+ return updated_dev_config
|
||||
|
||||
- return dev_config
|
||||
+ return updated_dev_config
|
||||
|
||||
def get_dev_xenapi_config(self, dev_class, dev_uuid):
|
||||
config = self.get_dev_config_by_uuid(dev_class, dev_uuid)
|
||||
@@ -2137,6 +2147,21 @@ class XendDomainInfo:
|
||||
|
||||
return dev_uuid
|
||||
|
||||
+ def create_console(self, xenapi_console):
|
||||
+ """ Create a console device from a Xen API struct.
|
||||
+
|
||||
+ @return: uuid of device
|
||||
+ @rtype: string
|
||||
+ """
|
||||
+ if self.state not in (DOM_STATE_HALTED,):
|
||||
+ raise VmError("Can only add console to a halted domain.")
|
||||
+
|
||||
+ dev_uuid = self.info.device_add('console', cfg_xenapi = xenapi_console)
|
||||
+ if not dev_uuid:
|
||||
+ raise XendError('Failed to create device')
|
||||
+
|
||||
+ return dev_uuid
|
||||
+
|
||||
def destroy_device_by_uuid(self, dev_type, dev_uuid):
|
||||
if dev_uuid not in self.info['devices']:
|
||||
raise XendError('Device does not exist')
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/image.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/image.py
|
||||
@@ -26,6 +26,7 @@ import xen.lowlevel.xc
|
||||
from xen.xend.XendConstants import REVERSE_DOMAIN_SHUTDOWN_REASONS
|
||||
from xen.xend.XendError import VmError, XendError
|
||||
from xen.xend.XendLogging import log
|
||||
+from xen.xend import XendRoot
|
||||
from xen.xend.server.netif import randomMAC
|
||||
from xen.xend.xenstore.xswatch import xswatch
|
||||
from xen.xend import arch
|
||||
@@ -361,8 +362,6 @@ class HVMImageHandler(ImageHandler):
|
||||
|
||||
self.pid = None
|
||||
|
||||
- self.dmargs += self.configVNC(imageConfig)
|
||||
-
|
||||
self.pae = imageConfig['hvm'].get('pae', 1)
|
||||
self.apic = imageConfig['hvm'].get('apic', 0)
|
||||
self.acpi = imageConfig['hvm']['devices'].get('acpi', 0)
|
||||
@@ -462,49 +461,59 @@ class HVMImageHandler(ImageHandler):
|
||||
net += ",bridge=%s" % (bridge,)
|
||||
ret.append(net)
|
||||
|
||||
- return ret
|
||||
|
||||
- def configVNC(self, imageConfig):
|
||||
- # Handle graphics library related options
|
||||
- vnc = imageConfig.get('vnc')
|
||||
- sdl = imageConfig.get('sdl')
|
||||
- ret = []
|
||||
- nographic = imageConfig.get('nographic')
|
||||
+ #
|
||||
+ # Find RFB console device, and if it exists, make QEMU enable
|
||||
+ # the VNC console.
|
||||
+ #
|
||||
+ if vmConfig['image'].get('nographic'):
|
||||
+ # skip vnc init if nographic is set
|
||||
+ ret.append('-nographic')
|
||||
+ return ret
|
||||
|
||||
- # get password from VM config (if password omitted, None)
|
||||
- vncpasswd_vmconfig = imageConfig.get('vncpasswd')
|
||||
+ vnc_config = {}
|
||||
+ has_vfb = False
|
||||
+ has_vnc = int(vmConfig['image'].get('vnc')) != 0
|
||||
+ for dev_uuid in vmConfig['console_refs']:
|
||||
+ dev_type, dev_info = vmConfig['devices'][devuuid]
|
||||
+ if dev_type == 'rfb':
|
||||
+ vnc_config = dev_info.get('other_config', {})
|
||||
+ has_vfb = True
|
||||
+ break
|
||||
+
|
||||
+ if not vnc_config:
|
||||
+ for key in ('vncunused', 'vnclisten', 'vncdisplay', 'vncpasswd'):
|
||||
+ if key in vmConfig['image']:
|
||||
+ vnc_config[key] = vmConfig['image'][key]
|
||||
|
||||
- if nographic:
|
||||
+ if not has_vfb and not has_vnc:
|
||||
ret.append('-nographic')
|
||||
return ret
|
||||
|
||||
- if vnc:
|
||||
- vncdisplay = imageConfig.get('vncdisplay',
|
||||
- int(self.vm.getDomid()))
|
||||
- vncunused = imageConfig.get('vncunused')
|
||||
-
|
||||
- if vncunused:
|
||||
- ret += ['-vncunused']
|
||||
- else:
|
||||
- ret += ['-vnc', '%d' % vncdisplay]
|
||||
+
|
||||
+ if not vnc_config.get('vncunused', 0) and \
|
||||
+ vnc_config.get('vncdisplay', 0):
|
||||
+ ret.append('-vnc')
|
||||
+ ret.append(str(vncdisplay))
|
||||
+ else:
|
||||
+ ret.append('-vncunused')
|
||||
|
||||
- vnclisten = imageConfig.get('vnclisten')
|
||||
+ vnclisten = vnc_config.get('vnclisten',
|
||||
+ XendRoot.instance().get_vnclisten_address())
|
||||
+ ret.append('-vnclisten')
|
||||
+ ret.append(str(vnclisten))
|
||||
+
|
||||
+ # Store vncpassword in xenstore
|
||||
+ vncpasswd = vnc_config.get('vncpasswd')
|
||||
+ if not vncpasswd:
|
||||
+ vncpasswd = XendRoot.instance().get_vncpasswd_default()
|
||||
+
|
||||
+ if vncpasswd is None:
|
||||
+ raise VmError('vncpasswd is not setup in vmconfig or '
|
||||
+ 'xend-config.sxp')
|
||||
|
||||
- if not(vnclisten):
|
||||
- vnclisten = (xen.xend.XendRoot.instance().
|
||||
- get_vnclisten_address())
|
||||
- if vnclisten:
|
||||
- ret += ['-vnclisten', vnclisten]
|
||||
-
|
||||
- vncpasswd = vncpasswd_vmconfig
|
||||
- if vncpasswd is None:
|
||||
- vncpasswd = (xen.xend.XendRoot.instance().
|
||||
- get_vncpasswd_default())
|
||||
- if vncpasswd is None:
|
||||
- raise VmError('vncpasswd is not set up in ' +
|
||||
- 'VMconfig and xend-config.')
|
||||
- if vncpasswd != '':
|
||||
- self.vm.storeVm("vncpasswd", vncpasswd)
|
||||
+ if vncpasswd != '':
|
||||
+ self.vm.storeVm('vncpasswd', vncpasswd)
|
||||
|
||||
return ret
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/server/ConsoleController.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/server/ConsoleController.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/server/ConsoleController.py
|
||||
@@ -8,7 +8,7 @@ class ConsoleController(DevController):
|
||||
console devices with persistent UUIDs.
|
||||
"""
|
||||
|
||||
- valid_cfg = ['uri', 'uuid', 'protocol']
|
||||
+ valid_cfg = ['location', 'uuid', 'protocol']
|
||||
|
||||
def __init__(self, vm):
|
||||
DevController.__init__(self, vm)
|
||||
@@ -29,3 +29,7 @@ class ConsoleController(DevController):
|
||||
|
||||
def migrate(self, deviceConfig, network, dst, step, domName):
|
||||
return 0
|
||||
+
|
||||
+ def destroyDevice(self, devid, force):
|
||||
+ DevController.destroyDevice(self, devid, True)
|
||||
+
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/server/vfbif.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/server/vfbif.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/server/vfbif.py
|
||||
@@ -14,7 +14,9 @@ def spawn_detached(path, args, env):
|
||||
os.waitpid(p, 0)
|
||||
|
||||
CONFIG_ENTRIES = ['type', 'vncdisplay', 'vnclisten', 'vncpasswd', 'vncunused',
|
||||
- 'display', 'xauthority']
|
||||
+ 'display', 'xauthority', 'keymap',
|
||||
+ 'uuid', 'location', 'protocol']
|
||||
+
|
||||
|
||||
class VfbifController(DevController):
|
||||
"""Virtual frame buffer controller. Handles all vfb devices for a domain.
|
||||
@@ -27,10 +29,11 @@ class VfbifController(DevController):
|
||||
def getDeviceDetails(self, config):
|
||||
"""@see DevController.getDeviceDetails"""
|
||||
|
||||
- back = dict([(k, config[k]) for k in CONFIG_ENTRIES
|
||||
+ back = dict([(k, str(config[k])) for k in CONFIG_ENTRIES
|
||||
if config.has_key(k)])
|
||||
|
||||
- return (0, back, {})
|
||||
+ devid = 0
|
||||
+ return (devid, back, {})
|
||||
|
||||
|
||||
def getDeviceConfiguration(self, devid):
|
||||
@@ -44,6 +47,10 @@ class VfbifController(DevController):
|
||||
|
||||
def createDevice(self, config):
|
||||
DevController.createDevice(self, config)
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ # is HVM, so qemu-dm will handle the vfb.
|
||||
+ return
|
||||
+
|
||||
std_args = [ "--domid", "%d" % self.vm.getDomid(),
|
||||
"--title", self.vm.getName() ]
|
||||
t = config.get("type", None)
|
||||
@@ -80,6 +87,42 @@ class VfbifController(DevController):
|
||||
else:
|
||||
raise VmError('Unknown vfb type %s (%s)' % (t, repr(config)))
|
||||
|
||||
+
|
||||
+ def waitForDevice(self, devid):
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ log.debug('skip waiting for HVM vfb')
|
||||
+ # is a qemu-dm managed device, don't wait for hotplug for these.
|
||||
+ return
|
||||
+
|
||||
+ DevController.waitForDevice(self, devid)
|
||||
+
|
||||
+
|
||||
+ def reconfigureDevice(self, _, config):
|
||||
+ """ Only allow appending location information of vnc port into
|
||||
+ xenstore."""
|
||||
+
|
||||
+ if 'location' in config:
|
||||
+ (devid, back, front) = self.getDeviceDetails(config)
|
||||
+ self.writeBackend(devid, 'location', config['location'])
|
||||
+ return back.get('uuid')
|
||||
+
|
||||
+ raise VmError('Refusing to reconfigure device vfb:%d' % devid)
|
||||
+
|
||||
+ def destroyDevice(self, devid, force):
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ # remove the backend xenstore entries for HVM guests no matter
|
||||
+ # what
|
||||
+ DevController.destroyDevice(self, devid, True)
|
||||
+ else:
|
||||
+ DevController.destroyDevice(self, devid, force)
|
||||
+
|
||||
+
|
||||
+ def migrate(self, deviceConfig, network, dst, step, domName):
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ return 0
|
||||
+ return DevController.migrate(self, deviceConfig, network, dst, step,
|
||||
+ domName)
|
||||
+
|
||||
class VkbdifController(DevController):
|
||||
"""Virtual keyboard controller. Handles all vkbd devices for a domain.
|
||||
"""
|
||||
@@ -90,3 +133,24 @@ class VkbdifController(DevController):
|
||||
back = {}
|
||||
front = {}
|
||||
return (devid, back, front)
|
||||
+
|
||||
+ def waitForDevice(self, config):
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ # is a qemu-dm managed device, don't wait for hotplug for these.
|
||||
+ return
|
||||
+
|
||||
+ DevController.waitForDevice(self, config)
|
||||
+
|
||||
+ def destroyDevice(self, devid, force):
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ # remove the backend xenstore entries for HVM guests no matter
|
||||
+ # what
|
||||
+ DevController.destroyDevice(self, devid, True)
|
||||
+ else:
|
||||
+ DevController.destroyDevice(self, devid, force)
|
||||
+
|
||||
+ def migrate(self, deviceConfig, network, dst, step, domName):
|
||||
+ if self.vm.info.get('HVM_boot'):
|
||||
+ return 0
|
||||
+ return DevController.migrate(self, deviceConfig, network, dst, step,
|
||||
+ domName)
|
27
13747_xenapi.patch
Normal file
27
13747_xenapi.patch
Normal file
@ -0,0 +1,27 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1170255740 0
|
||||
# Node ID dfa9e5565063455d96b78a84c22e6e6b607d9f4a
|
||||
# Parent f63e1244b48dd6d8c064f4ed38b7d7cf2bdf62ee
|
||||
[XEND] Hide other_config from console and vfb SXP to prevent string
|
||||
representation of dict to appear in SXP.
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
diff -r f63e1244b48d -r dfa9e5565063 tools/python/xen/xend/XendConfig.py
|
||||
--- a/tools/python/xen/xend/XendConfig.py Wed Jan 31 15:01:09 2007 +0000
|
||||
+++ b/tools/python/xen/xend/XendConfig.py Wed Jan 31 15:02:20 2007 +0000
|
||||
@@ -1223,7 +1223,12 @@ class XendConfig(dict):
|
||||
"configuration dictionary.")
|
||||
|
||||
sxpr.append(dev_type)
|
||||
- config = [(opt, val) for opt, val in dev_info.items()]
|
||||
+ if dev_type in ('console', 'vfb'):
|
||||
+ config = [(opt, val) for opt, val in dev_info.items()
|
||||
+ if opt != 'other_config']
|
||||
+ else:
|
||||
+ config = [(opt, val) for opt, val in dev_info.items()]
|
||||
+
|
||||
sxpr += config
|
||||
|
||||
return sxpr
|
26
13753_xenapi.patch
Normal file
26
13753_xenapi.patch
Normal file
@ -0,0 +1,26 @@
|
||||
# HG changeset patch
|
||||
# User Alastair Tse <atse@xensource.com>
|
||||
# Date 1170256953 0
|
||||
# Node ID 3db881ef97c44dbe749c7b3e7679f97dd959262d
|
||||
# Parent beb0b36de1560f5a0094461063e48fa659398a0f
|
||||
[XEND] Fix typos in vfb/vnc detect in image.py
|
||||
|
||||
Signed-off-by: Alastair Tse <atse@xensource.com>
|
||||
|
||||
diff -r beb0b36de156 -r 3db881ef97c4 tools/python/xen/xend/image.py
|
||||
--- a/tools/python/xen/xend/image.py Wed Jan 31 15:08:29 2007 +0000
|
||||
+++ b/tools/python/xen/xend/image.py Wed Jan 31 15:22:33 2007 +0000
|
||||
@@ -450,10 +450,10 @@ class HVMImageHandler(ImageHandler):
|
||||
|
||||
vnc_config = {}
|
||||
has_vfb = False
|
||||
- has_vnc = int(vmConfig['image'].get('vnc')) != 0
|
||||
+ has_vnc = int(vmConfig['image'].get('vnc', 0)) != 0
|
||||
for dev_uuid in vmConfig['console_refs']:
|
||||
- dev_type, dev_info = vmConfig['devices'][devuuid]
|
||||
- if dev_type == 'rfb':
|
||||
+ dev_type, dev_info = vmConfig['devices'][dev_uuid]
|
||||
+ if dev_type == 'vfb':
|
||||
vnc_config = dev_info.get('other_config', {})
|
||||
has_vfb = True
|
||||
break
|
24
13775_xenapi.patch
Normal file
24
13775_xenapi.patch
Normal file
@ -0,0 +1,24 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170343822 0
|
||||
# Node ID 868babf6b1dd2b196de7fea6a158365a0e63675c
|
||||
# Parent d34d43fb88ae23e78ea90048d6c20a7255193836
|
||||
Fix HVM save/restore wrt console handling.
|
||||
|
||||
From Tim Deegan <Tim.Deegan@xensource.com>.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r d34d43fb88ae -r 868babf6b1dd tools/python/xen/xend/XendConfig.py
|
||||
--- a/tools/python/xen/xend/XendConfig.py Thu Feb 01 15:03:55 2007 +0000
|
||||
+++ b/tools/python/xen/xend/XendConfig.py Thu Feb 01 15:30:22 2007 +0000
|
||||
@@ -679,6 +679,9 @@ class XendConfig(dict):
|
||||
if self['devices'][console_uuid][1].get('protocol') == 'rfb':
|
||||
has_rfb = True
|
||||
break
|
||||
+ if self['devices'][console_uuid][0] == 'vfb':
|
||||
+ has_rfb = True
|
||||
+ break
|
||||
|
||||
if not has_rfb:
|
||||
dev_config = ['vfb']
|
41
13777_xenapi.patch
Normal file
41
13777_xenapi.patch
Normal file
@ -0,0 +1,41 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170343936 0
|
||||
# Node ID 1fb0302683d34317d363f5e7b627fb432f1ac19e
|
||||
# Parent 2b4b07391df2d63dc419701099b04f8a0c202111
|
||||
Fix handling of HVM boot.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/XendConfig.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
@@ -707,6 +707,7 @@ class XendConfig(dict):
|
||||
val = sxp.child_value(image_sxp, imgkey, None)
|
||||
if val != None:
|
||||
self[apikey] = val
|
||||
+ self._hvm_boot_params_from_sxp(image_sxp)
|
||||
|
||||
# extract backend value
|
||||
|
||||
@@ -1310,11 +1311,18 @@ class XendConfig(dict):
|
||||
val = sxp.child_value(image_sxp, imgkey, None)
|
||||
if val != None:
|
||||
type_conv = XENAPI_CFG_TYPES[apikey]
|
||||
- if callable(conv):
|
||||
+ if callable(type_conv):
|
||||
self[apikey] = type_conv(val)
|
||||
else:
|
||||
self[apikey] = val
|
||||
+ self._hvm_boot_params_from_sxp(image_sxp)
|
||||
|
||||
+
|
||||
+ def _hvm_boot_params_from_sxp(self, image_sxp):
|
||||
+ boot = sxp.child_value(image_sxp, 'boot', None)
|
||||
+ if boot is not None:
|
||||
+ self['HVM_boot_policy'] = 'BIOS order'
|
||||
+ self['HVM_boot_params'] = { 'order' : boot }
|
||||
|
||||
#
|
||||
# debugging
|
98
13778_xenapi.patch
Normal file
98
13778_xenapi.patch
Normal file
@ -0,0 +1,98 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170344640 0
|
||||
# Node ID f84ba62ca615e67f297820455c76f4a061e32490
|
||||
# Parent 1fb0302683d34317d363f5e7b627fb432f1ac19e
|
||||
Fix SDL option for HVM domains.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
Index: xen-3.0.4-testing/tools/python/xen/xend/image.py
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/tools/python/xen/xend/image.py
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/image.py
|
||||
@@ -472,48 +472,50 @@ class HVMImageHandler(ImageHandler):
|
||||
return ret
|
||||
|
||||
vnc_config = {}
|
||||
- has_vfb = False
|
||||
has_vnc = int(vmConfig['image'].get('vnc', 0)) != 0
|
||||
+ has_sdl = int(vmConfig['image'].get('sdl', 0)) != 0
|
||||
for dev_uuid in vmConfig['console_refs']:
|
||||
dev_type, dev_info = vmConfig['devices'][dev_uuid]
|
||||
if dev_type == 'vfb':
|
||||
vnc_config = dev_info.get('other_config', {})
|
||||
- has_vfb = True
|
||||
+ has_vnc = True
|
||||
break
|
||||
|
||||
- if not vnc_config:
|
||||
- for key in ('vncunused', 'vnclisten', 'vncdisplay', 'vncpasswd'):
|
||||
- if key in vmConfig['image']:
|
||||
- vnc_config[key] = vmConfig['image'][key]
|
||||
-
|
||||
- if not has_vfb and not has_vnc:
|
||||
- ret.append('-nographic')
|
||||
- return ret
|
||||
-
|
||||
-
|
||||
- if not vnc_config.get('vncunused', 0) and \
|
||||
- vnc_config.get('vncdisplay', 0):
|
||||
- ret.append('-vnc')
|
||||
- ret.append(str(vncdisplay))
|
||||
+ if has_vnc:
|
||||
+ if not vnc_config:
|
||||
+ for key in ('vncunused', 'vnclisten', 'vncdisplay',
|
||||
+ 'vncpasswd'):
|
||||
+ if key in vmConfig['image']:
|
||||
+ vnc_config[key] = vmConfig['image'][key]
|
||||
+
|
||||
+ if not vnc_config.get('vncunused', 0) and \
|
||||
+ vnc_config.get('vncdisplay', 0):
|
||||
+ ret.append('-vnc')
|
||||
+ ret.append(str(vncdisplay))
|
||||
+ else:
|
||||
+ ret.append('-vncunused')
|
||||
+
|
||||
+ vnclisten = vnc_config.get('vnclisten',
|
||||
+ XendRoot.instance().get_vnclisten_address())
|
||||
+ ret.append('-vnclisten')
|
||||
+ ret.append(str(vnclisten))
|
||||
+
|
||||
+ # Store vncpassword in xenstore
|
||||
+ vncpasswd = vnc_config.get('vncpasswd')
|
||||
+ if not vncpasswd:
|
||||
+ vncpasswd = XendRoot.instance().get_vncpasswd_default()
|
||||
+
|
||||
+ if vncpasswd is None:
|
||||
+ raise VmError('vncpasswd is not setup in vmconfig or '
|
||||
+ 'xend-config.sxp')
|
||||
+
|
||||
+ if vncpasswd != '':
|
||||
+ self.vm.storeVm('vncpasswd', vncpasswd)
|
||||
+ elif has_sdl:
|
||||
+ # SDL is default in QEMU.
|
||||
+ pass
|
||||
else:
|
||||
- ret.append('-vncunused')
|
||||
-
|
||||
- vnclisten = vnc_config.get('vnclisten',
|
||||
- XendRoot.instance().get_vnclisten_address())
|
||||
- ret.append('-vnclisten')
|
||||
- ret.append(str(vnclisten))
|
||||
-
|
||||
- # Store vncpassword in xenstore
|
||||
- vncpasswd = vnc_config.get('vncpasswd')
|
||||
- if not vncpasswd:
|
||||
- vncpasswd = XendRoot.instance().get_vncpasswd_default()
|
||||
-
|
||||
- if vncpasswd is None:
|
||||
- raise VmError('vncpasswd is not setup in vmconfig or '
|
||||
- 'xend-config.sxp')
|
||||
-
|
||||
- if vncpasswd != '':
|
||||
- self.vm.storeVm('vncpasswd', vncpasswd)
|
||||
+ ret.append('-nographic')
|
||||
|
||||
return ret
|
||||
|
131
13784_xenapi.patch
Normal file
131
13784_xenapi.patch
Normal file
@ -0,0 +1,131 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170353736 0
|
||||
# Node ID e0b7ab2a1d5677ba95a3f2c29eb083fc248357e2
|
||||
# Parent b32a44bfb10ccd23cd6ac71883cea65fb4c7b1a0
|
||||
Treat the empty string as an absent UUID, not an invalid one. Fix to_sxp
|
||||
wrt dictionaries.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r b32a44bfb10c -r e0b7ab2a1d56 tools/python/xen/xend/XendConfig.py
|
||||
--- a/tools/python/xen/xend/XendConfig.py Thu Feb 01 18:14:40 2007 +0000
|
||||
+++ b/tools/python/xen/xend/XendConfig.py Thu Feb 01 18:15:36 2007 +0000
|
||||
@@ -349,7 +349,6 @@ class XendConfig(dict):
|
||||
|
||||
def _defaults(self):
|
||||
defaults = {
|
||||
- 'uuid': uuid.createString(),
|
||||
'name_label': 'Domain-Unnamed',
|
||||
'actions_after_shutdown': 'destroy',
|
||||
'actions_after_reboot': 'restart',
|
||||
@@ -385,7 +384,6 @@ class XendConfig(dict):
|
||||
'other_config': {},
|
||||
}
|
||||
|
||||
- defaults['name_label'] = 'Domain-' + defaults['uuid']
|
||||
return defaults
|
||||
|
||||
def _memory_sanity_check(self):
|
||||
@@ -415,13 +413,21 @@ class XendConfig(dict):
|
||||
|
||||
def _uuid_sanity_check(self):
|
||||
"""Make sure UUID is in proper string format with hyphens."""
|
||||
- self['uuid'] = uuid.toString(uuid.fromString(self['uuid']))
|
||||
+ if 'uuid' not in self or not self['uuid']:
|
||||
+ self['uuid'] = uuid.createString()
|
||||
+ else:
|
||||
+ self['uuid'] = uuid.toString(uuid.fromString(self['uuid']))
|
||||
+
|
||||
+ def _name_sanity_check(self):
|
||||
+ if 'name_label' not in self:
|
||||
+ self['name_label'] = 'Domain-' + self['uuid']
|
||||
|
||||
def validate(self):
|
||||
+ self._uuid_sanity_check()
|
||||
+ self._name_sanity_check()
|
||||
self._memory_sanity_check()
|
||||
self._actions_sanity_check()
|
||||
self._vcpus_sanity_check()
|
||||
- self._uuid_sanity_check()
|
||||
|
||||
def _dominfo_to_xapi(self, dominfo):
|
||||
self['domid'] = dominfo['domid']
|
||||
@@ -840,8 +846,6 @@ class XendConfig(dict):
|
||||
else:
|
||||
self[key] = val
|
||||
|
||||
- self.validate()
|
||||
-
|
||||
def to_sxp(self, domain = None, ignore_devices = False, ignore = [],
|
||||
legacy_only = True):
|
||||
""" Get SXP representation of this config object.
|
||||
@@ -865,9 +869,13 @@ class XendConfig(dict):
|
||||
sxpr.append(['domid', domain.getDomid()])
|
||||
|
||||
if not legacy_only:
|
||||
- for name in XENAPI_CFG_TYPES.keys():
|
||||
+ for name, typ in XENAPI_CFG_TYPES.items():
|
||||
if name in self and self[name] not in (None, []):
|
||||
- sxpr.append([name, str(self[name])])
|
||||
+ if typ == dict:
|
||||
+ s = self[name].items()
|
||||
+ else:
|
||||
+ s = str(self[name])
|
||||
+ sxpr.append([name, s])
|
||||
|
||||
for xenapi, legacy in XENAPI_CFG_TO_LEGACY_CFG.items():
|
||||
if self.has_key(xenapi) and self[xenapi] not in (None, []):
|
||||
@@ -996,7 +1004,9 @@ class XendConfig(dict):
|
||||
dev_info['driver'] = 'paravirtualised'
|
||||
|
||||
# create uuid if it doesn't exist
|
||||
- dev_uuid = dev_info.get('uuid', uuid.createString())
|
||||
+ dev_uuid = dev_info.get('uuid', None)
|
||||
+ if not dev_uuid:
|
||||
+ dev_uuid = uuid.createString()
|
||||
dev_info['uuid'] = dev_uuid
|
||||
|
||||
# store dev references by uuid for certain device types
|
||||
@@ -1066,7 +1076,9 @@ class XendConfig(dict):
|
||||
if cfg_xenapi.get('name'):
|
||||
dev_info['name'] = cfg_xenapi.get('name')
|
||||
|
||||
- dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
|
||||
+ dev_uuid = cfg_xenapi.get('uuid', None)
|
||||
+ if not dev_uuid:
|
||||
+ dev_uuid = uuid.createString()
|
||||
dev_info['uuid'] = dev_uuid
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vif_refs'].append(dev_uuid)
|
||||
@@ -1090,7 +1102,9 @@ class XendConfig(dict):
|
||||
else:
|
||||
dev_info['mode'] = 'r'
|
||||
|
||||
- dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
|
||||
+ dev_uuid = cfg_xenapi.get('uuid', None)
|
||||
+ if not dev_uuid:
|
||||
+ dev_uuid = uuid.createString()
|
||||
dev_info['uuid'] = dev_uuid
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vbd_refs'].append(dev_uuid)
|
||||
@@ -1099,13 +1113,17 @@ class XendConfig(dict):
|
||||
if cfg_xenapi.get('type'):
|
||||
dev_info['type'] = cfg_xenapi.get('type')
|
||||
|
||||
- dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
|
||||
+ dev_uuid = cfg_xenapi.get('uuid', None)
|
||||
+ if not dev_uuid:
|
||||
+ dev_uuid = uuid.createString()
|
||||
dev_info['uuid'] = dev_uuid
|
||||
target['devices'][dev_uuid] = (dev_type, dev_info)
|
||||
target['vtpm_refs'].append(dev_uuid)
|
||||
|
||||
elif dev_type == 'console':
|
||||
- dev_uuid = cfg_xenapi.get('uuid', uuid.createString())
|
||||
+ dev_uuid = cfg_xenapi.get('uuid', None)
|
||||
+ if not dev_uuid:
|
||||
+ dev_uuid = uuid.createString()
|
||||
dev_info['uuid'] = dev_uuid
|
||||
dev_info['protocol'] = cfg_xenapi.get('protocol', 'rfb')
|
||||
dev_info['other_config'] = cfg_xenapi.get('other_config', {})
|
215
13787_xenapi.patch
Normal file
215
13787_xenapi.patch
Normal file
@ -0,0 +1,215 @@
|
||||
# HG changeset patch
|
||||
# User Ewan Mellor <ewan@xensource.com>
|
||||
# Date 1170356533 0
|
||||
# Node ID 0fb5df09de9426b9144eabc0d9a93c0bbfe14070
|
||||
# Parent a357bed2daf8096bb5c682d454a2b3af652fc73f
|
||||
Added support for maps inside structs, so that we can send the HVM boot params
|
||||
and VCPU params.
|
||||
|
||||
Signed-off-by: Ewan Mellor <ewan@xensource.com>
|
||||
|
||||
diff -r a357bed2daf8 -r 0fb5df09de94 tools/libxen/src/xen_common.c
|
||||
--- a/tools/libxen/src/xen_common.c Thu Feb 01 19:00:17 2007 +0000
|
||||
+++ b/tools/libxen/src/xen_common.c Thu Feb 01 19:02:13 2007 +0000
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- * Copyright (c) 2006 XenSource, Inc.
|
||||
+ * Copyright (c) 2006-2007 XenSource, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -86,6 +86,8 @@ add_param_struct(xmlNode *);
|
||||
add_param_struct(xmlNode *);
|
||||
static xmlNode *
|
||||
add_struct_array(xmlNode *, const char *);
|
||||
+static xmlNode *
|
||||
+add_nested_struct(xmlNode *, const char *);
|
||||
static void
|
||||
add_struct_member(xmlNode *, const char *, const char *, const char *);
|
||||
static void
|
||||
@@ -106,6 +108,9 @@ parse_structmap_value(xen_session *, xml
|
||||
void *);
|
||||
|
||||
static size_t size_of_member(const abstract_type *);
|
||||
+
|
||||
+static const char *
|
||||
+get_val_as_string(const struct abstract_type *, void *, char *);
|
||||
|
||||
|
||||
void
|
||||
@@ -1174,37 +1179,12 @@ add_struct_value(const struct abstract_t
|
||||
switch (type->typename)
|
||||
{
|
||||
case REF:
|
||||
- {
|
||||
- arbitrary_record_opt *val = *(arbitrary_record_opt **)value;
|
||||
- if (val != NULL)
|
||||
- {
|
||||
- if (val->is_record)
|
||||
- {
|
||||
- adder(node, key, "string", val->u.record->handle);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- adder(node, key, "string", val->u.handle);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
case STRING:
|
||||
- {
|
||||
- char *val = *(char **)value;
|
||||
- if (val != NULL)
|
||||
- {
|
||||
- adder(node, key, "string", val);
|
||||
- }
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
case INT:
|
||||
- {
|
||||
- int64_t val = *(int64_t *)value;
|
||||
- snprintf(buf, sizeof(buf), "%"PRId64, val);
|
||||
- adder(node, key, "string", buf);
|
||||
+ case ENUM:
|
||||
+ {
|
||||
+ const char *val_as_string = get_val_as_string(type, value, buf);
|
||||
+ adder(node, key, "string", val_as_string);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1220,13 +1200,6 @@ add_struct_value(const struct abstract_t
|
||||
{
|
||||
bool val = *(bool *)value;
|
||||
adder(node, key, "boolean", val ? "1" : "0");
|
||||
- }
|
||||
- break;
|
||||
-
|
||||
- case ENUM:
|
||||
- {
|
||||
- int val = *(int *)value;
|
||||
- adder(node, key, "string", type->enum_marshaller(val));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1251,12 +1224,95 @@ add_struct_value(const struct abstract_t
|
||||
break;
|
||||
|
||||
case STRUCT:
|
||||
- case MAP:
|
||||
- {
|
||||
+ {
|
||||
+ assert(false);
|
||||
/* XXX Nested structures aren't supported yet, but
|
||||
fortunately we don't need them, because we don't have
|
||||
any "deep create" calls. This will need to be
|
||||
- fixed. We don't need maps either. */
|
||||
+ fixed. */
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case MAP:
|
||||
+ {
|
||||
+ size_t member_size = type->struct_size;
|
||||
+ const struct abstract_type *l_type = type->members[0].type;
|
||||
+ const struct abstract_type *r_type = type->members[1].type;
|
||||
+ int l_offset = type->members[0].offset;
|
||||
+ int r_offset = type->members[1].offset;
|
||||
+
|
||||
+ arbitrary_map *map_val = *(arbitrary_map **)value;
|
||||
+
|
||||
+ if (map_val != NULL)
|
||||
+ {
|
||||
+ xmlNode *struct_node = add_nested_struct(node, key);
|
||||
+
|
||||
+ for (size_t i = 0; i < map_val->size; i++)
|
||||
+ {
|
||||
+ void *contents = (void *)map_val->contents;
|
||||
+ void *l_value = contents + (i * member_size) + l_offset;
|
||||
+ void *r_value = contents + (i * member_size) + r_offset;
|
||||
+
|
||||
+ const char *l_value_as_string =
|
||||
+ get_val_as_string(l_type, l_value, buf);
|
||||
+
|
||||
+ add_struct_value(r_type, r_value, add_struct_member,
|
||||
+ l_value_as_string, struct_node);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ assert(false);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static const char *
|
||||
+get_val_as_string(const struct abstract_type *type, void *value, char *buf)
|
||||
+{
|
||||
+ switch (type->typename)
|
||||
+ {
|
||||
+ case REF:
|
||||
+ {
|
||||
+ arbitrary_record_opt *val = *(arbitrary_record_opt **)value;
|
||||
+ if (val != NULL)
|
||||
+ {
|
||||
+ if (val->is_record)
|
||||
+ {
|
||||
+ return val->u.record->handle;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return val->u.handle;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case STRING:
|
||||
+ {
|
||||
+ return *(char **)value;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case INT:
|
||||
+ {
|
||||
+ int64_t val = *(int64_t *)value;
|
||||
+ snprintf(buf, sizeof(buf), "%"PRId64, val);
|
||||
+ return buf;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case ENUM:
|
||||
+ {
|
||||
+ int val = *(int *)value;
|
||||
+ return type->enum_marshaller(val);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1331,7 +1387,19 @@ add_struct_array(xmlNode *struct_node, c
|
||||
xmlNode *array_node = add_container(value_node, "array");
|
||||
|
||||
return add_container(array_node, "data");
|
||||
-
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static xmlNode *
|
||||
+add_nested_struct(xmlNode *struct_node, const char *name)
|
||||
+{
|
||||
+ xmlNode *member_node = add_container(struct_node, "member");
|
||||
+
|
||||
+ xmlNewChild(member_node, NULL, BAD_CAST "name", BAD_CAST name);
|
||||
+
|
||||
+ xmlNode *value_node = add_container(member_node, "value");
|
||||
+
|
||||
+ return add_container(value_node, "struct");
|
||||
}
|
||||
|
||||
|
28
13903-domctl.patch
Normal file
28
13903-domctl.patch
Normal file
@ -0,0 +1,28 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1171456536 0
|
||||
# Node ID 929868cd37150106c4235657c959ac3376e95aa2
|
||||
# Parent d08c2af538045c16366ab5e5e99e1c4bd01f8223
|
||||
Add missing breaks to {set,get}_address_size domctls.
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
|
||||
|
||||
Index: xen-3.0.4-testing/xen/arch/x86/domctl.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/xen/arch/x86/domctl.c
|
||||
+++ xen-3.0.4-testing/xen/arch/x86/domctl.c
|
||||
@@ -318,6 +318,7 @@ _long arch_do_domctl(
|
||||
|
||||
put_domain(d);
|
||||
}
|
||||
+ break;
|
||||
|
||||
case XEN_DOMCTL_get_address_size:
|
||||
{
|
||||
@@ -332,6 +333,7 @@ _long arch_do_domctl(
|
||||
ret = 0;
|
||||
put_domain(d);
|
||||
}
|
||||
+ break;
|
||||
|
||||
default:
|
||||
ret = -ENOSYS;
|
22
13908-domctl.patch
Normal file
22
13908-domctl.patch
Normal file
@ -0,0 +1,22 @@
|
||||
# HG changeset patch
|
||||
# User kfraser@localhost.localdomain
|
||||
# Date 1171468487 0
|
||||
# Node ID d44eb9e7f97b05d648dc8b0d614ffb32df667354
|
||||
# Parent 6fd71faaaa3b00250d65879750e4350b79bf0060
|
||||
Another domctl fix to insert missing copy_to_guest.
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
|
||||
|
||||
Index: xen-3.0.4-testing/xen/arch/x86/domctl.c
|
||||
===================================================================
|
||||
--- xen-3.0.4-testing.orig/xen/arch/x86/domctl.c
|
||||
+++ xen-3.0.4-testing/xen/arch/x86/domctl.c
|
||||
@@ -332,6 +332,9 @@ _long arch_do_domctl(
|
||||
|
||||
ret = 0;
|
||||
put_domain(d);
|
||||
+
|
||||
+ if ( copy_to_guest(u_domctl, domctl, 1) )
|
||||
+ ret = -EFAULT;
|
||||
}
|
||||
break;
|
||||
|
@ -100,9 +100,11 @@ case "$1" in
|
||||
# - netloop at network-bridge init time
|
||||
# - netbk and blkbk when the dom0 hotplug events occur
|
||||
# (in xen-network-common.sh and block-common.sh)
|
||||
# - xenblk when xend prepares for bootloader
|
||||
# but for now it's safest to have them loaded when xend starts in dom0.
|
||||
modprobe blktap 2>/dev/null || true
|
||||
modprobe blkbk 2>/dev/null || true
|
||||
modprobe xenblk 2>/dev/null || true
|
||||
modprobe netloop 2>/dev/null || true
|
||||
modprobe netbk 2>/dev/null || true
|
||||
xend start
|
||||
|
15
libelf-dominfo.diff
Normal file
15
libelf-dominfo.diff
Normal file
@ -0,0 +1,15 @@
|
||||
diff -r ad9bbd103034 xen/common/libelf/libelf-dominfo.c
|
||||
--- a/xen/common/libelf/libelf-dominfo.c Fri Feb 09 18:19:24 2007 +0000
|
||||
+++ b/xen/common/libelf/libelf-dominfo.c Mon Feb 12 15:05:11 2007 +0100
|
||||
@@ -107,9 +107,9 @@ int elf_xen_parse_note(struct elf_binary
|
||||
if ((type >= sizeof(note_desc) / sizeof(note_desc[0])) ||
|
||||
(NULL == note_desc[type].name))
|
||||
{
|
||||
- elf_err(elf, "%s: unknown xen elf note (0x%x)\n",
|
||||
+ elf_msg(elf, "%s: unknown xen elf note (0x%x)\n",
|
||||
__FUNCTION__, type);
|
||||
- return -1;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
if (note_desc[type].str)
|
@ -1,111 +0,0 @@
|
||||
debug: log libxc output to /var/log/xen/libxc.log
|
||||
|
||||
sledge hammer patch ;)
|
||||
---
|
||||
tools/libxc/xc_dom_compat_linux.c | 2 ++
|
||||
tools/libxc/xc_hvm_build.c | 2 ++
|
||||
tools/libxc/xc_linux_build.c | 2 ++
|
||||
tools/libxc/xc_private.c | 9 +++++++++
|
||||
tools/libxc/xc_private.h | 11 +++++++----
|
||||
5 files changed, 22 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: build-64-release304-13087/tools/libxc/xc_hvm_build.c
|
||||
===================================================================
|
||||
--- build-64-release304-13087.orig/tools/libxc/xc_hvm_build.c
|
||||
+++ build-64-release304-13087/tools/libxc/xc_hvm_build.c
|
||||
@@ -310,6 +310,8 @@ static int xc_hvm_build_internal(int xc_
|
||||
vcpu_guest_context_t ctxt;
|
||||
int rc;
|
||||
|
||||
+ log_kraxel();
|
||||
+
|
||||
if ( (image == NULL) || (image_size == 0) )
|
||||
{
|
||||
ERROR("Image required");
|
||||
Index: build-64-release304-13087/tools/libxc/xc_linux_build.c
|
||||
===================================================================
|
||||
--- build-64-release304-13087.orig/tools/libxc/xc_linux_build.c
|
||||
+++ build-64-release304-13087/tools/libxc/xc_linux_build.c
|
||||
@@ -1099,6 +1099,8 @@ static int xc_linux_build_internal(int x
|
||||
unsigned long vstartinfo_start, vkern_entry, vstack_start;
|
||||
uint32_t features_bitmap[XENFEAT_NR_SUBMAPS] = { 0, };
|
||||
|
||||
+ log_kraxel();
|
||||
+
|
||||
if ( features != NULL )
|
||||
{
|
||||
if ( !parse_features(features, features_bitmap, NULL) )
|
||||
Index: build-64-release304-13087/tools/libxc/xc_private.c
|
||||
===================================================================
|
||||
--- build-64-release304-13087.orig/tools/libxc/xc_private.c
|
||||
+++ build-64-release304-13087/tools/libxc/xc_private.c
|
||||
@@ -88,6 +88,15 @@ void xc_set_error(int code, const char *
|
||||
error_handler(&last_error);
|
||||
}
|
||||
|
||||
+FILE *kraxel;
|
||||
+
|
||||
+void log_kraxel(void)
|
||||
+{
|
||||
+ kraxel = fopen("/var/log/xen/libxc.log", "a");
|
||||
+ setvbuf(kraxel, NULL, _IONBF, 0);
|
||||
+ fprintf(kraxel, "--- started ---\n");
|
||||
+}
|
||||
+
|
||||
int lock_pages(void *addr, size_t len)
|
||||
{
|
||||
int e = 0;
|
||||
Index: build-64-release304-13087/tools/libxc/xc_private.h
|
||||
===================================================================
|
||||
--- build-64-release304-13087.orig/tools/libxc/xc_private.h
|
||||
+++ build-64-release304-13087/tools/libxc/xc_private.h
|
||||
@@ -39,22 +39,25 @@
|
||||
|
||||
#define DEBUG 1
|
||||
#define INFO 1
|
||||
-#define PROGRESS 0
|
||||
+#define PROGRESS 1
|
||||
+
|
||||
+extern FILE *kraxel;
|
||||
+void log_kraxel(void);
|
||||
|
||||
#if INFO
|
||||
-#define IPRINTF(_f, _a...) printf(_f , ## _a)
|
||||
+#define IPRINTF(_f, _a...) fprintf(kraxel, _f , ## _a)
|
||||
#else
|
||||
#define IPRINTF(_f, _a...) ((void)0)
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
-#define DPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
|
||||
+#define DPRINTF(_f, _a...) fprintf(kraxel, _f , ## _a)
|
||||
#else
|
||||
#define DPRINTF(_f, _a...) ((void)0)
|
||||
#endif
|
||||
|
||||
#if PROGRESS
|
||||
-#define PPRINTF(_f, _a...) fprintf(stderr, _f , ## _a)
|
||||
+#define PPRINTF(_f, _a...) fprintf(kraxel, _f , ## _a)
|
||||
#else
|
||||
#define PPRINTF(_f, _a...)
|
||||
#endif
|
||||
Index: build-64-release304-13087/tools/libxc/xc_dom_compat_linux.c
|
||||
===================================================================
|
||||
--- build-64-release304-13087.orig/tools/libxc/xc_dom_compat_linux.c
|
||||
+++ build-64-release304-13087/tools/libxc/xc_dom_compat_linux.c
|
||||
@@ -74,6 +74,7 @@ int xc_linux_build_mem(int xc_handle, ui
|
||||
int rc;
|
||||
|
||||
xc_dom_loginit();
|
||||
+ log_kraxel();
|
||||
dom = xc_dom_allocate(cmdline, features);
|
||||
if (0 != (rc = xc_dom_kernel_mem(dom, image_buffer, image_size)))
|
||||
goto out;
|
||||
@@ -106,6 +107,7 @@ int xc_linux_build(int xc_handle, uint32
|
||||
int rc;
|
||||
|
||||
xc_dom_loginit();
|
||||
+ log_kraxel();
|
||||
dom = xc_dom_allocate(cmdline, features);
|
||||
if (0 != (rc = xc_dom_kernel_file(dom, image_name)))
|
||||
goto out;
|
20
libxen_permissive.patch
Normal file
20
libxen_permissive.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff -ru xen-3.0.4-testing-orig/tools/libxen/src/xen_common.c xen-3.0.4-testing/tools/libxen/src/xen_common.c
|
||||
--- xen-3.0.4-testing-orig/tools/libxen/src/xen_common.c 2007-02-07 16:15:33.000000000 -0700
|
||||
+++ xen-3.0.4-testing/tools/libxen/src/xen_common.c 2007-02-09 11:08:37.000000000 -0700
|
||||
@@ -634,8 +634,15 @@
|
||||
0 != strcmp((char *)value_node->children->name, "struct") ||
|
||||
value_node->children->children == NULL)
|
||||
{
|
||||
+#if PERMISSIVE
|
||||
+ fprintf(stderr,
|
||||
+ "Expected Map from the server, but didn't get one\n");
|
||||
+ ((arbitrary_map **)value)[slot] = NULL;
|
||||
+#else
|
||||
+
|
||||
server_error(s,
|
||||
"Expected Map from the server, but didn't get it");
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
Only in xen-3.0.4-testing/tools/libxen/src: xen_common.c~
|
@ -1,6 +1,70 @@
|
||||
Index: 2007-01-31/xen/arch/x86/domain.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/domain.c 2007-01-31 09:39:18.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/domain.c 2007-02-15 15:10:02.000000000 +0100
|
||||
@@ -1337,7 +1337,8 @@ int hypercall_xlat_continuation(unsigned
|
||||
}
|
||||
#endif
|
||||
|
||||
-static void relinquish_memory(struct domain *d, struct list_head *list)
|
||||
+static void relinquish_memory(struct domain *d, struct list_head *list,
|
||||
+ unsigned long type)
|
||||
{
|
||||
struct list_head *ent;
|
||||
struct page_info *page;
|
||||
@@ -1366,23 +1367,24 @@ static void relinquish_memory(struct dom
|
||||
put_page(page);
|
||||
|
||||
/*
|
||||
- * Forcibly invalidate base page tables at this point to break circular
|
||||
- * 'linear page table' references. This is okay because MMU structures
|
||||
- * are not shared across domains and this domain is now dead. Thus base
|
||||
- * tables are not in use so a non-zero count means circular reference.
|
||||
+ * Forcibly invalidate top-most, still valid page tables at this point
|
||||
+ * to break circular 'linear page table' references. This is okay
|
||||
+ * because MMU structures are not shared across domains and this domain
|
||||
+ * is now dead. Thus top-most valid tables are not in use so a non-zero
|
||||
+ * count means circular reference.
|
||||
*/
|
||||
y = page->u.inuse.type_info;
|
||||
for ( ; ; )
|
||||
{
|
||||
x = y;
|
||||
if ( likely((x & (PGT_type_mask|PGT_validated)) !=
|
||||
- (PGT_base_page_table|PGT_validated)) )
|
||||
+ (type|PGT_validated)) )
|
||||
break;
|
||||
|
||||
y = cmpxchg(&page->u.inuse.type_info, x, x & ~PGT_validated);
|
||||
if ( likely(y == x) )
|
||||
{
|
||||
- free_page_type(page, PGT_base_page_table);
|
||||
+ free_page_type(page, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1464,8 +1466,16 @@ void domain_relinquish_resources(struct
|
||||
destroy_gdt(v);
|
||||
|
||||
/* Relinquish every page of memory. */
|
||||
- relinquish_memory(d, &d->xenpage_list);
|
||||
- relinquish_memory(d, &d->page_list);
|
||||
+#if CONFIG_PAGING_LEVELS >= 4
|
||||
+ relinquish_memory(d, &d->xenpage_list, PGT_l4_page_table);
|
||||
+ relinquish_memory(d, &d->page_list, PGT_l4_page_table);
|
||||
+#endif
|
||||
+#if CONFIG_PAGING_LEVELS >= 3
|
||||
+ relinquish_memory(d, &d->xenpage_list, PGT_l3_page_table);
|
||||
+ relinquish_memory(d, &d->page_list, PGT_l3_page_table);
|
||||
+#endif
|
||||
+ relinquish_memory(d, &d->xenpage_list, PGT_l2_page_table);
|
||||
+ relinquish_memory(d, &d->page_list, PGT_l2_page_table);
|
||||
|
||||
/* Free page used by xen oprofile buffer */
|
||||
free_xenoprof_pages(d);
|
||||
Index: 2007-01-31/xen/arch/x86/mm.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/mm.c 2007-01-31 09:43:38.000000000 +0100
|
||||
--- 2007-01-31.orig/xen/arch/x86/mm.c 2007-02-15 15:02:01.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/mm.c 2007-02-02 16:34:03.000000000 +0100
|
||||
@@ -509,7 +509,7 @@ get_linear_pagetable(
|
||||
return 0;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,46 +1,46 @@
|
||||
Support transparant gunzipping in the readnotes utility.
|
||||
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
|
||||
---
|
||||
tools/xcutils/readnotes.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: build-32-release304-13138/tools/xcutils/readnotes.c
|
||||
===================================================================
|
||||
--- build-32-release304-13138.orig/tools/xcutils/readnotes.c
|
||||
+++ build-32-release304-13138/tools/xcutils/readnotes.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <xg_private.h>
|
||||
+#include <xc_dom.h> /* gunzip bits */
|
||||
|
||||
#include <xen/libelf.h>
|
||||
|
||||
@@ -33,8 +34,8 @@ static void print_numeric_note(const cha
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *f;
|
||||
- int fd,h,size,count;
|
||||
- void *image;
|
||||
+ int fd,h,size,usize,count;
|
||||
+ void *image,*tmp;
|
||||
struct stat st;
|
||||
struct elf_binary elf;
|
||||
const elf_shdr *shdr;
|
||||
@@ -68,6 +69,15 @@ int main(int argc, char **argv)
|
||||
}
|
||||
size = st.st_size;
|
||||
|
||||
+ usize = xc_dom_check_gzip(image, st.st_size);
|
||||
+ if (usize)
|
||||
+ {
|
||||
+ tmp = malloc(usize);
|
||||
+ xc_dom_do_gunzip(image, st.st_size, tmp, usize);
|
||||
+ image = tmp;
|
||||
+ size = usize;
|
||||
+ }
|
||||
+
|
||||
if (0 != elf_init(&elf, image, size))
|
||||
{
|
||||
fprintf(stderr, "File %s is not an ELF image\n", f);
|
||||
Support transparant gunzipping in the readnotes utility.
|
||||
|
||||
Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
|
||||
---
|
||||
tools/xcutils/readnotes.c | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: build-32-release304-13138/tools/xcutils/readnotes.c
|
||||
===================================================================
|
||||
--- build-32-release304-13138.orig/tools/xcutils/readnotes.c
|
||||
+++ build-32-release304-13138/tools/xcutils/readnotes.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include <xg_private.h>
|
||||
+#include <xc_dom.h> /* gunzip bits */
|
||||
|
||||
#include <xen/libelf.h>
|
||||
|
||||
@@ -33,8 +34,8 @@ static void print_numeric_note(const cha
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *f;
|
||||
- int fd,h,size,count;
|
||||
- void *image;
|
||||
+ int fd,h,size,usize,count;
|
||||
+ void *image,*tmp;
|
||||
struct stat st;
|
||||
struct elf_binary elf;
|
||||
const elf_shdr *shdr;
|
||||
@@ -68,6 +69,15 @@ int main(int argc, char **argv)
|
||||
}
|
||||
size = st.st_size;
|
||||
|
||||
+ usize = xc_dom_check_gzip(image, st.st_size);
|
||||
+ if (usize)
|
||||
+ {
|
||||
+ tmp = malloc(usize);
|
||||
+ xc_dom_do_gunzip(image, st.st_size, tmp, usize);
|
||||
+ image = tmp;
|
||||
+ size = usize;
|
||||
+ }
|
||||
+
|
||||
if (0 != elf_init(&elf, image, size))
|
||||
{
|
||||
fprintf(stderr, "File %s is not an ELF image\n", f);
|
||||
|
359
x86-nmi-inject.patch
Normal file
359
x86-nmi-inject.patch
Normal file
@ -0,0 +1,359 @@
|
||||
Index: 2007-01-31/xen/arch/x86/physdev.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/physdev.c 2007-01-31 09:29:19.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/physdev.c 2007-02-14 18:22:18.000000000 +0100
|
||||
@@ -143,6 +143,57 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
|
||||
break;
|
||||
}
|
||||
|
||||
+ case PHYSDEVOP_send_nmi: {
|
||||
+ struct physdev_send_nmi send_nmi;
|
||||
+ struct domain *d;
|
||||
+
|
||||
+ ret = -EFAULT;
|
||||
+ if ( copy_from_guest(&send_nmi, arg, 1) != 0 )
|
||||
+ break;
|
||||
+
|
||||
+ ret = -EPERM;
|
||||
+ if ( send_nmi.domain == DOMID_SELF )
|
||||
+ d = current->domain;
|
||||
+ else if ( !IS_PRIV(current->domain) )
|
||||
+ break;
|
||||
+ else
|
||||
+ d = find_domain_by_id(send_nmi.domain);
|
||||
+ ret = -ESRCH;
|
||||
+ if ( !d )
|
||||
+ break;
|
||||
+
|
||||
+ switch ( send_nmi.vcpu )
|
||||
+ {
|
||||
+ struct vcpu *v;
|
||||
+
|
||||
+ case XEN_SEND_NMI_ALL:
|
||||
+ case XEN_SEND_NMI_ALL_BUT_SELF:
|
||||
+ for_each_vcpu(d, v)
|
||||
+ {
|
||||
+ if ( (send_nmi.vcpu == XEN_SEND_NMI_ALL || v != current) &&
|
||||
+ !test_and_set_bit(_VCPUF_nmi_pending, &v->vcpu_flags) )
|
||||
+ vcpu_kick(v);
|
||||
+ }
|
||||
+ ret = 0;
|
||||
+ break;
|
||||
+ case 0 ... MAX_VIRT_CPUS - 1:
|
||||
+ if ( (v = d->vcpu[send_nmi.vcpu]) != NULL )
|
||||
+ {
|
||||
+ if ( !test_and_set_bit(_VCPUF_nmi_pending, &v->vcpu_flags) )
|
||||
+ vcpu_kick(v);
|
||||
+ ret = 0;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ ret = EINVAL;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if ( send_nmi.domain != DOMID_SELF )
|
||||
+ put_domain(d);
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
default:
|
||||
ret = -ENOSYS;
|
||||
break;
|
||||
Index: 2007-01-31/xen/arch/x86/traps.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/traps.c 2007-02-07 17:03:20.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/traps.c 2007-02-15 10:12:21.000000000 +0100
|
||||
@@ -2516,6 +2516,12 @@ long do_set_trap_table(XEN_GUEST_HANDLE(
|
||||
if ( cur.address == 0 )
|
||||
break;
|
||||
|
||||
+ if ( cur.vector == 2 && !TI_GET_IF(&cur) )
|
||||
+ {
|
||||
+ rc = -EINVAL;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
fixup_guest_code_selector(current->domain, cur.cs);
|
||||
|
||||
memcpy(&dst[cur.vector], &cur, sizeof(cur));
|
||||
Index: 2007-01-31/xen/arch/x86/x86_32/asm-offsets.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_32/asm-offsets.c 2006-12-13 11:15:54.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_32/asm-offsets.c 2007-02-15 09:51:44.000000000 +0100
|
||||
@@ -68,6 +68,7 @@ void __dummy__(void)
|
||||
OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt);
|
||||
OFFSET(VCPU_flags, struct vcpu, vcpu_flags);
|
||||
OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr);
|
||||
+ OFFSET(VCPU_nmi_cs, struct vcpu, arch.guest_context.trap_ctxt[2].cs);
|
||||
DEFINE(_VCPUF_nmi_pending, _VCPUF_nmi_pending);
|
||||
DEFINE(_VCPUF_nmi_masked, _VCPUF_nmi_masked);
|
||||
DEFINE(_VGCF_failsafe_disables_events, _VGCF_failsafe_disables_events);
|
||||
Index: 2007-01-31/xen/arch/x86/x86_32/entry.S
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_32/entry.S 2007-01-31 09:42:04.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_32/entry.S 2007-02-15 09:54:40.000000000 +0100
|
||||
@@ -232,7 +232,7 @@ test_all_events:
|
||||
shl $IRQSTAT_shift,%eax
|
||||
test %ecx,irq_stat(%eax,1)
|
||||
jnz process_softirqs
|
||||
- btr $_VCPUF_nmi_pending,VCPU_flags(%ebx)
|
||||
+ lock btrl $_VCPUF_nmi_pending,VCPU_flags(%ebx)
|
||||
jc process_nmi
|
||||
test_guest_events:
|
||||
movl VCPU_vcpu_info(%ebx),%eax
|
||||
@@ -259,19 +259,20 @@ process_softirqs:
|
||||
|
||||
ALIGN
|
||||
process_nmi:
|
||||
- movl VCPU_nmi_addr(%ebx),%eax
|
||||
+ movzwl VCPU_nmi_cs(%ebx),%eax
|
||||
+ movl VCPU_nmi_addr(%ebx),%ecx
|
||||
test %eax,%eax
|
||||
jz test_all_events
|
||||
- bts $_VCPUF_nmi_masked,VCPU_flags(%ebx)
|
||||
+ lock btsl $_VCPUF_nmi_masked,VCPU_flags(%ebx)
|
||||
jc 1f
|
||||
sti
|
||||
leal VCPU_trap_bounce(%ebx),%edx
|
||||
- movl %eax,TRAPBOUNCE_eip(%edx)
|
||||
- movw $FLAT_KERNEL_CS,TRAPBOUNCE_cs(%edx)
|
||||
+ movl %ecx,TRAPBOUNCE_eip(%edx)
|
||||
+ movw %ax,TRAPBOUNCE_cs(%edx)
|
||||
movw $TBF_INTERRUPT,TRAPBOUNCE_flags(%edx)
|
||||
call create_bounce_frame
|
||||
jmp test_all_events
|
||||
-1: bts $_VCPUF_nmi_pending,VCPU_flags(%ebx)
|
||||
+1: lock btsl $_VCPUF_nmi_pending,VCPU_flags(%ebx)
|
||||
jmp test_guest_events
|
||||
|
||||
bad_hypercall:
|
||||
Index: 2007-01-31/xen/arch/x86/x86_64/asm-offsets.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_64/asm-offsets.c 2007-01-31 09:29:21.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_64/asm-offsets.c 2007-02-15 10:03:33.000000000 +0100
|
||||
@@ -76,6 +76,7 @@ void __dummy__(void)
|
||||
OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt);
|
||||
OFFSET(VCPU_flags, struct vcpu, vcpu_flags);
|
||||
OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr);
|
||||
+ OFFSET(VCPU_nmi_cs, struct vcpu, arch.guest_context.trap_ctxt[2].cs);
|
||||
DEFINE(_VCPUF_nmi_pending, _VCPUF_nmi_pending);
|
||||
DEFINE(_VCPUF_nmi_masked, _VCPUF_nmi_masked);
|
||||
DEFINE(_VGCF_failsafe_disables_events, _VGCF_failsafe_disables_events);
|
||||
Index: 2007-01-31/xen/arch/x86/x86_64/compat/entry.S
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_64/compat/entry.S 2007-01-31 09:42:04.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_64/compat/entry.S 2007-02-15 10:22:57.000000000 +0100
|
||||
@@ -68,7 +68,7 @@ compat_test_all_events:
|
||||
leaq irq_stat(%rip),%rcx
|
||||
testl $~0,(%rcx,%rax,1)
|
||||
jnz compat_process_softirqs
|
||||
- btrq $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
+ lock btrl $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
jc compat_process_nmi
|
||||
compat_test_guest_events:
|
||||
movq VCPU_vcpu_info(%rbx),%rax
|
||||
@@ -82,7 +82,7 @@ compat_test_guest_events:
|
||||
movl VCPU_event_addr(%rbx),%eax
|
||||
movl %eax,TRAPBOUNCE_eip(%rdx)
|
||||
movl VCPU_event_sel(%rbx),%eax
|
||||
- movl %eax,TRAPBOUNCE_cs(%rdx)
|
||||
+ movw %ax,TRAPBOUNCE_cs(%rdx)
|
||||
movw $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx)
|
||||
call compat_create_bounce_frame
|
||||
jmp compat_test_all_events
|
||||
@@ -97,20 +97,21 @@ compat_process_softirqs:
|
||||
ALIGN
|
||||
/* %rbx: struct vcpu */
|
||||
compat_process_nmi:
|
||||
- movl VCPU_nmi_addr(%rbx),%eax
|
||||
+ movzwl VCPU_nmi_cs(%rbx),%eax
|
||||
+ movl VCPU_nmi_addr(%rbx),%ecx
|
||||
testl %eax,%eax
|
||||
jz compat_test_all_events
|
||||
- btsq $_VCPUF_nmi_masked,VCPU_flags(%rbx)
|
||||
+ lock btsl $_VCPUF_nmi_masked,VCPU_flags(%rbx)
|
||||
jc 1f
|
||||
sti
|
||||
leaq VCPU_trap_bounce(%rbx),%rdx
|
||||
- movl %eax,TRAPBOUNCE_eip(%rdx)
|
||||
- movl $FLAT_COMPAT_KERNEL_CS,TRAPBOUNCE_cs(%rdx)
|
||||
+ movl %ecx,TRAPBOUNCE_eip(%rdx)
|
||||
+ movw %ax,TRAPBOUNCE_cs(%rdx)
|
||||
movw $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx)
|
||||
call compat_create_bounce_frame
|
||||
jmp compat_test_all_events
|
||||
1:
|
||||
- btsq $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
+ lock btsl $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
jmp compat_test_guest_events
|
||||
|
||||
compat_bad_hypercall:
|
||||
@@ -145,7 +146,7 @@ compat_failsafe_callback:
|
||||
movl VCPU_failsafe_addr(%rbx),%eax
|
||||
movl %eax,TRAPBOUNCE_eip(%rdx)
|
||||
movl VCPU_failsafe_sel(%rbx),%eax
|
||||
- movl %eax,TRAPBOUNCE_cs(%rdx)
|
||||
+ movw %ax,TRAPBOUNCE_cs(%rdx)
|
||||
movw $TBF_FAILSAFE,TRAPBOUNCE_flags(%rdx)
|
||||
btq $_VGCF_failsafe_disables_events,VCPU_guest_context_flags(%rbx)
|
||||
jnc 1f
|
||||
Index: 2007-01-31/xen/arch/x86/x86_64/compat/traps.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_64/compat/traps.c 2007-01-31 09:29:26.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_64/compat/traps.c 2007-02-15 10:10:46.000000000 +0100
|
||||
@@ -287,6 +287,12 @@ int compat_set_trap_table(XEN_GUEST_HAND
|
||||
if ( cur.address == 0 )
|
||||
break;
|
||||
|
||||
+ if ( cur.vector == 2 && !TI_GET_IF(&cur) )
|
||||
+ {
|
||||
+ rc = -EINVAL;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
fixup_guest_code_selector(current->domain, cur.cs);
|
||||
|
||||
XLAT_trap_info(dst + cur.vector, &cur);
|
||||
Index: 2007-01-31/xen/arch/x86/x86_64/entry.S
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_64/entry.S 2007-01-31 09:42:04.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_64/entry.S 2007-02-14 17:15:25.000000000 +0100
|
||||
@@ -177,7 +177,7 @@ test_all_events:
|
||||
leaq irq_stat(%rip),%rcx
|
||||
testl $~0,(%rcx,%rax,1)
|
||||
jnz process_softirqs
|
||||
- btr $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
+ lock btrl $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
jc process_nmi
|
||||
test_guest_events:
|
||||
movq VCPU_vcpu_info(%rbx),%rax
|
||||
@@ -207,7 +207,7 @@ process_nmi:
|
||||
movq VCPU_nmi_addr(%rbx),%rax
|
||||
test %rax,%rax
|
||||
jz test_all_events
|
||||
- bts $_VCPUF_nmi_masked,VCPU_flags(%rbx)
|
||||
+ lock btsl $_VCPUF_nmi_masked,VCPU_flags(%rbx)
|
||||
jc 1f
|
||||
sti
|
||||
leaq VCPU_trap_bounce(%rbx),%rdx
|
||||
@@ -215,7 +215,7 @@ process_nmi:
|
||||
movw $TBF_INTERRUPT,TRAPBOUNCE_flags(%rdx)
|
||||
call create_bounce_frame
|
||||
jmp test_all_events
|
||||
-1: bts $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
+1: lock btsl $_VCPUF_nmi_pending,VCPU_flags(%rbx)
|
||||
jmp test_guest_events
|
||||
|
||||
bad_hypercall:
|
||||
Index: 2007-01-31/xen/arch/x86/x86_64/physdev.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/arch/x86/x86_64/physdev.c 2007-01-31 09:29:19.000000000 +0100
|
||||
+++ 2007-01-31/xen/arch/x86/x86_64/physdev.c 2007-02-14 18:26:33.000000000 +0100
|
||||
@@ -30,6 +30,10 @@
|
||||
#define physdev_irq_status_query compat_physdev_irq_status_query
|
||||
#define physdev_irq_status_query_t physdev_irq_status_query_compat_t
|
||||
|
||||
+#define xen_physdev_send_nmi physdev_send_nmi
|
||||
+CHECK_physdev_send_nmi;
|
||||
+#undef xen_physdev_send_nmi
|
||||
+
|
||||
#define COMPAT
|
||||
#undef guest_handle_okay
|
||||
#define guest_handle_okay compat_handle_okay
|
||||
Index: 2007-01-31/xen/common/kernel.c
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/common/kernel.c 2007-01-31 09:44:25.000000000 +0100
|
||||
+++ 2007-01-31/xen/common/kernel.c 2007-02-15 10:18:48.000000000 +0100
|
||||
@@ -252,16 +252,20 @@ long register_guest_nmi_callback(unsigne
|
||||
struct vcpu *v = current;
|
||||
struct domain *d = current->domain;
|
||||
|
||||
- if ( (d->domain_id != 0) || (v->vcpu_id != 0) )
|
||||
- return -EINVAL;
|
||||
-
|
||||
v->nmi_addr = address;
|
||||
#ifdef CONFIG_X86
|
||||
+ v->arch.guest_context.trap_ctxt[2].vector = 2;
|
||||
+ v->arch.guest_context.trap_ctxt[2].flags = 0;
|
||||
+ TI_SET_IF(v->arch.guest_context.trap_ctxt + 2, 1);
|
||||
+ v->arch.guest_context.trap_ctxt[2].cs =
|
||||
+ !IS_COMPAT(d) ? FLAT_KERNEL_CS : FLAT_COMPAT_KERNEL_CS;
|
||||
+
|
||||
/*
|
||||
* If no handler was registered we can 'lose the NMI edge'. Re-assert it
|
||||
* now.
|
||||
*/
|
||||
- if ( arch_get_nmi_reason(d) != 0 )
|
||||
+ if ( d->domain_id == 0 && v->vcpu_id == 0 &&
|
||||
+ arch_get_nmi_reason(d) != 0 )
|
||||
set_bit(_VCPUF_nmi_pending, &v->vcpu_flags);
|
||||
#endif
|
||||
|
||||
@@ -272,6 +276,11 @@ long unregister_guest_nmi_callback(void)
|
||||
{
|
||||
struct vcpu *v = current;
|
||||
|
||||
+#ifdef CONFIG_X86
|
||||
+ v->arch.guest_context.trap_ctxt[2].cs = 0;
|
||||
+ v->arch.guest_context.trap_ctxt[2].vector = 0;
|
||||
+ v->arch.guest_context.trap_ctxt[2].flags = 0;
|
||||
+#endif
|
||||
v->nmi_addr = 0;
|
||||
|
||||
return 0;
|
||||
Index: 2007-01-31/xen/include/public/physdev.h
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/include/public/physdev.h 2006-12-13 11:15:56.000000000 +0100
|
||||
+++ 2007-01-31/xen/include/public/physdev.h 2007-02-14 18:21:35.000000000 +0100
|
||||
@@ -119,6 +119,22 @@ typedef struct physdev_irq physdev_irq_t
|
||||
DEFINE_XEN_GUEST_HANDLE(physdev_irq_t);
|
||||
|
||||
/*
|
||||
+ * Allocate or free a physical upcall vector for the specified IRQ line.
|
||||
+ * @arg == pointer to physdev_irq structure.
|
||||
+ */
|
||||
+#define PHYSDEVOP_send_nmi 13
|
||||
+struct physdev_send_nmi {
|
||||
+ /* IN */
|
||||
+ domid_t domain;
|
||||
+ uint32_t vcpu;
|
||||
+};
|
||||
+typedef struct physdev_send_nmi physdev_send_nmi_t;
|
||||
+DEFINE_XEN_GUEST_HANDLE(physdev_send_nmi_t);
|
||||
+
|
||||
+#define XEN_SEND_NMI_ALL (~(uint32_t)0)
|
||||
+#define XEN_SEND_NMI_ALL_BUT_SELF (~(uint32_t)1)
|
||||
+
|
||||
+/*
|
||||
* Argument to physdev_op_compat() hypercall. Superceded by new physdev_op()
|
||||
* hypercall since 0x00030202.
|
||||
*/
|
||||
Index: 2007-01-31/xen/include/xen/sched.h
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/include/xen/sched.h 2007-01-31 09:39:18.000000000 +0100
|
||||
+++ 2007-01-31/xen/include/xen/sched.h 2007-02-15 09:38:57.000000000 +0100
|
||||
@@ -108,7 +108,11 @@ struct vcpu
|
||||
/* Bitmask of CPUs on which this VCPU may run. */
|
||||
cpumask_t cpu_affinity;
|
||||
|
||||
+#ifndef CONFIG_X86
|
||||
unsigned long nmi_addr; /* NMI callback address. */
|
||||
+#else
|
||||
+# define nmi_addr arch.guest_context.trap_ctxt[2].address
|
||||
+#endif
|
||||
|
||||
/* Bitmask of CPUs which are holding onto this VCPU's state. */
|
||||
cpumask_t vcpu_dirty_cpumask;
|
||||
Index: 2007-01-31/xen/include/xlat.lst
|
||||
===================================================================
|
||||
--- 2007-01-31.orig/xen/include/xlat.lst 2007-01-31 09:29:27.000000000 +0100
|
||||
+++ 2007-01-31/xen/include/xlat.lst 2007-02-14 17:58:42.000000000 +0100
|
||||
@@ -40,6 +40,7 @@
|
||||
! memory_map memory.h
|
||||
! memory_reservation memory.h
|
||||
! translate_gpfn_list memory.h
|
||||
+? physdev_send_nmi physdev.h
|
||||
! sched_poll sched.h
|
||||
? sched_remote_shutdown sched.h
|
||||
? sched_shutdown sched.h
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e21bb469ef2d4b66eb11a50b923a0ba23140a1b88ccd73041f408580f81819d1
|
||||
size 59577
|
||||
oid sha256:134bf952b2af34e4463047117344f82cfada3a791e61443c71b36f2be49ac4d9
|
||||
size 124324
|
||||
|
51
xen.changes
51
xen.changes
@ -1,3 +1,54 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 16 18:07:09 MST 2007 - jfehlig@novell.com
|
||||
|
||||
- Added changeset 13775 from xen-unstable. This patch fixes
|
||||
the last known issue with the Xen API patchset backported
|
||||
from xen-unstable.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 16 11:31:15 MST 2007 - jfehlig@novell.com
|
||||
|
||||
- Added c/s 13226 from xen-unstable. It affects Xen API only.
|
||||
- Added patch to remove ':disk' and 'tap:qcow' from stored domain
|
||||
config. Fixes bug #237414 and helps with bug #242953.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 15 19:03:13 MST 2007 - jfehlig@novell.com
|
||||
|
||||
- Backported Xen API functionality from xen-unstable to support
|
||||
hosting CIM providers. This functionality is required for
|
||||
FATE feature 110320. ECO has been approved.
|
||||
+ Includes 19 changesets from xen-unstable. Most are
|
||||
specific to Xen API.
|
||||
+ Includes 1 patch that relaxes parsing of xml response
|
||||
in Xen API c-bindings.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 15 12:52:24 MST 2007 - carnold@novell.com
|
||||
|
||||
- Added x86-nmi-inject.patch for NW debuging. (#245942)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 15 10:09:41 MST 2007 - carnold@novell.com
|
||||
|
||||
- kernel panic in DomU while installing 32bit DomU on 64bit
|
||||
Dom0. (#244055) Patches 13630-domctl.patch,
|
||||
13903-domctl.patch and 13908-domctl.patch
|
||||
- Updated patch pae-guest-linear-pgtable.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 12 17:00:58 MST 2007 - ccoffing@novell.com
|
||||
|
||||
- Load xenblk at dom0 start to support bootstrapping from
|
||||
non-loopback devices. (#242963, #186696)
|
||||
- Update vm-install:
|
||||
+ Update translations
|
||||
+ Clean up exception error codes and sync man pages
|
||||
+ Honor ordering of arguments (as claimed in man page)
|
||||
+ #240984: properly detach vncviewer
|
||||
+ #240387: default to absolute coordinate mouse for Windows
|
||||
- Drop logging patch. (#245150)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 12 01:50:34 CET 2007 - ro@suse.de
|
||||
|
||||
|
132
xen.spec
132
xen.spec
@ -30,7 +30,7 @@ BuildRequires: glibc-32bit glibc-devel-32bit
|
||||
BuildRequires: kernel-source kernel-syms xorg-x11
|
||||
%endif
|
||||
Version: 3.0.4_13138
|
||||
Release: 2
|
||||
Release: 4
|
||||
License: GNU General Public License (GPL)
|
||||
Group: System/Kernel
|
||||
Autoreqprov: on
|
||||
@ -84,7 +84,7 @@ Patch31: xen-hvm-default-bridge.diff
|
||||
Patch32: xen-hvm-netfront.diff
|
||||
Patch33: xend-xmlrpc-large-ints.diff
|
||||
Patch34: xen-hvm-default-pae.diff
|
||||
Patch35: xend-config-devname.patch
|
||||
#Patch35: xend-config-devname.patch
|
||||
Patch36: xend-config-ramdisk.patch
|
||||
Patch37: xm-test-cleanup.diff
|
||||
## Jan's patches begin here
|
||||
@ -144,22 +144,22 @@ Patch154: libelf-use-xen-dom0.diff
|
||||
Patch155: libelf-symlink-to-libxc.diff
|
||||
Patch156: libelf-use-hvm-build.diff
|
||||
Patch157: libelf-use-readnotes.diff
|
||||
Patch158: libelf-dominfo.diff
|
||||
# domain builder rewrite
|
||||
Patch158: tools-add-errors.diff
|
||||
Patch159: tools-domain-builder-header-libxc.diff
|
||||
Patch160: tools-domain-builder-core.diff
|
||||
Patch161: tools-domain-builder-linux.diff
|
||||
Patch162: tools-readnotes-gunzip.diff
|
||||
Patch160: tools-add-errors.diff
|
||||
Patch161: tools-domain-builder-header-libxc.diff
|
||||
Patch162: tools-domain-builder-core.diff
|
||||
Patch163: tools-domain-builder-linux.diff
|
||||
Patch164: tools-readnotes-gunzip.diff
|
||||
# bimodal driver bits
|
||||
Patch163: protocol-bimodal.diff
|
||||
Patch164: fbback-bimodal.diff
|
||||
Patch165: blktools-bimodal.diff
|
||||
Patch165: protocol-bimodal.diff
|
||||
Patch166: fbback-bimodal.diff
|
||||
Patch167: blktools-bimodal.diff
|
||||
# libxc debugging bits
|
||||
Patch166: tools-debug-oldbuilder.diff
|
||||
Patch167: libxc-logging.diff
|
||||
Patch168: tools-debug-oldbuilder.diff
|
||||
# guest kexec, kboot
|
||||
Patch168: tools-xc_kexec.diff
|
||||
Patch169: tools-kboot.diff
|
||||
Patch170: tools-xc_kexec.diff
|
||||
Patch171: tools-kboot.diff
|
||||
# AMD nested page table patches
|
||||
Patch200: npt_part1.patch
|
||||
Patch201: npt_part2.patch
|
||||
@ -170,8 +170,36 @@ Patch210: microcode-xen-13079.diff
|
||||
Patch211: xen-localtime.patch
|
||||
Patch212: svm-update-v_tpr-on-mmio.patch
|
||||
Patch213: svm_cpuid_ffxsr_13743.patch
|
||||
Patch214: 13630-domctl.patch
|
||||
Patch215: 13903-domctl.patch
|
||||
Patch216: 13908-domctl.patch
|
||||
Patch217: x86-nmi-inject.patch
|
||||
# pv driver building
|
||||
Patch250: pv-driver-build.patch
|
||||
# Jim' Xen API patches
|
||||
Patch270: 13161_xenapi.patch
|
||||
Patch271: 13201_xenapi.patch
|
||||
Patch272: 13226_xenapi.patch
|
||||
Patch273: 13235_xenapi.patch
|
||||
Patch274: 13236_xenapi.patch
|
||||
Patch275: 13577_xenapi.patch
|
||||
Patch276: 13585_xenapi.patch
|
||||
Patch277: 13615_xenapi.patch
|
||||
Patch278: 13616_xenapi.patch
|
||||
Patch279: 13628_xenapi.patch
|
||||
Patch280: 13655_xenapi.patch
|
||||
Patch281: 13689_xenapi.patch
|
||||
Patch282: 13724_xenapi.patch
|
||||
Patch283: 13745_xenapi.patch
|
||||
Patch284: 13747_xenapi.patch
|
||||
Patch285: 13753_xenapi.patch
|
||||
Patch286: 13775_xenapi.patch
|
||||
Patch287: 13777_xenapi.patch
|
||||
Patch288: 13778_xenapi.patch
|
||||
Patch289: 13784_xenapi.patch
|
||||
Patch290: 13787_xenapi.patch
|
||||
Patch291: libxen_permissive.patch
|
||||
Patch292: xend_disk_decorate_rm.patch
|
||||
# Misc unused patches / need to be re-ported:
|
||||
Patch300: xen-enable-hvm-debug.diff
|
||||
Patch301: xen-removable.diff
|
||||
@ -585,7 +613,7 @@ cd ..
|
||||
%patch32 -p1
|
||||
%patch33 -p1
|
||||
%patch34 -p1
|
||||
%patch35 -p1
|
||||
#%patch35 -p1
|
||||
%patch36 -p1
|
||||
%patch37 -p1
|
||||
%patch100 -p1
|
||||
@ -638,7 +666,6 @@ cd ..
|
||||
%patch156 -p1
|
||||
%patch157 -p1
|
||||
%patch158 -p1
|
||||
%patch159 -p1
|
||||
%patch160 -p1
|
||||
%patch161 -p1
|
||||
%patch162 -p1
|
||||
@ -648,7 +675,8 @@ cd ..
|
||||
%patch166 -p1
|
||||
%patch167 -p1
|
||||
%patch168 -p1
|
||||
%patch169 -p1
|
||||
%patch170 -p1
|
||||
%patch171 -p1
|
||||
%patch200 -p1
|
||||
%patch201 -p1
|
||||
%patch202 -p1
|
||||
@ -657,7 +685,34 @@ cd ..
|
||||
%patch211 -p1
|
||||
%patch212 -p1
|
||||
%patch213 -p1
|
||||
%patch214 -p1
|
||||
%patch215 -p1
|
||||
%patch216 -p1
|
||||
%patch217 -p1
|
||||
%patch250 -p1
|
||||
%patch270 -p1
|
||||
%patch271 -p1
|
||||
%patch272 -p1
|
||||
%patch273 -p1
|
||||
%patch274 -p1
|
||||
%patch275 -p1
|
||||
%patch276 -p1
|
||||
%patch277 -p1
|
||||
%patch278 -p1
|
||||
%patch279 -p1
|
||||
%patch280 -p1
|
||||
%patch281 -p1
|
||||
%patch282 -p1
|
||||
%patch283 -p1
|
||||
%patch284 -p1
|
||||
%patch285 -p1
|
||||
%patch286 -p1
|
||||
%patch287 -p1
|
||||
%patch288 -p1
|
||||
%patch289 -p1
|
||||
%patch290 -p1
|
||||
%patch291 -p1
|
||||
%patch292 -p1
|
||||
XEN_EXTRAVERSION=%version-%release
|
||||
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
|
||||
sed -i "s/XEN_EXTRAVERSION[ ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile
|
||||
@ -730,6 +785,7 @@ make -C tools install \
|
||||
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir}
|
||||
%if %{?with_install}0
|
||||
ln -s /usr/bin/vm-install $RPM_BUILD_ROOT/usr/sbin/xen-vm-install
|
||||
%find_lang xen-vm-install
|
||||
%endif
|
||||
make -C tools/misc/serial-split install \
|
||||
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir}
|
||||
@ -836,8 +892,13 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
||||
%{_libdir}/fs/
|
||||
%{_libdir}/libfsimage*
|
||||
%{_libdir}/libxen*.so.*
|
||||
%if %{?with_install}0
|
||||
|
||||
%files tools
|
||||
%files tools -f ../xen-vm-install.lang
|
||||
%else
|
||||
|
||||
%files tools
|
||||
%endif
|
||||
%defattr(-,root,root)
|
||||
/usr/bin/lomount
|
||||
/usr/bin/xencons
|
||||
@ -968,7 +1029,40 @@ rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
|
||||
%{restart_on_update xend}
|
||||
%{insserv_cleanup}
|
||||
|
||||
%changelog -n xen
|
||||
%changelog
|
||||
* Fri Feb 16 2007 - jfehlig@novell.com
|
||||
- Added changeset 13775 from xen-unstable. This patch fixes
|
||||
the last known issue with the Xen API patchset backported
|
||||
from xen-unstable.
|
||||
* Fri Feb 16 2007 - jfehlig@novell.com
|
||||
- Added c/s 13226 from xen-unstable. It affects Xen API only.
|
||||
- Added patch to remove ':disk' and 'tap:qcow' from stored domain
|
||||
config. Fixes bug #237414 and helps with bug #242953.
|
||||
* Thu Feb 15 2007 - jfehlig@novell.com
|
||||
- Backported Xen API functionality from xen-unstable to support
|
||||
hosting CIM providers. This functionality is required for
|
||||
FATE feature 110320. ECO has been approved.
|
||||
+ Includes 19 changesets from xen-unstable. Most are
|
||||
specific to Xen API.
|
||||
+ Includes 1 patch that relaxes parsing of xml response
|
||||
in Xen API c-bindings.
|
||||
* Thu Feb 15 2007 - carnold@novell.com
|
||||
- Added x86-nmi-inject.patch for NW debuging. (#245942)
|
||||
* Thu Feb 15 2007 - carnold@novell.com
|
||||
- kernel panic in DomU while installing 32bit DomU on 64bit
|
||||
Dom0. (#244055) Patches 13630-domctl.patch,
|
||||
13903-domctl.patch and 13908-domctl.patch
|
||||
- Updated patch pae-guest-linear-pgtable.patch
|
||||
* Mon Feb 12 2007 - ccoffing@novell.com
|
||||
- Load xenblk at dom0 start to support bootstrapping from
|
||||
non-loopback devices. (#242963, #186696)
|
||||
- Update vm-install:
|
||||
+ Update translations
|
||||
+ Clean up exception error codes and sync man pages
|
||||
+ Honor ordering of arguments (as claimed in man page)
|
||||
+ #240984: properly detach vncviewer
|
||||
+ #240387: default to absolute coordinate mouse for Windows
|
||||
- Drop logging patch. (#245150)
|
||||
* Mon Feb 12 2007 - ro@suse.de
|
||||
- remove -fstack-protector from RPM_OPT_FLAGS for now
|
||||
* Thu Feb 08 2007 - ccoffing@novell.com
|
||||
|
@ -1,27 +0,0 @@
|
||||
# HG changeset patch
|
||||
# User jfehlig@jfehlig2.provo.novell.com
|
||||
# Date 1166568442 25200
|
||||
# Node ID 72a013bc923efa47b3262849cd5611a16353abc5
|
||||
# Parent 057f7c4dbed1c75a3fbe446d346cee04cff31497
|
||||
Remove ':disk' suffix from dev entry in dev_info dictionary in XendConfig.py.
|
||||
|
||||
The suffix was added regardless of device type so it doesn't appear to add any semantics. Additionally, clients would be forced to strip this suffix from the device name since something like 'hda:disk" is not a device name.
|
||||
|
||||
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
|
||||
|
||||
diff -r 057f7c4dbed1 -r 72a013bc923e tools/python/xen/xend/XendConfig.py
|
||||
--- a/tools/python/xen/xend/XendConfig.py Tue Dec 19 12:00:11 2006 +0000
|
||||
+++ b/tools/python/xen/xend/XendConfig.py Tue Dec 19 15:47:22 2006 -0700
|
||||
@@ -970,10 +970,10 @@ class XendConfig(dict):
|
||||
elif dev_type in ('vbd', 'tap'):
|
||||
if dev_type == 'vbd':
|
||||
dev_info['uname'] = cfg_xenapi.get('image', '')
|
||||
- dev_info['dev'] = '%s:disk' % cfg_xenapi.get('device')
|
||||
+ dev_info['dev'] = cfg_xenapi.get('device')
|
||||
elif dev_type == 'tap':
|
||||
dev_info['uname'] = 'tap:qcow:%s' % cfg_xenapi.get('image')
|
||||
- dev_info['dev'] = '%s:disk' % cfg_xenapi.get('device')
|
||||
+ dev_info['dev'] = cfg_xenapi.get('device')
|
||||
|
||||
dev_info['driver'] = cfg_xenapi.get('driver')
|
||||
dev_info['VDI'] = cfg_xenapi.get('VDI', '')
|
41
xend_disk_decorate_rm.patch
Normal file
41
xend_disk_decorate_rm.patch
Normal file
@ -0,0 +1,41 @@
|
||||
diff -ru xen-3.0.4-testing-orig/tools/python/xen/xend/server/blkif.py xen-3.0.4-testing/tools/python/xen/xend/server/blkif.py
|
||||
--- xen-3.0.4-testing-orig/tools/python/xen/xend/server/blkif.py 2007-02-16 11:16:04.000000000 -0700
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/server/blkif.py 2007-02-16 11:22:25.000000000 -0700
|
||||
@@ -120,10 +120,10 @@
|
||||
'uuid')
|
||||
dev, typ, params, mode, uuid = devinfo
|
||||
|
||||
+ dev_type = self.readFrontend(devid, 'device-type')
|
||||
+ if dev_type:
|
||||
+ config['type'] = dev_type
|
||||
if dev:
|
||||
- dev_type = self.readFrontend(devid, 'device-type')
|
||||
- if dev_type:
|
||||
- dev += ':' + dev_type
|
||||
config['dev'] = dev
|
||||
if typ and params:
|
||||
config['uname'] = typ +':' + params
|
||||
diff -ru xen-3.0.4-testing-orig/tools/python/xen/xend/XendConfig.py xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py
|
||||
--- xen-3.0.4-testing-orig/tools/python/xen/xend/XendConfig.py 2007-02-16 11:16:06.000000000 -0700
|
||||
+++ xen-3.0.4-testing/tools/python/xen/xend/XendConfig.py 2007-02-16 11:25:03.000000000 -0700
|
||||
@@ -1036,12 +1036,14 @@
|
||||
target['vif_refs'].append(dev_uuid)
|
||||
|
||||
elif dev_type in ('vbd', 'tap'):
|
||||
- if dev_type == 'vbd':
|
||||
- dev_info['uname'] = cfg_xenapi.get('image', '')
|
||||
- dev_info['dev'] = '%s:disk' % cfg_xenapi.get('device')
|
||||
- elif dev_type == 'tap':
|
||||
- dev_info['uname'] = 'tap:qcow:%s' % cfg_xenapi.get('image')
|
||||
- dev_info['dev'] = '%s:disk' % cfg_xenapi.get('device')
|
||||
+ dev_info['type'] = cfg_xenapi.get('type', 'Disk')
|
||||
+ if dev_info['type'] == 'CD':
|
||||
+ dev_info['dev'] = '%s:%s' % (cfg_xenapi.get('device'),
|
||||
+ 'cdrom')
|
||||
+ else:
|
||||
+ dev_info['dev'] = cfg_xenapi.get('device')
|
||||
+
|
||||
+ dev_info['uname'] = cfg_xenapi.get('image', '')
|
||||
|
||||
dev_info['driver'] = cfg_xenapi.get('driver')
|
||||
dev_info['VDI'] = cfg_xenapi.get('VDI', '')
|
Loading…
Reference in New Issue
Block a user