From patchwork Mon Mar 10 14:37:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wu X-Patchwork-Id: 328587 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 DD88E2C00A3 for ; Tue, 11 Mar 2014 01:39:35 +1100 (EST) Received: from localhost ([::1]:49133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1Mb-0000BV-Gy for incoming@patchwork.ozlabs.org; Mon, 10 Mar 2014 10:39:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1LM-0007In-Ds for qemu-devel@nongnu.org; Mon, 10 Mar 2014 10:38:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN1L7-0002BI-Q8 for qemu-devel@nongnu.org; Mon, 10 Mar 2014 10:38:16 -0400 Received: from e28smtp08.in.ibm.com ([122.248.162.8]:43520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1L7-0002Ak-8E for qemu-devel@nongnu.org; Mon, 10 Mar 2014 10:38:01 -0400 Received: from /spool/local by e28smtp08.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 10 Mar 2014 20:07:58 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp08.in.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 10 Mar 2014 20:07:55 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 836631258044; Mon, 10 Mar 2014 20:10:08 +0530 (IST) Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s2AEbwQQ7668134; Mon, 10 Mar 2014 20:07:58 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s2AEbsDM013571; Mon, 10 Mar 2014 20:07:54 +0530 Received: from localhost.localdomain ([9.125.29.78]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s2AEbkNF013108; Mon, 10 Mar 2014 20:07:51 +0530 From: Mark Wu To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org Date: Mon, 10 Mar 2014 22:37:41 +0800 Message-Id: <1394462261-25581-2-git-send-email-wudxw@linux.vnet.ibm.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1394462261-25581-1-git-send-email-wudxw@linux.vnet.ibm.com> References: <1394462261-25581-1-git-send-email-wudxw@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14031014-2000-0000-0000-0000101A137C X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.8 Cc: nikunj@linux.vnet.ibm.com, agraf@suse.de, Mark Wu , aliguori@amazon.com, pbonzini@redhat.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v3 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. To keep '-nodefaults' have the semantics of bare minimum, it adds a check of 'has_defaults' in usb_enabled() to avoid that a USB controller is added by '-nodefautls, -device VGA' implicitly. This patch also makes two cleanups: 1. skip initialization for VGA_NONE 2. remove the useless 'break' Signed-off-by: Mark Wu Reviewed-by: Paolo Bonzini --- hw/ppc/spapr.c | 4 +++- vl.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bf46c38..5c9a154 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -781,13 +781,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; } } diff --git a/vl.c b/vl.c index f8f7c00..e9d8baf 100644 --- a/vl.c +++ b/vl.c @@ -932,7 +932,8 @@ static int parse_sandbox(QemuOpts *opts, void *opaque) bool usb_enabled(bool default_usb) { - return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", default_usb); + return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", + has_defaults && default_usb); } #ifndef _WIN32