qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: aneesh.kumar@linux.vnet.ibm.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>,
	"Alexander Graf" <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2 2/5] qdev: add the HotUnpluggable handler
Date: Thu, 15 Oct 2015 17:53:08 +0200	[thread overview]
Message-ID: <20151015175308.13e9a861@bahia.local> (raw)
In-Reply-To: <20151015171436.1fffe807.cornelia.huck@de.ibm.com>

On Thu, 15 Oct 2015 17:14:36 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:

> On Mon, 12 Oct 2015 11:00:13 +0200
> Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:
> 
> > This handler allows to ask a device instance if it can be hot-unplugged. It
> > is to be defined in device classes where hot-unpluggability depends on the
> > device state (for example, virtio-9p devices cannot be unplugged if the 9p
> > share is mounted in the guest).
> > 
> > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > ---
> >  hw/core/qdev.c         |    4 ++++
> >  include/hw/qdev-core.h |    4 ++++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> > index 4ab04aa31e78..2b2339c7c6ad 100644
> > --- a/hw/core/qdev.c
> > +++ b/hw/core/qdev.c
> > @@ -287,6 +287,10 @@ void qdev_unplug(DeviceState *dev, Error **errp)
> >          return;
> >      }
> > 
> > +    if (dc->unpluggable && !dc->unpluggable(dev, errp)) {
> 
> I think I'd prefer something like "unplug_is_blocked" or so. Makes it
> more obvious that this is something that is rather the exception. 
> 

It makes sense indeed. I'll do that for next version.

> > +        return;
> > +    }
> > +
> >      qdev_hot_removed = true;
> > 
> >      hotplug_ctrl = qdev_get_hotplug_handler(dev);

  reply	other threads:[~2015-10-15 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  8:57 [Qemu-devel] [PATCH v2 0/5] virtio-9p: hotplug and migration support Greg Kurz
2015-10-12  9:00 ` [Qemu-devel] [PATCH v2 1/5] virtio-9p-coth: fix init function Greg Kurz
2015-10-12  9:00 ` [Qemu-devel] [PATCH v2 2/5] qdev: add the HotUnpluggable handler Greg Kurz
2015-10-15 15:14   ` Cornelia Huck
2015-10-15 15:53     ` Greg Kurz [this message]
2015-10-12  9:00 ` [Qemu-devel] [PATCH v2 3/5] virtio-9p: block hot-unplug when device is active Greg Kurz
2015-10-12  9:03 ` [Qemu-devel] [PATCH v2 4/5] virtio-9p: add unrealize handler Greg Kurz
2015-10-12  9:03 ` [Qemu-devel] [PATCH v2 5/5] virtio-9p: add savem handlers Greg Kurz

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=20151015175308.13e9a861@bahia.local \
    --to=gkurz@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=mst@redhat.com \
    --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).