qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3]: Monitor queue
@ 2011-06-21 17:57 Luiz Capitulino
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 1/3] error framework: Fix compilation for w32/w64 Luiz Capitulino
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luiz Capitulino @ 2011-06-21 17:57 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel

Anthony,

The following patches have been sent to the list and look good to me. I've
also tested them.

The changes (since eb47d7c5d96060040931c42773ee07e61e547af9) are available
in the following repository:

    git://repo.or.cz/qemu/qmp-unstable.git for-anthony

Jan Kiszka (2):
      Allow silent system resets
      Reset system before loadvm

Stefan Weil (1):
      error framework: Fix compilation for w32/w64

 error.c   |    3 ++-
 error.h   |    3 +--
 savevm.c  |    1 +
 sysemu.h  |    5 ++++-
 vl.c      |   10 ++++++----
 xen-all.c |    2 +-
 6 files changed, 15 insertions(+), 9 deletions(-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/3] error framework: Fix compilation for w32/w64
  2011-06-21 17:57 [Qemu-devel] [PULL 0/3]: Monitor queue Luiz Capitulino
@ 2011-06-21 17:57 ` Luiz Capitulino
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 2/3] Allow silent system resets Luiz Capitulino
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2011-06-21 17:57 UTC (permalink / raw)
  To: aliguori; +Cc: qemu-devel

From: Stefan Weil <weil@mail.berlios.de>

The declaration of function error_set() should use macro GCC_FMT_ATTR
instead of gcc's format printf attribute.

For w32/w64, both declarations are different and GCC_FMT_ATTR is needed.
Compilation for w64 even failed with the original code because mingw64
defines a macro for printf.

GCC_FMT_ATTR requires qemu-common.h, so add it in error.c
(it's also included by error_int.h but too late).

Remove assert.h which is included by qemu-common.h.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 error.c |    3 ++-
 error.h |    3 +--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/error.c b/error.c
index 867eec2..74d7398 100644
--- a/error.c
+++ b/error.c
@@ -9,11 +9,12 @@
  * This work is licensed under the terms of the GNU LGPL, version 2.  See
  * the COPYING.LIB file in the top-level directory.
  */
+
+#include "qemu-common.h"
 #include "error.h"
 #include "error_int.h"
 #include "qemu-objects.h"
 #include "qerror.h"
-#include <assert.h>
 
 struct Error
 {
diff --git a/error.h b/error.h
index 003c855..0f92a6f 100644
--- a/error.h
+++ b/error.h
@@ -25,8 +25,7 @@ typedef struct Error Error;
  * Currently, qerror.h defines these error formats.  This function is not
  * meant to be used outside of QEMU.
  */
-void error_set(Error **err, const char *fmt, ...)
-    __attribute__((format(printf, 2, 3)));
+void error_set(Error **err, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
 
 /**
  * Returns true if an indirect pointer to an error is pointing to a valid
-- 
1.7.6.rc2.11.g13b7

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/3] Allow silent system resets
  2011-06-21 17:57 [Qemu-devel] [PULL 0/3]: Monitor queue Luiz Capitulino
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 1/3] error framework: Fix compilation for w32/w64 Luiz Capitulino
@ 2011-06-21 17:57 ` Luiz Capitulino
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 3/3] Reset system before loadvm Luiz Capitulino
  2011-06-22 12:56 ` [Qemu-devel] [PULL 0/3]: Monitor queue Anthony Liguori
  3 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2011-06-21 17:57 UTC (permalink / raw)
  To: aliguori; +Cc: Jan Kiszka, qemu-devel

From: Jan Kiszka <jan.kiszka@siemens.com>

This allows qemu_system_reset to be issued silently for internal
purposes, ie. without sending out a monitor event. Convert the system
reset after startup to the silent mode.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 sysemu.h  |    5 ++++-
 vl.c      |   10 ++++++----
 xen-all.c |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/sysemu.h b/sysemu.h
index 7e70daa..d3013f5 100644
--- a/sysemu.h
+++ b/sysemu.h
@@ -34,6 +34,9 @@ void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
 #define VMSTOP_LOADVM    7
 #define VMSTOP_MIGRATE   8
 
+#define VMRESET_SILENT   false
+#define VMRESET_REPORT   true
+
 void vm_start(void);
 void vm_stop(int reason);
 
@@ -50,7 +53,7 @@ int qemu_powerdown_requested(void);
 void qemu_system_killed(int signal, pid_t pid);
 void qemu_kill_report(void);
 extern qemu_irq qemu_system_powerdown;
-void qemu_system_reset(void);
+void qemu_system_reset(bool report);
 
 void qemu_add_exit_notifier(Notifier *notify);
 void qemu_remove_exit_notifier(Notifier *notify);
diff --git a/vl.c b/vl.c
index dbdec71..52402a2 100644
--- a/vl.c
+++ b/vl.c
@@ -1253,7 +1253,7 @@ void qemu_unregister_reset(QEMUResetHandler *func, void *opaque)
     }
 }
 
-void qemu_system_reset(void)
+void qemu_system_reset(bool report)
 {
     QEMUResetEntry *re, *nre;
 
@@ -1261,7 +1261,9 @@ void qemu_system_reset(void)
     QTAILQ_FOREACH_SAFE(re, &reset_handlers, entry, nre) {
         re->func(re->opaque);
     }
-    monitor_protocol_event(QEVENT_RESET, NULL);
+    if (report) {
+        monitor_protocol_event(QEVENT_RESET, NULL);
+    }
     cpu_synchronize_all_post_reset();
 }
 
@@ -1403,7 +1405,7 @@ static void main_loop(void)
         if (qemu_reset_requested()) {
             pause_all_vcpus();
             cpu_synchronize_all_states();
-            qemu_system_reset();
+            qemu_system_reset(VMRESET_REPORT);
             resume_all_vcpus();
         }
         if (qemu_powerdown_requested()) {
@@ -3293,7 +3295,7 @@ int main(int argc, char **argv, char **envp)
     qemu_register_reset(qbus_reset_all_fn, sysbus_get_default());
     qemu_run_machine_init_done_notifiers();
 
-    qemu_system_reset();
+    qemu_system_reset(VMRESET_SILENT);
     if (loadvm) {
         if (load_vmstate(loadvm) < 0) {
             autostart = 0;
diff --git a/xen-all.c b/xen-all.c
index 0eac202..41fd98a 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -452,7 +452,7 @@ static void cpu_handle_ioreq(void *opaque)
                 destroy_hvm_domain();
             }
             if (qemu_reset_requested_get()) {
-                qemu_system_reset();
+                qemu_system_reset(VMRESET_REPORT);
             }
         }
 
-- 
1.7.6.rc2.11.g13b7

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 3/3] Reset system before loadvm
  2011-06-21 17:57 [Qemu-devel] [PULL 0/3]: Monitor queue Luiz Capitulino
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 1/3] error framework: Fix compilation for w32/w64 Luiz Capitulino
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 2/3] Allow silent system resets Luiz Capitulino
@ 2011-06-21 17:57 ` Luiz Capitulino
  2011-06-22 12:56 ` [Qemu-devel] [PULL 0/3]: Monitor queue Anthony Liguori
  3 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2011-06-21 17:57 UTC (permalink / raw)
  To: aliguori; +Cc: Jan Kiszka, qemu-devel

From: Jan Kiszka <jan.kiszka@siemens.com>

In case we load the vmstate during incoming migration, we start from a
clean, default machine state as we went through system reset before. But
if we load from a snapshot, the machine can be in any state. That can
cause troubles if loading an older image which does not carry all state
information the executing QEMU requires. Hardly any device takes care of
this scenario.

However, fixing this is trivial. We just need to issue a system reset
during loadvm as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 savevm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/savevm.c b/savevm.c
index 939845c..8139bc7 100644
--- a/savevm.c
+++ b/savevm.c
@@ -2073,6 +2073,7 @@ int load_vmstate(const char *name)
         return -EINVAL;
     }
 
+    qemu_system_reset(VMRESET_SILENT);
     ret = qemu_loadvm_state(f);
 
     qemu_fclose(f);
-- 
1.7.6.rc2.11.g13b7

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PULL 0/3]: Monitor queue
  2011-06-21 17:57 [Qemu-devel] [PULL 0/3]: Monitor queue Luiz Capitulino
                   ` (2 preceding siblings ...)
  2011-06-21 17:57 ` [Qemu-devel] [PATCH 3/3] Reset system before loadvm Luiz Capitulino
@ 2011-06-22 12:56 ` Anthony Liguori
  3 siblings, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2011-06-22 12:56 UTC (permalink / raw)
  To: Luiz Capitulino; +Cc: qemu-devel

