qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: mst@redhat.com, qemu-devel@nongnu.org, marcel@redhat.com,
	vkaplans@redhat.com, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio-bus: Plug devices after features are negotiated
Date: Mon, 12 Sep 2016 14:00:55 +0200	[thread overview]
Message-ID: <20160912140055.78f1f267.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <fe840ac9-f309-402e-3907-c7053b6a2331@redhat.com>

On Mon, 12 Sep 2016 11:18:52 +0200
Maxime Coquelin <maxime.coquelin@redhat.com> wrote:

> On 09/12/2016 10:51 AM, Cornelia Huck wrote:
> > On Sat, 10 Sep 2016 10:23:37 +0200
> > Maxime Coquelin <maxime.coquelin@redhat.com> wrote:

> >> diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
> >> index f3e5ef3..24caa0a 100644
> >> --- a/include/hw/virtio/virtio-bus.h
> >> +++ b/include/hw/virtio/virtio-bus.h
> >> @@ -54,16 +54,16 @@ typedef struct VirtioBusClass {
> >>      int (*set_guest_notifiers)(DeviceState *d, int nvqs, bool assign);
> >>      void (*vmstate_change)(DeviceState *d, bool running);
> >>      /*
> >> +     * Expose the features the transport layer supports before
> >> +     * the negotiation takes place.
> >> +     */
> >> +    void (*pre_plugged)(DeviceState *d, Error **errp);
> >> +    /*
> >>       * transport independent init function.
> >>       * This is called by virtio-bus just after the device is plugged.
> >>       */
> >>      void (*device_plugged)(DeviceState *d, Error **errp);
> >>      /*
> >> -     * Re-evaluate setup after feature bits have been validated
> >> -     * by the device backend.
> >> -     */
> >> -    void (*post_plugged)(DeviceState *d, Error **errp);
> >> -    /*
> >>       * transport independent exit function.
> >>       * This is called by virtio-bus just before the device is unplugged.
> >>       */
> >
> > I'm not sure we want to rip out an interface in stable. I think the
> > interface may have value in itself - but OTOH, its only user is now
> > gone...
> 
> As it is now, with ->get_features() being called before
> ->device_plugged(), it has not much value because ->post_plugged() and 
> ->device_plugged() are called in a row.
> 
> But maybe calling ->get_features() a second time after ->device_plugged
> would make sense if for some reason a feature becomes (not) supported
> during ->device_plugged execution?

I was thinking more of changes that are not related to feature
negotiation, but I'm not too attached to that callback. If noone
objects against removing it in stable, let's just go with your patch.

  reply	other threads:[~2016-09-12 12:01 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-10  8:23 [Qemu-devel] [PATCH] virtio-bus: Plug devices after features are negotiated Maxime Coquelin
2016-09-10  9:49 ` Paolo Bonzini
2016-09-10 12:26   ` Maxime Coquelin
2016-09-12  8:51 ` Cornelia Huck
2016-09-12  9:18   ` Maxime Coquelin
2016-09-12 12:00     ` Cornelia Huck [this message]
2016-09-12 18:22   ` Maxime Coquelin
2016-09-12 19:58     ` Michael S. Tsirkin
2016-09-13  7:08       ` Maxime Coquelin
2016-09-13  8:59         ` Cornelia Huck
2016-09-13  9:38           ` Maxime Coquelin
2016-09-12 18:41 ` Eric Blake
2016-09-13  6:41   ` Maxime Coquelin
2016-09-13  8:00 ` Marcel Apfelbaum

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=20160912140055.78f1f267.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=marcel@redhat.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    --cc=vkaplans@redhat.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).