From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSjno-0005q0-LR for qemu-devel@nongnu.org; Tue, 03 Mar 2015 05:11:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSjnl-0004JW-Ce for qemu-devel@nongnu.org; Tue, 03 Mar 2015 05:11:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSjnl-0004J3-4q for qemu-devel@nongnu.org; Tue, 03 Mar 2015 05:11:45 -0500 Message-ID: <54F588D7.6060804@redhat.com> Date: Tue, 03 Mar 2015 11:11:35 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <33183CC9F5247A488A2544077AF1902086E48F40@SZXEMA503-MBS.china.huawei.com> In-Reply-To: <33183CC9F5247A488A2544077AF1902086E48F40@SZXEMA503-MBS.china.huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Bug ?]Qemu segfault because of non-initial kvm_state variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" , "qemu-devel@nongnu.org" On 03/03/2015 09:01, Gonglei (Arei) wrote: > Hi, > > I encountered a Qemu segfault problem in my environment. > > # ./qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 -name redhat6.2 -drive file=/home/win2008_ent_r2_64_01,\ > if=none,id=drive-ide0-0-0 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -vnc :10 > Segmentation fault Should be fixed by: diff --git a/kvm-all.c b/kvm-all.c index 05a79c2..e04a0ca 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1679,7 +1679,7 @@ void kvm_flush_coalesced_mmio_buffer(void) { KVMState *s = kvm_state; - if (s->coalesced_flush_in_progress) { + if (!s || s->coalesced_flush_in_progress) { return; } Paolo