xm: New command 'debug-keys' to inject debug-key events into Xen.

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kfraser@localhost.localdomain committed 2007-03-09 11:11:59 +00:00
1 parent f064d42ef8
commit e1bc13a960
9 files changed
+88 -3

No files matched your search

+24
View File
@@ -1007,6 +1007,24 @@ static PyObject *pyxc_domain_send_trigger(XcObject *self,
return zero;
}
static PyObject *pyxc_send_debug_keys(XcObject *self,
PyObject *args,
PyObject *kwds)
{
char *keys;
static char *kwd_list[] = { "keys", NULL };
if ( !PyArg_ParseTupleAndKeywords(args, kwds, "s", kwd_list, &keys) )
return NULL;
if ( xc_send_debug_keys(self->xc_handle, keys) != 0 )
return pyxc_error_to_exception();
Py_INCREF(zero);
return zero;
}
static PyObject *dom_op(XcObject *self, PyObject *args,
int (*fn)(int, uint32_t))
{
@@ -1420,6 +1438,12 @@ static PyMethodDef pyxc_methods[] = {
" vcpu [int]: VCPU to be sent trigger.\n"
"Returns: [int] 0 on success; -1 on error.\n" },
{ "send_debug_keys",
(PyCFunction)pyxc_send_debug_keys,
METH_VARARGS | METH_KEYWORDS, "\n"
"Inject debug keys into Xen.\n"
" keys [str]: String of keys to inject.\n" },
#ifdef __powerpc__
{ "arch_alloc_real_mode_area",
(PyCFunction)pyxc_alloc_real_mode_area,
+6
View File
@@ -453,6 +453,12 @@ class XendNode:
return pif.network
raise Exception('Bridge %s is not connected to a network' % bridge)
#
# Debug keys.
#
def send_debug_keys(self, keys):
return self.xc.send_debug_keys(keys)
#
# Getting host information.
+1 -1
View File
@@ -157,7 +157,7 @@ class XMLRPCServer:
self.server.register_function(fn, "xend.domain.%s" % name[7:])
# Functions in XendNode and XendDmesg
for type, lst, n in [(XendNode, ['info'], 'node'),
for type, lst, n in [(XendNode, ['info', 'send_debug_keys'], 'node'),
(XendDmesg, ['info', 'clear'], 'node.dmesg')]:
inst = type.instance()
for name in lst:
+7 -1
View File
@@ -133,6 +133,7 @@ SUBCOMMAND_HELP = {
'sched-credit': ('[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]]',
'Get/set credit scheduler parameters.'),
'sysrq' : ('<Domain> <letter>', 'Send a sysrq to a domain.'),
'debug-keys' : ('<Keys>', 'Send debug keys to Xen.'),
'trigger' : ('<Domain> <nmi|reset|init> [<VCPU>]',
'Send a trigger to a domain.'),
'vcpu-list' : ('[<Domain>]',
@@ -260,7 +261,6 @@ common_commands = [
"shutdown",
"start",
"suspend",
"trigger",
"top",
"unpause",
"uptime",
@@ -300,6 +300,7 @@ domain_commands = [
]
host_commands = [
"debug-keys",
"dmesg",
"info",
"log",
@@ -1395,6 +1396,10 @@ def xm_trigger(args):
server.xend.domain.send_trigger(dom, trigger, vcpu)
def xm_debug_keys(args):
arg_check(args, "debug-keys", 1)
server.xend.node.send_debug_keys(str(args[0]))
def xm_top(args):
arg_check(args, "top", 0)
@@ -1738,6 +1743,7 @@ commands = {
"pause": xm_pause,
"unpause": xm_unpause,
# host commands
"debug-keys": xm_debug_keys,
"dmesg": xm_dmesg,
"info": xm_info,
"log": xm_log,
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.