From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1NE-0001cO-Hw for qemu-devel@nongnu.org; Mon, 10 Mar 2014 10:40:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN1N0-0002lE-Ge for qemu-devel@nongnu.org; Mon, 10 Mar 2014 10:40:12 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:37277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN1Mz-0002kK-NK for qemu-devel@nongnu.org; Mon, 10 Mar 2014 10:39:58 -0400 Received: from /spool/local by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Mar 2014 00:39:54 +1000 Message-ID: <531DCEB4.9050109@linux.vnet.ibm.com> Date: Mon, 10 Mar 2014 22:39:48 +0800 From: Mark Wu MIME-Version: 1.0 References: <1394185045-24868-1-git-send-email-wudxw@linux.vnet.ibm.com> <1394185045-24868-2-git-send-email-wudxw@linux.vnet.ibm.com> <531994DF.4000503@redhat.com> In-Reply-To: <531994DF.4000503@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] Fix return value of vga initlization on ppc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org, qemu-ppc@nongnu.org Cc: aliguori@amazon.com, agraf@suse.de, nikunj@linux.vnet.ibm.com, afaerber@suse.de On 03/07/2014 05:43 PM, Paolo Bonzini wrote: > Il 07/03/2014 10:37, Mark Wu ha scritto: >> 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' > I think that after this patch, "-nodefaults -device VGA" will get a USB > controller that it didn't get before. > > Perhaps this in vl.c: > > bool usb_enabled(bool default_usb) > { > return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", default_usb); > } > > should be > > bool usb_enabled(bool default_usb) > { > return qemu_opt_get_bool(qemu_get_machine_opts(), "usb", > !no_defaults && default_usb); > } Yes, it changes the semantics of 'nodefaults'. I will fix it in v3 and let the management app add usb controller. > ? > > Thanks, > > Paolo > >> 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; >> } >> } >> >>