On 03/07/2014 08: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.
I suspect what was meant by "the machine not aware of the graphics device" is that the guest won't work with VGA and without keyboard (default console will be vga + keyboard and not serial) which is USB and this is why the patch is trying to add USB. > > 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); > } > > ? > > Thanks, > > Paolo > >> Signed-off-by: Mark Wu <wu...@linux.vnet.ibm.com> >> --- >> 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; >> } >> } >> >> > > -- Alexey