From patchwork Fri Mar 7 09:37:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wu X-Patchwork-Id: 327856 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B2F012C00BE for ; Fri, 7 Mar 2014 20:38:28 +1100 (EST) Received: from localhost ([::1]:35501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLrEY-0002Ql-Jp for incoming@patchwork.ozlabs.org; Fri, 07 Mar 2014 04:38:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLrE0-0002Gb-RD for qemu-devel@nongnu.org; Fri, 07 Mar 2014 04:38:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLrDn-000884-BG for qemu-devel@nongnu.org; Fri, 07 Mar 2014 04:37:52 -0500 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:40174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLrDm-00087a-HZ for qemu-devel@nongnu.org; Fri, 07 Mar 2014 04:37:39 -0500 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Mar 2014 19:37:35 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp02.au.ibm.com (202.81.31.208) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 7 Mar 2014 19:37:33 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 3EA673578054; Fri, 7 Mar 2014 20:37:33 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s279HSfx5636414; Fri, 7 Mar 2014 20:17:28 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s279bWj4028359; Fri, 7 Mar 2014 20:37:32 +1100 Received: from localhost.cn.ibm.com ([9.115.127.81]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s279bRqq028290; Fri, 7 Mar 2014 20:37:30 +1100 From: Mark Wu To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Fri, 7 Mar 2014 17:37:25 +0800 Message-Id: <1394185045-24868-2-git-send-email-wudxw@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1394185045-24868-1-git-send-email-wudxw@linux.vnet.ibm.com> References: <1394185045-24868-1-git-send-email-wudxw@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14030709-5490-0000-0000-0000051B9AC4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 202.81.31.144 Cc: nikunj@linux.vnet.ibm.com, agraf@suse.de, Mark Wu , aliguori@amazon.com, pbonzini@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v2 2/2] Fix return value of vga initlization on ppc 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 Before spapr_vga_init will returned false if the vga is specified by the command '-device VGA' because vga_interface_type was evaluated to VGA_NONE. With the change in previous patch of this series, spapr_vga_init should return true if it's told that the vga will be initialized in flow of the generic devices initialization. This patch also makes two cleanups: 1. skip initialization for VGA_NONE 2. remove the useless 'break' Signed-off-by: Mark Wu --- hw/ppc/spapr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 93d02c1..4d0ac56 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -765,13 +765,15 @@ static int spapr_vga_init(PCIBus *pci_bus) { switch (vga_interface_type) { case VGA_NONE: + return false; + case VGA_DEVICE: + return true; case VGA_STD: return pci_vga_init(pci_bus) != NULL; default: fprintf(stderr, "This vga model is not supported," "currently it only supports -vga std\n"); exit(0); - break; } }