On Wed, Aug 15, 2012 at 10:50:04AM +0800, Li Zhang wrote: > On Wed, Aug 15, 2012 at 9:47 AM, David Gibson <d...@au1.ibm.com> wrote: > > On Wed, Aug 15, 2012 at 09:24:34AM +0800, Li Zhang wrote: > >> On Wed, Aug 15, 2012 at 8:09 AM, Benjamin Herrenschmidt > >> <b...@kernel.crashing.org> wrote: > >> > On Wed, 2012-08-15 at 09:10 +1000, David Gibson wrote: > >> >> > I see. I will redo this patch. Send out it later. :) > >> >> > Thanks for your comments. > >> >> > >> >> When you do that, please also change the default to make spapr _not_ > >> >> have usb. > >> > > >> > FYI, I originally asked for USB as default ... however it looks like at > >> > this stage the price (performance) is too high so either make it default > >> > to OFF, or make it default to ON if and only if VGA is also enabled. > >> > > >> Got it, I change the default as false, and when VGA is enabled, set > >> USB option as true. > > > > Not quite, actually. The default should depend on VGA, but the > > explicit usb= option should always override that. Having VGA without > > USB would be unusual, but it should be possible if you specify it > > explicitly. > > > Right, explicit usb= option will override the value. > I think we can set the usb option value when no usb option is specified. > For example, we use -machine type=pseries without usb= option. > > I am considering as the following: > > if (vga_enabled) { > set_usb_option(true) > }
No, this will override the option given on the command line. > if (usb_enabled(false)) { //If vga is enabled and "-machine > type=pseries" is specified, it will get true. > pci_create_simple(ohci) > } It's much easier than this, you just want if (usb_enabled(vga_enabled)) -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson