aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBalaji Rao <balajirrao@gmail.com>2007-12-28 03:56:24 -0500
committerRusty Russell <rusty@rustcorp.com.au>2008-01-30 06:50:04 -0500
commitec04b13f67be3c90b38c625f4b8bdfea54c1ff60 (patch)
tree7819de21361fdd65487ef75ea9f2b774e4203f83 /drivers
parent5c55841d16dbf7c759fa6fb2ecc5e615b86d17db (diff)
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')
-rw-r--r--drivers/lguest/core.c2
-rw-r--r--drivers/lguest/hypercalls.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/lguest/core.c b/drivers/lguest/core.c
index f10abc8d7635..c1069bceba11 100644
--- a/drivers/lguest/core.c
+++ b/drivers/lguest/core.c
@@ -235,6 +235,8 @@ int run_guest(struct lguest *lg, unsigned long __user *user)
235 lguest_arch_handle_trap(lg); 235 lguest_arch_handle_trap(lg);
236 } 236 }
237 237
238 if (lg->dead == ERR_PTR(-ERESTART))
239 return -ERESTART;
238 /* The Guest is dead => "No such file or directory" */ 240 /* The Guest is dead => "No such file or directory" */
239 return -ENOENT; 241 return -ENOENT;
240} 242}
diff --git a/drivers/lguest/hypercalls.c b/drivers/lguest/hypercalls.c
index b478affe8f91..05fad6fa8049 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)
41 * do that. */ 41 * do that. */
42 kill_guest(lg, "already have lguest_data"); 42 kill_guest(lg, "already have lguest_data");
43 break; 43 break;
44 case LHCALL_CRASH: { 44 case LHCALL_SHUTDOWN: {
45 /* Crash is such a trivial hypercall that we do it in four 45 /* Shutdown is such a trivial hypercall that we do it in four
46 * lines right here. */ 46 * lines right here. */
47 char msg[128]; 47 char msg[128];
48 /* If the lgread fails, it will call kill_guest() itself; the 48 /* 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)
50 __lgread(lg, msg, args->arg1, sizeof(msg)); 50 __lgread(lg, msg, args->arg1, sizeof(msg));
51 msg[sizeof(msg)-1] = '\0'; 51 msg[sizeof(msg)-1] = '\0';
52 kill_guest(lg, "CRASH: %s", msg); 52 kill_guest(lg, "CRASH: %s", msg);
53 if (args->arg2 == LGUEST_SHUTDOWN_RESTART)
54 lg->dead = ERR_PTR(-ERESTART);
53 break; 55 break;
54 } 56 }
55 case LHCALL_FLUSH_TLB: 57 case LHCALL_FLUSH_TLB: