From patchwork Sun Nov 20 09:31:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mars.cao" X-Patchwork-Id: 126642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C0362B71E9 for ; Sun, 20 Nov 2011 20:31:39 +1100 (EST) Received: from localhost ([::1]:42480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RS3kN-0001y5-FE for incoming@patchwork.ozlabs.org; Sun, 20 Nov 2011 04:31:35 -0500 Received: from eggs.gnu.org ([140.186.70.92]:38719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RS3kH-0001xi-64 for qemu-devel@nongnu.org; Sun, 20 Nov 2011 04:31:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RS3kG-0001iU-EK for qemu-devel@nongnu.org; Sun, 20 Nov 2011 04:31:29 -0500 Received: from [118.186.202.5] (port=61401 helo=oc2115466153.ibm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RS3kF-0001iQ-U8 for qemu-devel@nongnu.org; Sun, 20 Nov 2011 04:31:28 -0500 Received: by oc2115466153.ibm.com (Postfix, from userid 500) id 21A8C3FCB5; Sun, 20 Nov 2011 17:31:11 +0800 (CST) From: "Cao,Bing Bu" To: qemu-devel@nongnu.org Date: Sun, 20 Nov 2011 17:31:08 +0800 Message-Id: <1321781468-11126-1-git-send-email-mars@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1321631238-17330-1-git-send-email-agraf@suse.de> References: <1321631238-17330-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 118.186.202.5 Cc: "Cao,Bing Bu" Subject: [Qemu-devel] [PATCH] creen dump not supported when no console X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org I have tested the issue use "-vga none -nographic" option. QEMU segment faults. But i think there is no any text and graphic console created in this case. The console[0] is NULL. The vga_hw_screen_dump() should return before console_select(). What do you think? --- console.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/console.c b/console.c index f6fe441..957948e 100644 --- a/console.c +++ b/console.c @@ -184,6 +184,9 @@ void vga_hw_screen_dump(const char *filename) console_select(0); if (consoles[0] && consoles[0]->hw_screen_dump) { consoles[0]->hw_screen_dump(consoles[0]->hw, filename); + } else { + fprintf(stderr,"no any console,could not screen dump \n"); + return; } console_select(previous_active_console->index);