summaryrefslogtreecommitdiff
path: root/drivers/lguest/hypercalls.c
diff options
context:
space:
mode:
authorBalaji Rao <balajirrao@gmail.com>2007-12-28 14:26:24 +0530
committerRusty Russell <rusty@rustcorp.com.au>2008-01-30 22:50:04 +1100
commitec04b13f67be3c90b38c625f4b8bdfea54c1ff60 (patch)
tree7819de21361fdd65487ef75ea9f2b774e4203f83 /drivers/lguest/hypercalls.c
parent5c55841d16dbf7c759fa6fb2ecc5e615b86d17db (diff)
downloadlinux-3.10-ec04b13f67be3c90b38c625f4b8bdfea54c1ff60.tar.gz
linux-3.10-ec04b13f67be3c90b38c625f4b8bdfea54c1ff60.tar.bz2
linux-3.10-ec04b13f67be3c90b38c625f4b8bdfea54c1ff60.zip
lguest: Reboot support
Reboot Implemented (Prevent fd leak, fix style and fix documentation --RR) Signed-off-by: Balaji Rao <balajirrao@gmail.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/lguest/hypercalls.c')
-rw-r--r--drivers/lguest/hypercalls.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/lguest/hypercalls.c b/drivers/lguest/hypercalls.c
index b478affe8f9..05fad6fa804 100644
--- a/drivers/lguest/hypercalls.c
+++ b/drivers/lguest/hypercalls.c
@@ -41,8 +41,8 @@ static void do_hcall(struct lguest *lg, struct hcall_args *args)
* do that. */
kill_guest(lg, "already have lguest_data");
break;
- case LHCALL_CRASH: {
- /* Crash is such a trivial hypercall that we do it in four
+ case LHCALL_SHUTDOWN: {
+ /* Shutdown is such a trivial hypercall that we do it in four
* lines right here. */
char msg[128];
/* If the lgread fails, it will call kill_guest() itself; the
@@ -50,6 +50,8 @@ static void do_hcall(struct lguest *lg, struct hcall_args *args)
__lgread(lg, msg, args->arg1, sizeof(msg));
msg[sizeof(msg)-1] = '\0';
kill_guest(lg, "CRASH: %s", msg);
+ if (args->arg2 == LGUEST_SHUTDOWN_RESTART)
+ lg->dead = ERR_PTR(-ERESTART);
break;
}
case LHCALL_FLUSH_TLB: