Received: from eggs.gnu.org ([2001:4830:134:3::10]:40163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOBmb-00089n-J0 for qemu-devel@nongnu.org; Thu, 13 Mar 2014 15:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOBmV-00020X-3O for qemu-devel@nongnu.org; Thu, 13 Mar 2014 15:59:13 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 13 Mar 2014 20:58:56 +0100 Message-Id: <1394740736-20771-3-git-send-email-afaerber@suse.de> In-Reply-To: <1394740736-20771-1-git-send-email-afaerber@suse.de> References: <1394740736-20771-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL for-2.0 2/2] spapr: Fix return value of vga initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Mark Wu , qemu-ppc@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Anthony Liguori , Alexander Graf From: Mark Wu 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' Suggested-by: Paolo Bonzini Signed-off-by: Mark Wu Reviewed-by: Paolo Bonzini Signed-off-by: Andreas F=C3=A4rber --- 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) !=3D NULL; default: fprintf(stderr, "This vga model is not supported," "currently it only supports -vga std\n"); exit(0); - break; } } =20 diff --git a/vl.c b/vl.c index 98f6460..842e897 100644 --- a/vl.c +++ b/vl.c @@ -974,7 +974,8 @@ static void parse_name(QemuOpts *opts) =20 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); } =20 #ifndef _WIN32 --=20 1.8.4.5