Received: from eggs.gnu.org ([208.118.235.92]:35174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1aNh-0001cU-S9 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 05:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1aNg-0006xv-KY for qemu-devel@nongnu.org; Wed, 15 Aug 2012 05:59:17 -0400 From: Alexander Graf Date: Wed, 15 Aug 2012 11:58:50 +0200 Message-Id: <1345024742-18394-13-git-send-email-agraf@suse.de> In-Reply-To: <1345024742-18394-1-git-send-email-agraf@suse.de> References: <1345024742-18394-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 12/24] PPC: spapr: Rework VGA select logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc Mailing List Cc: Blue Swirl , qemu-devel qemu-devel , Aurelien Jarno When selecting our VGA adapter, we want to: * fail completely when we can't satisfy the user's request * support -nographic where no VGA adapter should be spawned This patch reworks the logic so we fulfill the two conditions above. Signed-off-by: Alexander Graf --- hw/spapr.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/spapr.c b/hw/spapr.c index 494c412..709673e 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -563,16 +563,21 @@ static void spapr_cpu_reset(void *opaque) cpu_reset(CPU(cpu)); } +/* Returns whether we want to use VGA or not */ static int spapr_vga_init(PCIBus *pci_bus) { - if (std_vga_enabled) { + switch (vga_interface_type) { + case VGA_STD: pci_vga_init(pci_bus); - } else { + return 1; + case VGA_NONE: + return 0; + default: fprintf(stderr, "This vga model is not supported," "currently it only supports -vga std\n"); - return 0; + exit(0); + break; } - return 1; } /* pSeries LPAR / sPAPR hardware init */ -- 1.6.0.2