spapr: Fix return value of vga initialization
authorMark Wu <wudxw@linux.vnet.ibm.com>
Mon, 10 Mar 2014 14:37:41 +0000 (22:37 +0800)
committerAndreas Färber <afaerber@suse.de>
Thu, 13 Mar 2014 19:53:28 +0000 (20:53 +0100)
commit7effdaa32198b7077c51e29621dfca3d1b14e420
tree235f5be06462aebc505e5c7e5832dc87ceda321f
parentd44229c54f7477035c7e914dd12c84e01bbd4123
spapr: Fix return value of vga initialization

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 <pbonzini@redhat.com>
Signed-off-by: Mark Wu <wudxw@linux.vnet.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/ppc/spapr.c
vl.c