qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Umesh Deshpande <udeshpan@redhat.com>
To: kvm@vger.kernel.org, qemu-devel@nongnu.org
Cc: Umesh Deshpande <udeshpan@redhat.com>
Subject: [Qemu-devel] [PATCH 1/5] Support for vm_stop from the migration thread
Date: Sat, 27 Aug 2011 14:09:44 -0400	[thread overview]
Message-ID: <2e43e3a409b7fa5f4781e30f3d7b7e56aa5d1fb0.1314398066.git.udeshpan@redhat.com> (raw)
In-Reply-To: <cover.1314398066.git.udeshpan@redhat.com>

Currently, when any thread other than iothread calls vm_stop, it is scheduled to
be executed later by the iothread. This patch allows the execution of vm_stop
from threads other than iothread. This is especially helpful when the migration is
moved into a separate thread.

Signed-off-by: Umesh Deshpande <udeshpan@redhat.com>
---
 cpus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpus.c b/cpus.c
index de70e02..f35f683 100644
--- a/cpus.c
+++ b/cpus.c
@@ -122,8 +122,8 @@ static void do_vm_stop(int reason)
 {
     if (vm_running) {
         cpu_disable_ticks();
-        vm_running = 0;
         pause_all_vcpus();
+        vm_running = 0;
         vm_state_notify(0, reason);
         qemu_aio_flush();
         bdrv_flush_all();
@@ -1027,7 +1027,7 @@ void cpu_stop_current(void)
 
 void vm_stop(int reason)
 {
-    if (!qemu_thread_is_self(&io_thread)) {
+    if (cpu_single_env) {
         qemu_system_vmstop_request(reason);
         /*
          * FIXME: should not return to device code in case
-- 
1.7.4.1

  reply	other threads:[~2011-08-27 18:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 18:09 [Qemu-devel] [PATCH 0/5] Separate thread for VM migration Umesh Deshpande
2011-08-27 18:09 ` Umesh Deshpande [this message]
2011-08-29 16:56   ` [Qemu-devel] [PATCH 1/5] Support for vm_stop from the migration thread Marcelo Tosatti
2011-08-30  8:40     ` Paolo Bonzini
2011-08-27 18:09 ` [Qemu-devel] [PATCH 2/5] MRU ram block list Umesh Deshpande
2011-08-27 18:09 ` [Qemu-devel] [PATCH 3/5] Migration thread mutex Umesh Deshpande
2011-08-29  9:04   ` Stefan Hajnoczi
2011-08-29 13:49     ` Umesh Deshpande
2011-08-29 18:40   ` Marcelo Tosatti
2011-08-27 18:09 ` [Qemu-devel] [PATCH 4/5] Separate migration dirty bitmap Umesh Deshpande
2011-08-27 18:09 ` [Qemu-devel] [PATCH 5/5] Separate migration thread Umesh Deshpande
2011-08-29  9:09   ` Stefan Hajnoczi
2011-08-29 13:49     ` Umesh Deshpande
2011-08-29 18:49   ` Marcelo Tosatti
2011-08-30  8:48     ` Paolo Bonzini
2011-08-30 12:31       ` Marcelo Tosatti
2011-08-29 10:20 ` [Qemu-devel] [PATCH 0/5] Separate thread for VM migration Paolo Bonzini
2011-08-31  3:53   ` Umesh Deshpande

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=2e43e3a409b7fa5f4781e30f3d7b7e56aa5d1fb0.1314398066.git.udeshpan@redhat.com \
    --to=udeshpan@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).