From 3b60e1d052e3949b0a24d989e65e36cd409211ba Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Jun 2008 11:51:45 +0100 Subject: [PATCH] suspend_requested -> xen_pause_requested; use shutdown_requested() --- i386-dm/helper2.c | 10 +++++----- xen-config-host.h | 1 + xenstore.c | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/i386-dm/helper2.c b/i386-dm/helper2.c index 0f1ec91b37..694740e42f 100644 --- a/i386-dm/helper2.c +++ b/i386-dm/helper2.c @@ -518,7 +518,7 @@ void cpu_handle_ioreq(void *opaque) * causes Xen to powerdown the domain. */ if (vm_running) { - if (shutdown_requested) { + if (qemu_shutdown_requested()) { fprintf(logfile, "shutdown requested in cpu_handle_ioreq\n"); destroy_hvm_domain(); } @@ -533,11 +533,11 @@ void cpu_handle_ioreq(void *opaque) } } +int xen_pause_requested; + int main_loop(void) { extern int vm_running; - extern int shutdown_requested; - extern int suspend_requested; CPUState *env = cpu_single_env; int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle); char *qemu_file; @@ -552,7 +552,7 @@ int main_loop(void) xenstore_record_dm_state("running"); while (1) { - while (!(vm_running && suspend_requested)) + while (!(vm_running && xen_pause_requested)) /* Wait up to 10 msec. */ main_loop_wait(10); @@ -571,7 +571,7 @@ int main_loop(void) xenstore_record_dm_state("paused"); /* Wait to be allowed to continue */ - while (suspend_requested) { + while (xen_pause_requested) { FD_ZERO(&fds); FD_SET(xenstore_fd(), &fds); if (select(xenstore_fd() + 1, &fds, NULL, NULL, NULL) > 0) diff --git a/xen-config-host.h b/xen-config-host.h index f51a6a59fc..3a5da7e119 100644 --- a/xen-config-host.h +++ b/xen-config-host.h @@ -20,3 +20,4 @@ extern int domid; #undef CONFIG_GDBSTUB extern int xc_handle; +extern int xen_pause_requested; diff --git a/xenstore.c b/xenstore.c index 01ace34ada..b5600f2770 100644 --- a/xenstore.c +++ b/xenstore.c @@ -8,7 +8,8 @@ * */ -#include "vl.h" +#include "qemu-common.h" + #include "block_int.h" #include #ifndef CONFIG_STUBDOM @@ -462,7 +463,6 @@ static void xenstore_process_dm_command_event(void) { char *path = NULL, *command = NULL, *par = NULL; unsigned int len; - extern int suspend_requested; if (pasprintf(&path, "/local/domain/0/device-model/%u/command", domid) == -1) { @@ -475,10 +475,10 @@ static void xenstore_process_dm_command_event(void) if (!strncmp(command, "save", len)) { fprintf(logfile, "dm-command: pause and save state\n"); - suspend_requested = 1; + xen_pause_requested = 1; } else if (!strncmp(command, "continue", len)) { fprintf(logfile, "dm-command: continue after state save\n"); - suspend_requested = 0; + xen_pause_requested = 0; } else if (!strncmp(command, "pci-rem", len)) { fprintf(logfile, "dm-command: hot remove pass-through pci dev \n"); -- 2.39.5