* Re: [Qemu-devel] [PATCHv3 1/1] Add usb option in machine options to enable/disable usb [not found] <1339814432-750-1-git-send-email-zhlcindy@linux.vnet.ibm.com> @ 2012-06-15 22:51 ` Benjamin Herrenschmidt 2012-06-18 2:13 ` [Qemu-devel] [Qemu-ppc] " Li Zhang 0 siblings, 1 reply; 2+ messages in thread From: Benjamin Herrenschmidt @ 2012-06-15 22:51 UTC (permalink / raw) To: Li Zhang; +Cc: armbru, aliguori, qemu-ppc, qemu-devel, afaerber On Fri, 2012-06-15 at 22:40 -0400, Li Zhang wrote: > For pseries machine, it needs to enable usb to add > keyboard or usb mouse. -usb option won't be used in > the future, and machine options is a better way to > enable usb. Patch looks much better. Now, should we also create the default keyboard and mouse ? After all that's the whole point of creating the default OHCI to begin with .... Also, feel free to pickup my internal patch for enabling -vga, removing the USB bits from it and submitting it too, that way we get both pieces of the puzzle together. Cheers, Ben. > So this patch is to add usb option to machine options > (-machine type=psereis,usb=on/off)to enable/disable > usb controller. > > For specific machines, they will get the machine option > and then create usb controller according to usb option. > > In this patch, usb is on by default on pseries. > So, for -nodefault,usb should be set off in the command > line as the following: > -machine type=pseries,usb=off. > > Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> > --- > hw/spapr.c | 10 ++++++++++ > qemu-config.c | 4 ++++ > 2 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/hw/spapr.c b/hw/spapr.c > index d0bddbc..8d158d7 100644 > --- a/hw/spapr.c > +++ b/hw/spapr.c > @@ -529,6 +529,8 @@ static void ppc_spapr_init(ram_addr_t ram_size, > long load_limit, rtas_limit, fw_size; > long pteg_shift = 17; > char *filename; > + QemuOpts * machine_opts; > + bool usb_on = false; > > spapr = g_malloc0(sizeof(*spapr)); > QLIST_INIT(&spapr->phbs); > @@ -661,6 +663,14 @@ static void ppc_spapr_init(ram_addr_t ram_size, > spapr_vscsi_create(spapr->vio_bus); > } > > + machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0); > + if (machine_opts) > + usb_on = qemu_opt_get_bool(machine_opts, "usb", true); > + > + if (usb_on == true) { > + pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus, > + -1, "pci-ohci"); > + } > if (rma_size < (MIN_RMA_SLOF << 20)) { > fprintf(stderr, "qemu: pSeries SLOF firmware requires >= " > "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF); > diff --git a/qemu-config.c b/qemu-config.c > index bb3bff4..cdab765 100644 > --- a/qemu-config.c > +++ b/qemu-config.c > @@ -583,6 +583,10 @@ static QemuOptsList qemu_machine_opts = { > .name = "dtb", > .type = QEMU_OPT_STRING, > .help = "Linux kernel device tree file", > + },{ > + .name = "usb", > + .type = QEMU_OPT_BOOL, > + .help = "Set on/off to enable/disable usb", > }, > { /* End of list */ } > }, ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCHv3 1/1] Add usb option in machine options to enable/disable usb 2012-06-15 22:51 ` [Qemu-devel] [PATCHv3 1/1] Add usb option in machine options to enable/disable usb Benjamin Herrenschmidt @ 2012-06-18 2:13 ` Li Zhang 0 siblings, 0 replies; 2+ messages in thread From: Li Zhang @ 2012-06-18 2:13 UTC (permalink / raw) To: Benjamin Herrenschmidt Cc: aliguori, armbru, Li Zhang, qemu-devel, qemu-ppc, afaerber On Sat, Jun 16, 2012 at 6:51 AM, Benjamin Herrenschmidt <benh@au1.ibm.com> wrote: > On Fri, 2012-06-15 at 22:40 -0400, Li Zhang wrote: >> For pseries machine, it needs to enable usb to add >> keyboard or usb mouse. -usb option won't be used in >> the future, and machine options is a better way to >> enable usb. > > Patch looks much better. Now, should we also create the default keyboard > and mouse ? After all that's the whole point of creating the default > OHCI to begin with .... OK. I think I should send the patch with vga enablement together. That seems to be more reasonable. :) > > Also, feel free to pickup my internal patch for enabling -vga, removing > the USB bits from it and submitting it too, that way we get both pieces > of the puzzle together. OK. I will send out this together with vga patch. > > Cheers, > Ben. > >> So this patch is to add usb option to machine options >> (-machine type=psereis,usb=on/off)to enable/disable >> usb controller. >> >> For specific machines, they will get the machine option >> and then create usb controller according to usb option. >> >> In this patch, usb is on by default on pseries. >> So, for -nodefault,usb should be set off in the command >> line as the following: >> -machine type=pseries,usb=off. >> >> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com> >> --- >> hw/spapr.c | 10 ++++++++++ >> qemu-config.c | 4 ++++ >> 2 files changed, 14 insertions(+), 0 deletions(-) >> >> diff --git a/hw/spapr.c b/hw/spapr.c >> index d0bddbc..8d158d7 100644 >> --- a/hw/spapr.c >> +++ b/hw/spapr.c >> @@ -529,6 +529,8 @@ static void ppc_spapr_init(ram_addr_t ram_size, >> long load_limit, rtas_limit, fw_size; >> long pteg_shift = 17; >> char *filename; >> + QemuOpts * machine_opts; >> + bool usb_on = false; >> >> spapr = g_malloc0(sizeof(*spapr)); >> QLIST_INIT(&spapr->phbs); >> @@ -661,6 +663,14 @@ static void ppc_spapr_init(ram_addr_t ram_size, >> spapr_vscsi_create(spapr->vio_bus); >> } >> >> + machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0); >> + if (machine_opts) >> + usb_on = qemu_opt_get_bool(machine_opts, "usb", true); >> + >> + if (usb_on == true) { >> + pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus, >> + -1, "pci-ohci"); >> + } >> if (rma_size < (MIN_RMA_SLOF << 20)) { >> fprintf(stderr, "qemu: pSeries SLOF firmware requires >= " >> "%ldM guest RMA (Real Mode Area memory)\n", MIN_RMA_SLOF); >> diff --git a/qemu-config.c b/qemu-config.c >> index bb3bff4..cdab765 100644 >> --- a/qemu-config.c >> +++ b/qemu-config.c >> @@ -583,6 +583,10 @@ static QemuOptsList qemu_machine_opts = { >> .name = "dtb", >> .type = QEMU_OPT_STRING, >> .help = "Linux kernel device tree file", >> + },{ >> + .name = "usb", >> + .type = QEMU_OPT_BOOL, >> + .help = "Set on/off to enable/disable usb", >> }, >> { /* End of list */ } >> }, > > > -- Best Regards -Li ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-18 2:13 UTC | newest] Thread overview: 2+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1339814432-750-1-git-send-email-zhlcindy@linux.vnet.ibm.com> 2012-06-15 22:51 ` [Qemu-devel] [PATCHv3 1/1] Add usb option in machine options to enable/disable usb Benjamin Herrenschmidt 2012-06-18 2:13 ` [Qemu-devel] [Qemu-ppc] " Li Zhang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).