qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhang <zhlcindy@gmail.com>
To: Alexander Graf <agraf@suse.de>
Cc: "benh@au1.ibm.com" <benh@au1.ibm.com>,
	"shangw@linux.vnet.ibm.com" <shangw@linux.vnet.ibm.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Li Zhang <zhlcindy@linux.vnet.ibm.com>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"afaerber@suse.de" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [Qemu-ppc][PATCH v5 1/4] Add usb option in machine options
Date: Sun, 8 Jul 2012 22:52:10 +0800	[thread overview]
Message-ID: <CAD8of+oTULAk+wFbt+V57oOb8h3yxMZyPweSU78zVq2zhrUKmA@mail.gmail.com> (raw)
In-Reply-To: <44EB932B-44D7-4433-80E2-DF1C56273954@suse.de>

On Sun, Jul 8, 2012 at 10:45 PM, Alexander Graf <agraf@suse.de> wrote:
>
>
> On 08.07.2012, at 16:21, Li Zhang <zhlcindy@gmail.com> wrote:
>
>> On Fri, Jul 6, 2012 at 9:43 PM, Alexander Graf <agraf@suse.de> wrote:
>>>
>>> On 02.07.2012, at 07:25, zhlcindy@gmail.com wrote:
>>>
>>>> From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
>>>>
>>>> pSeries machine needs to enable USB to add a USB
>>>> keyboard or USB mouse. -usb option won't be used in
>>>> the future, and machine options are a better way to
>>>> enable USB.
>>>>
>>>> So this patch is to add USB option to machine options
>>>> (-machine type=pseries,usb=on/off) to enable/disable
>>>> USB controller. And machines will get the machine option
>>>> and create a USB controller if USB is on.
>>>>
>>>> By the way, USB is on by default on pSeries machine.
>>>> So USB controller should be turned off explicitly through
>>>> the command line for "-nodefault" case as the following:
>>>> -machine type=pseries,usb=off.
>>>>
>>>> Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
>>>> Reviewed-by: Andreas Färber <afaerber@suse.de>
>>>
>>> Shouldn't you also convert -usb over to the new syntax, so that -usb basically is the same as -machine x,usb=on?
>>>
>>   Assumely, -usb and -machine x, usb=on shouldn't be used at the same time.
>>   When using -usb, and -machine x, usb=off, it's a little like to
>> disable the default USB of machine,
>>   and use another specific USB with -usb option.
>>
>>   That's what my understanding. :)
>
> It's not about passing them in at the same time, but about having a single semantic instance where "Do we expose USB?" gets stored. That makes the code easier.
>
> Also if you change things the way I suggested, every platform will be able to use -usb and -machine usb=x. So things become a lot more logical from the command line perspective as well, since a management app can always pass in -machine usb=x and have the same semantics, regardless of the machine we're running on.
>
Got it. I  will change it.
>
> Alex
>
>>
>>>
>>> Alex
>>>
>>>> ---
>>>> hw/spapr.c    |   11 +++++++++++
>>>> qemu-config.c |    4 ++++
>>>> 2 files changed, 15 insertions(+)
>>>>
>>>> diff --git a/hw/spapr.c b/hw/spapr.c
>>>> index 81c9343..973de1b 100644
>>>> --- a/hw/spapr.c
>>>> +++ b/hw/spapr.c
>>>> @@ -575,6 +575,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 add_usb = true;
>>>>
>>>>    spapr = g_malloc0(sizeof(*spapr));
>>>>    QLIST_INIT(&spapr->phbs);
>>>> @@ -710,6 +712,15 @@ 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) {
>>>> +        add_usb = qemu_opt_get_bool(machine_opts, "usb", true);
>>>> +    }
>>>> +
>>>> +    if (add_usb) {
>>>> +        pci_create_simple(QLIST_FIRST(&spapr->phbs)->host_state.bus,
>>>> +                          -1, "pci-ohci");
>>>> +    }
>>>
>>> Didn't I ask you to extract this out to generic code? I don't want to have a "usb" machine opt that is only available for -M pseries.
>>>
>>  OK. I will do that. :)
>>>
>>> Alex
>>>
>>
>>
>>
>> --
>>
>> Best Regards
>> -Li



-- 

Best Regards
-Li

  reply	other threads:[~2012-07-08 14:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02  5:25 [Qemu-devel] [Qemu-ppc][PATCH v5 0/4] Add USB option and enable vga on spapr zhlcindy
2012-07-02  5:25 ` [Qemu-devel] [Qemu-ppc][PATCH v5 1/4] Add usb option in machine options zhlcindy
2012-07-06 13:43   ` Alexander Graf
2012-07-06 15:58     ` Andreas Färber
2012-07-06 16:03       ` Alexander Graf
2012-07-06 16:08         ` Andreas Färber
2012-07-08 14:46         ` Li Zhang
2012-07-08 15:02           ` Alexander Graf
2012-07-08 15:15             ` Li Zhang
2012-07-08 14:21     ` Li Zhang
2012-07-08 14:45       ` Alexander Graf
2012-07-08 14:52         ` Li Zhang [this message]
2012-07-02  5:25 ` [Qemu-devel] [Qemu-ppc][PATCH v5 2/4] Add one new file vga-pci.h zhlcindy
2012-07-03  7:17   ` [Qemu-devel] [Qemu-ppc] [PATCH " Li Zhang
2012-07-02  5:25 ` [Qemu-devel] [Qemu-ppc][PATCH v5 3/4] Cleanup pc.h on other platforms zhlcindy
2012-07-02  5:25 ` [Qemu-devel] [Qemu-ppc][PATCH v5 4/4] spapr: Add support for -vga option zhlcindy
2012-07-06 13:50   ` Alexander Graf
2012-07-06 13:58     ` Andreas Färber
2012-07-08 15:08     ` Li Zhang
2012-07-08 21:54       ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAD8of+oTULAk+wFbt+V57oOb8h3yxMZyPweSU78zVq2zhrUKmA@mail.gmail.com \
    --to=zhlcindy@gmail.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=benh@au1.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=shangw@linux.vnet.ibm.com \
    --cc=zhlcindy@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).