From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRVCo-0001vy-Ch for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:25:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRVCm-0001ud-Rl for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:25:01 -0500 Received: from [199.232.76.173] (port=41645 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRVCl-0001uP-Rg for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:24:59 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51804) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRV0j-00045J-SO for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:12:34 -0500 Received: from mx2.suse.de ([195.135.220.15]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRUY7-0007pM-Jg for qemu-devel@nongnu.org; Mon, 26 Jan 2009 11:42:59 -0500 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 6EADE466AA for ; Mon, 26 Jan 2009 17:41:58 +0100 (CET) From: Alexander Graf Date: Mon, 26 Jan 2009 17:41:57 +0100 Message-Id: <1232988117-8935-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] Check if the i8254 timer is active before deactivating it Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The HPET emulation can disable the i8254 when the HPET is in legacy mode, thus emulating the i8254's behavior. But if it does, the i8254 doesn't have to be running, so let's check to see if the timer works and not disable it if it's not. This fixes a segmentation fault when running Mac OS X as guest os. Signed-off-by: Alexander Graf --- hw/i8254.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/hw/i8254.c b/hw/i8254.c index a4a1efe..44e4531 100644 --- a/hw/i8254.c +++ b/hw/i8254.c @@ -467,7 +467,8 @@ static void pit_reset(void *opaque) void hpet_pit_disable(void) { PITChannelState *s; s = &pit_state.channels[0]; - qemu_del_timer(s->irq_timer); + if (s->irq_timer) + qemu_del_timer(s->irq_timer); } /* When HPET is reset or leaving legacy mode, it must reenable i8254 -- 1.6.0.2