public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: kvm@vger.kernel.org
Cc: avi@redhat.com
Subject: [PATCH] QMP: Emit Basic events
Date: Tue, 26 Jan 2010 18:25:08 -0200	[thread overview]
Message-ID: <20100126182508.3c7186b6@doriath> (raw)


While testing QMP on qemu-kvm I found that it's not emitting basic
events like RESET or POWERDOWN.

The reason is that in QEMU upstream those events are triggered
in QEMU's main loop (ie. vl.c:main_loop()), but control doesn't
reach there in qemu-kvm as it has its own main loop in
qemu-kvm.c:kvm_main_loop().

This commit adds the same set of events there too.

NOTE: The STOP event is not being added because it should be
triggered in vm_stop() and not in the main loop, this will be
fixed upstream.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qemu-kvm.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/qemu-kvm.c b/qemu-kvm.c
index 1c34846..06706c9 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -17,6 +17,7 @@
 #include "block.h"
 #include "compatfd.h"
 #include "gdbstub.h"
+#include "monitor.h"
 
 #include "qemu-kvm.h"
 #include "libkvm.h"
@@ -2124,11 +2125,14 @@ int kvm_main_loop(void)
                 vm_stop(0);
             } else
                 break;
-        } else if (qemu_powerdown_requested())
+        } else if (qemu_powerdown_requested()) {
+            monitor_protocol_event(QEVENT_POWERDOWN, NULL);
             qemu_irq_raise(qemu_system_powerdown);
-        else if (qemu_reset_requested())
+        } else if (qemu_reset_requested()) {
+            monitor_protocol_event(QEVENT_RESET, NULL);
             qemu_kvm_system_reset();
-        else if (kvm_debug_cpu_requested) {
+        } else if (kvm_debug_cpu_requested) {
+            monitor_protocol_event(QEVENT_DEBUG, NULL);
             gdb_set_stop_cpu(kvm_debug_cpu_requested);
             vm_stop(EXCP_DEBUG);
             kvm_debug_cpu_requested = NULL;
-- 
1.6.6


             reply	other threads:[~2010-01-26 20:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 20:25 Luiz Capitulino [this message]
2010-01-27 21:36 ` [PATCH] QMP: Emit Basic events Marcelo Tosatti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100126182508.3c7186b6@doriath \
    --to=lcapitulino@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox