qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Andrzej Zaborowski <balrogg@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] vl: Eliminate usb_enabled()
Date: Wed, 8 Jun 2016 14:13:30 -0300	[thread overview]
Message-ID: <20160608171330.GP18662@thinpad.lan.raisama.net> (raw)
In-Reply-To: <CAFEAcA-=ypKELaXnS=cEJ5QTRswPX00ZNM4OOW_7sqQTsMdEFw@mail.gmail.com>

On Wed, Jun 08, 2016 at 02:34:16PM +0100, Peter Maydell wrote:
> On 8 June 2016 at 12:48, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > ----- Original Message -----
> >> From: "Marcel Apfelbaum" <marcel@redhat.com>
> >> To: "Eduardo Habkost" <ehabkost@redhat.com>, qemu-devel@nongnu.org
> >> Cc: "Paolo Bonzini" <pbonzini@redhat.com>, "Andrzej Zaborowski" <balrogg@gmail.com>, "Peter Maydell"
> >> <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, "Alexander Graf" <agraf@suse.de>
> >> Sent: Wednesday, June 8, 2016 1:25:41 PM
> >> Subject: Re: [PATCH] vl: Eliminate usb_enabled()
> >>
> >> On 06/07/2016 07:56 PM, Eduardo Habkost wrote:
> >> > @@ -2062,6 +2063,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space,
> >> >       int i;
> >> >       DriveInfo *dinfo;
> >> >       s = g_new0(PXA2xxState, 1);
> >> > +    MachineState *machine = MACHINE(qdev_get_machine());
> >> >
> >>
> >> All the callers of pxa270_init have a reference to the machine,
> >> you can pass it as parameter IMO.
> >
> > Another possibility is to pass a "bool usb_enabled" argument.
> 
> Or we could just create the USB controller always -- this
> is a part of the SoC, not a removable pluggable device,
> so it doesn't make much sense for the user to be able
> to create a system where it's not present.

If you think this is better, I will do it and send v2. It will
make things simpler.

BTW, I am working on a series to refactor all the *_enabled/no_*
code. I will take this into account and add something that will
warn the user if they try to enable something that is never
present in the machine, or disable something that is always
present.

-- 
Eduardo

      reply	other threads:[~2016-06-08 17:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 16:56 [Qemu-devel] [PATCH] vl: Eliminate usb_enabled() Eduardo Habkost
2016-06-08 11:25 ` Marcel Apfelbaum
2016-06-08 11:48   ` Paolo Bonzini
2016-06-08 13:34     ` Peter Maydell
2016-06-08 17:13       ` Eduardo Habkost [this message]

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=20160608171330.GP18662@thinpad.lan.raisama.net \
    --to=ehabkost@redhat.com \
    --cc=agraf@suse.de \
    --cc=balrogg@gmail.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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).