summaryrefslogtreecommitdiff
path: root/drivers/lguest
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/lguest')
-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)
lguest_arch_handle_trap(lg);
}
+ if (lg->dead == ERR_PTR(-ERESTART))
+ return -ERESTART;
/* The Guest is dead => "No such file or directory" */
return -ENOENT;
}
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)
* 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: