Patchwork [V8,13/16] vl.c: Introduce getter for shutdown_requested and reset_requested.

login
register
mail settings
Submitter Anthony PERARD
Date Dec. 1, 2010, 5:39 p.m.
Message ID <1291225188-9972-14-git-send-email-anthony.perard@citrix.com>
Download mbox | patch
Permalink /patch/73860/
State New
Headers show

Comments

Anthony PERARD - Dec. 1, 2010, 5:39 p.m.
From: Anthony PERARD <anthony.perard@citrix.com>

Introduce two functions qemu_shutdown_requested_get and
qemu_reset_requested_get to get the value of shutdown/reset_requested
without reset it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 sysemu.h |    2 ++
 vl.c     |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

Patch

diff --git a/sysemu.h b/sysemu.h
index b81a70e..fd3adba 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -51,6 +51,8 @@  void cpu_disable_ticks(void);
 void qemu_system_reset_request(void);
 void qemu_system_shutdown_request(void);
 void qemu_system_powerdown_request(void);
+int qemu_shutdown_requested_get(void);
+int qemu_reset_requested_get(void);
 int qemu_shutdown_requested(void);
 int qemu_reset_requested(void);
 int qemu_powerdown_requested(void);
diff --git a/vl.c b/vl.c
index 955e579..29f7801 100644
--- a/vl.c
+++ b/vl.c
@@ -1111,6 +1111,16 @@  static int powerdown_requested;
 int debug_requested;
 int vmstop_requested;
 
+int qemu_shutdown_requested_get(void)
+{
+    return shutdown_requested;
+}
+
+int qemu_reset_requested_get(void)
+{
+    return reset_requested;
+}
+
 int qemu_shutdown_requested(void)
 {
     int r = shutdown_requested;