From patchwork Mon Jun 21 09:01:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 107150 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o5L920AR020494 for ; Mon, 21 Jun 2010 09:02:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757357Ab0FUJB7 (ORCPT ); Mon, 21 Jun 2010 05:01:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26995 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756308Ab0FUJB6 (ORCPT ); Mon, 21 Jun 2010 05:01:58 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5L91wNe028800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 Jun 2010 05:01:58 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5L91qDn029332; Mon, 21 Jun 2010 05:01:53 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 4D244133D53; Mon, 21 Jun 2010 12:01:52 +0300 (IDT) Date: Mon, 21 Jun 2010 12:01:52 +0300 From: Gleb Natapov To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] do not enter vcpu again if it was stopped during IO Message-ID: <20100621090152.GG4689@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 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.3 (demeter.kernel.org [140.211.167.41]); Mon, 21 Jun 2010 09:02:01 +0000 (UTC) diff --git a/qemu-kvm.c b/qemu-kvm.c index be1dac2..4f7cf6d 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -603,6 +603,10 @@ int kvm_run(CPUState *env) r = pre_kvm_run(kvm, env); if (r) return r; + if (env->exit_request) { + env->exit_request = 0; + pthread_kill(env->kvm_cpu_state.thread, SIG_IPI); + } r = ioctl(fd, KVM_RUN, 0); if (r == -1 && errno != EINTR && errno != EAGAIN) { diff --git a/vl.c b/vl.c index 9e9c176..dcfab13 100644 --- a/vl.c +++ b/vl.c @@ -1817,6 +1817,7 @@ void qemu_system_reset_request(void) } if (cpu_single_env) { cpu_single_env->stopped = 1; + cpu_exit(cpu_single_env); } qemu_notify_event(); }