From patchwork Mon Oct 26 18:46:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 55955 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9QIpuFi020749 for ; Mon, 26 Oct 2009 18:51:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754302AbZJZSve (ORCPT ); Mon, 26 Oct 2009 14:51:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754296AbZJZSve (ORCPT ); Mon, 26 Oct 2009 14:51:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15560 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753640AbZJZSvd (ORCPT ); Mon, 26 Oct 2009 14:51:33 -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.13.8/8.13.8) with ESMTP id n9QIpcks028810 for ; Mon, 26 Oct 2009 14:51:38 -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 n9QIpbQl014619; Mon, 26 Oct 2009 14:51:38 -0400 Received: from amt.cnet (vpn-10-126.str.redhat.com [10.32.10.126]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n9QIpZlP018664; Mon, 26 Oct 2009 14:51:36 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id D9F3B5880F8; Mon, 26 Oct 2009 16:46:03 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id n9QIk2BF006462; Mon, 26 Oct 2009 16:46:02 -0200 Date: Mon, 26 Oct 2009 16:46:02 -0200 From: Marcelo Tosatti To: Avi Kivity Cc: kvm Subject: fix qemu-kvm sigsegv at exit Message-ID: <20091026184602.GB6016@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) 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 diff --git a/qemu-kvm.c b/qemu-kvm.c index 4c13628..ab8f0e4 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1868,7 +1868,8 @@ static int kvm_main_loop_cpu(CPUState *env) } if (run_cpu) { kvm_main_loop_wait(env, 0); - kvm_cpu_exec(env); + if (!is_cpu_stopped(env)) + kvm_cpu_exec(env); } else { kvm_main_loop_wait(env, 1000); }