diff options
author | Mark Wu <wudxw@linux.vnet.ibm.com> | 2014-03-10 22:37:41 +0800 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-03-13 20:53:28 +0100 |
commit | 7effdaa32198b7077c51e29621dfca3d1b14e420 (patch) | |
tree | 235f5be06462aebc505e5c7e5832dc87ceda321f /hw/ppc | |
parent | d44229c54f7477035c7e914dd12c84e01bbd4123 (diff) | |
download | qemu-7effdaa32198b7077c51e29621dfca3d1b14e420.tar.gz qemu-7effdaa32198b7077c51e29621dfca3d1b14e420.tar.bz2 qemu-7effdaa32198b7077c51e29621dfca3d1b14e420.zip |
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>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index bf46c380ec..5c9a154d6a 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; } } |