From patchwork Sat Aug 27 18:09:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umesh Deshpande X-Patchwork-Id: 1105082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7RIIRiK021540 for ; Sat, 27 Aug 2011 18:18:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168Ab1H0SSV (ORCPT ); Sat, 27 Aug 2011 14:18:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18000 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080Ab1H0SL6 (ORCPT ); Sat, 27 Aug 2011 14:11:58 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7RIBuFF001439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 27 Aug 2011 14:11:56 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7RIBtkJ027982; Sat, 27 Aug 2011 14:11:55 -0400 Received: from umeshhome.redhat.com (vpn-11-120.rdu.redhat.com [10.11.11.120]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p7RIBs8w009125; Sat, 27 Aug 2011 14:11:55 -0400 From: Umesh Deshpande To: kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: Umesh Deshpande Subject: [PATCH 1/5] Support for vm_stop from the migration thread Date: Sat, 27 Aug 2011 14:09:44 -0400 Message-Id: <2e43e3a409b7fa5f4781e30f3d7b7e56aa5d1fb0.1314398066.git.udeshpan@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 27 Aug 2011 18:18:27 +0000 (UTC) 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 --- 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