aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2012-10-11 05:00:35 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2012-10-11 05:00:35 -0300
commit6b852ae04e3aa1adfeac5a62d6ab71870bcc7c5d (patch)
treecdf94fdf09a6b4abecff647784d82bc1ad1758c5 /vl.c
parent8ed1d2756d3347c2b021748d8c272ff650f57dd0 (diff)
parentf430694188293f99a316bfa375b7cc17d23a06ed (diff)
Merge commit 'f430694188293f99a316bfa375b7cc17d23a06ed' into upstream-merge
* commit 'f430694188293f99a316bfa375b7cc17d23a06ed': (248 commits) add pc-1.3 machine type Cleanup unused global var qemu_system_powerdown target-sparc: use notifier for signaling guest system_powerdown command target-arm: use notifier for signaling guest system_powerdown command acpi: use notifier for signaling guest system_powerdown command Introduce powerdown_notifiers tcg/i386: fix build with -march < i686 tcg: Streamline movcond_i64 using movcond_i32 tcg: Streamline movcond_i64 using 32-bit arithmetic tcg: Sanity check goto_tb input tcg: Sanity check deposit inputs tcg: Add tcg_debug_assert tcg: Implement concat*_i64 with deposit_i64 tcg: Emit XORI as NOT for appropriate constants tcg: Optimize initial inputs for ori_i64 tcg: Emit ANDI as EXTU for appropriate constants tcg: Adjust descriptions of *cond opcodes tcg/mips: fix MIPS32(R2) detection block: remove keep_read_only flag from BlockDriverState struct block: convert bdrv_commit() to use bdrv_reopen() ... Conflicts: hw/pc_piix.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/vl.c b/vl.c
index c681c3352..ec487a0ae 100644
--- a/vl.c
+++ b/vl.c
@@ -1355,6 +1355,8 @@ static int powerdown_requested;
static int debug_requested;
static int suspend_requested;
static int wakeup_requested;
+static NotifierList powerdown_notifiers =
+ NOTIFIER_LIST_INITIALIZER(powerdown_notifiers);
static NotifierList suspend_notifiers =
NOTIFIER_LIST_INITIALIZER(suspend_notifiers);
static NotifierList wakeup_notifiers =
@@ -1563,12 +1565,23 @@ void qemu_system_shutdown_request(void)
qemu_notify_event();
}
+static void qemu_system_powerdown(void)
+{
+ monitor_protocol_event(QEVENT_POWERDOWN, NULL);
+ notifier_list_notify(&powerdown_notifiers, NULL);
+}
+
void qemu_system_powerdown_request(void)
{
powerdown_requested = 1;
qemu_notify_event();
}
+void qemu_register_powerdown_notifier(Notifier *notifier)
+{
+ notifier_list_add(&powerdown_notifiers, notifier);
+}
+
void qemu_system_debug_request(void)
{
debug_requested = 1;
@@ -1581,8 +1594,6 @@ void qemu_system_vmstop_request(RunState state)
qemu_notify_event();
}
-qemu_irq qemu_system_powerdown;
-
static bool main_loop_should_exit(void)
{
RunState r;
@@ -1619,8 +1630,7 @@ static bool main_loop_should_exit(void)
monitor_protocol_event(QEVENT_WAKEUP, NULL);
}
if (qemu_powerdown_requested()) {
- monitor_protocol_event(QEVENT_POWERDOWN, NULL);
- qemu_irq_raise(qemu_system_powerdown);
+ qemu_system_powerdown();
}
if (qemu_vmstop_requested(&r)) {
vm_stop(r);
@@ -3692,7 +3702,9 @@ int main(int argc, char **argv, char **envp)
break;
#if defined(CONFIG_CURSES)
case DT_CURSES:
- curses_display_init(ds, full_screen);
+ if (!is_daemonized()) {
+ curses_display_init(ds, full_screen);
+ }
break;
#endif
#if defined(CONFIG_SDL)