aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/kernel.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-06-18 10:20:45 +0100
committerKeir Fraser <keir.fraser@citrix.com>2009-06-18 10:20:45 +0100
commitfa97833ae18e4a42c0e5ba4e781173457b5d3397 (patch)
treee0a6466547921f456ffcde046c421f3b04a1b61f /xen/common/kernel.c
parentd914b94a3f272e29be3137517f3665844e9442a4 (diff)
downloadxen-fa97833ae18e4a42c0e5ba4e781173457b5d3397.tar.gz
xen-fa97833ae18e4a42c0e5ba4e781173457b5d3397.tar.bz2
xen-fa97833ae18e4a42c0e5ba4e781173457b5d3397.zip
Allow tools to see the hypervisor command line.
This is useful from tools in the same way /proc/cmdline is useful for the domain 0 kernel. Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen/common/kernel.c')
-rw-r--r--xen/common/kernel.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xen/common/kernel.c b/xen/common/kernel.c
index 9137671817..971d723109 100644
--- a/xen/common/kernel.c
+++ b/xen/common/kernel.c
@@ -24,6 +24,8 @@
int tainted;
+xen_commandline_t saved_cmdline;
+
void cmdline_parse(char *cmdline)
{
char opt[100], *optval, *optkey, *q;
@@ -31,6 +33,8 @@ void cmdline_parse(char *cmdline)
struct kernel_param *param;
int bool_assert;
+ safe_strcpy(saved_cmdline, cmdline);
+
if ( p == NULL )
return;
@@ -246,7 +250,14 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg)
ARRAY_SIZE(current->domain->handle)) )
return -EFAULT;
return 0;
- }
+ }
+
+ case XENVER_commandline:
+ {
+ if ( copy_to_guest(arg, saved_cmdline, ARRAY_SIZE(saved_cmdline)) )
+ return -EFAULT;
+ return 0;
+ }
}
return -ENOSYS;