From patchwork Tue Sep 11 19:10:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 183194 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C6A632C0088 for ; Wed, 12 Sep 2012 06:22:33 +1000 (EST) Received: from localhost ([::1]:50357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWoD-000882-1k for incoming@patchwork.ozlabs.org; Tue, 11 Sep 2012 16:11:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWnS-0005uv-Rc for qemu-devel@nongnu.org; Tue, 11 Sep 2012 16:10:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBWnO-0006pF-Qt for qemu-devel@nongnu.org; Tue, 11 Sep 2012 16:10:58 -0400 Received: from hall.aurel32.net ([88.191.126.93]:45858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBWnO-0006oy-IT for qemu-devel@nongnu.org; Tue, 11 Sep 2012 16:10:54 -0400 Received: from [37.160.6.220] (helo=ohm.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TBWVo-0005ZT-Vw; Tue, 11 Sep 2012 21:52:45 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.80) (envelope-from ) id 1TBVrB-0004sd-43; Tue, 11 Sep 2012 21:10:45 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Tue, 11 Sep 2012 21:10:29 +0200 Message-Id: <1347390642-17434-5-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1347390642-17434-1-git-send-email-aurelien@aurel32.net> References: <1347390642-17434-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 88.191.126.93 Cc: Anthony Liguori , Gerd Hoffmann , Aurelien Jarno Subject: [Qemu-devel] [PATCH v3 04/17] vl.c: check for qxl availability 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 Check for qxl availability in vl.c. This will allow to remove #ifdef CONFIG_SPICE .. #endif later in this series Cc: Anthony Liguori Cc: Gerd Hoffmann Signed-off-by: Aurelien Jarno --- vl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index f7eed7a..ba2fa9f 100644 --- a/vl.c +++ b/vl.c @@ -1704,6 +1704,11 @@ static bool vmware_vga_available(void) return object_class_by_name("vmware-svga"); } +static bool qxl_vga_available(void) +{ + return object_class_by_name("qxl-vga"); +} + static void select_vgahw (const char *p) { const char *opts; @@ -1733,7 +1738,12 @@ static void select_vgahw (const char *p) } else if (strstart(p, "xenfb", &opts)) { vga_interface_type = VGA_XENFB; } else if (strstart(p, "qxl", &opts)) { - vga_interface_type = VGA_QXL; + if (qxl_vga_available()) { + vga_interface_type = VGA_QXL; + } else { + fprintf(stderr, "Error: QXL VGA not available\n"); + exit(0); + } } else if (!strstart(p, "none", &opts)) { invalid_vga: fprintf(stderr, "Unknown vga type: %s\n", p);