qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhang <zhlcindy@linux.vnet.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>,
	Blue Swirl <blauwirbel@gmail.com>,
	"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>,
	"zhlcindy@gmail.com" <zhlcindy@gmail.com>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] commit 094b287 "Add USB option in machine options" broke i386 -usb
Date: Fri, 23 Nov 2012 00:43:43 +0800	[thread overview]
Message-ID: <50AE563F.3070509@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAFEAcA88w7ng0JgK_nZwUnfr-mk4w7ofmCTRhN0OMwjCEdRqmw@mail.gmail.com>

On 2012年11月23日 00:39, Peter Maydell wrote:
> On 22 November 2012 16:34, Li Zhang <zhlcindy@linux.vnet.ibm.com> wrote:
>> On 2012年11月23日 00:18, Peter Maydell wrote:
>>> On 29 October 2012 10:25, Alexander Graf <agraf@suse.de> wrote:
>>>> From: zhlcindy@gmail.com <zhlcindy@gmail.com>
>>>>
>>>> When -usb option is used, global varible usb_enabled is set.
>>>> And all the plaform will create one USB controller according
>>>> to this variable. In fact, global varibles make code hard
>>>> to read.
>>>>
>>>> So this patch is to remove global variable usb_enabled and
>>>> add USB option in machine options. All the plaforms will get
>>>> USB option value from machine options.
>>>>
>>>> USB option of machine options will be set either by:
>>>>     * -usb
>>>>     * -machine type=pseries,usb=on
>>>>
>>>> Both these ways can work now. They both set USB option in
>>>> machine options. In the future, the first way will be removed.
>>> This commit breaks "qemu-system-i386 -usb", which used to
>>> create a USB bus and now does not. Example to reproduce:
>>>
>>> $ dd if=/dev/zero bs=4096 count=1024 of=usb.img
>>> $ ./i386-softmmu/qemu-system-i386 -clock unix -monitor stdio -usb
>>> -drive if=none,file=usb.img,id=myusb  -device
>>> usb-storage,id=myusb,drive=myusb,removable=on
>> Hi Peter,
>>
>> I am sorry to cause this problem.
>>
>> I couldn't see  the machine's option in your command line.
>> such as, -machine type=pc
>>
>> As it describes, you need to pass this option to enable USB.
>> Because USB option is set by machine's option.
> We use "-usb" to enable USB in this command line. That has
> to continue to work, for back compatibility. I think your
> code to try to support -usb is broken:
>    case QEMU_OPTION_usb:
>      machine_opts = qemu_opts_find(qemu_find_opts("machine"), 0);
>
> will return NULL if there are no user-set machine opts
> at this point, so we never go on to try to set the usb
> machine opt to true.
Yes, you are right, which cause this problem.
Do you think it's better to enabled USB even if there is no machine 
option in command line?
>
> -- PMM
>


-- 

Li Zhang
IBM China Linux Technology Centre

  reply	other threads:[~2012-11-22 16:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-22 16:18 [Qemu-devel] commit 094b287 "Add USB option in machine options" broke i386 -usb Peter Maydell
2012-11-22 16:34 ` Li Zhang
2012-11-22 16:39   ` Peter Maydell
2012-11-22 16:43     ` Li Zhang [this message]
2012-11-22 16:44     ` Alexander Graf
2012-11-22 16:48       ` Li Zhang
2012-11-22 16:49     ` Peter Maydell
2012-11-22 16:50       ` Li Zhang

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=50AE563F.3070509@linux.vnet.ibm.com \
    --to=zhlcindy@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=zhlcindy@gmail.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).