On 06/21/2011 12:57 PM, Luiz Capitulino wrote:
> Anthony,
>
> The following patches have been sent to the list and look good to me. I've
> also tested them.

Pulled.  Thanks.

Regards,

Anthony Liguori

>
> The changes (since eb47d7c5d96060040931c42773ee07e61e547af9) are available
> in the following repository:
>
>      git://repo.or.cz/qemu/qmp-unstable.git for-anthony
>
> Jan Kiszka (2):
>        Allow silent system resets
>        Reset system before loadvm
>
> Stefan Weil (1):
>        error framework: Fix compilation for w32/w64
>
>   error.c   |    3 ++-
>   error.h   |    3 +--
>   savevm.c  |    1 +
>   sysemu.h  |    5 ++++-
>   vl.c      |   10 ++++++----
>   xen-all.c |    2 +-
>   6 files changed, 15 insertions(+), 9 deletions(-)
>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-22 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-21 17:57 [Qemu-devel] [PULL 0/3]: Monitor queue Luiz Capitulino
2011-06-21 17:57 ` [Qemu-devel] [PATCH 1/3] error framework: Fix compilation for w32/w64 Luiz Capitulino
2011-06-21 17:57 ` [Qemu-devel] [PATCH 2/3] Allow silent system resets Luiz Capitulino
2011-06-21 17:57 ` [Qemu-devel] [PATCH 3/3] Reset system before loadvm Luiz Capitulino
2011-06-22 12:56 ` [Qemu-devel] [PULL 0/3]: Monitor queue Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).