qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] dataplane: enable virtio-blk x-data-plane=on live migration
Date: Tue, 23 Jul 2013 15:39:44 +0200	[thread overview]
Message-ID: <20130723133944.GC27684@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <51E6716E.8050304@redhat.com>

On Wed, Jul 17, 2013 at 12:26:54PM +0200, Paolo Bonzini wrote:
> Il 17/07/2013 11:35, Stefan Hajnoczi ha scritto:
> > @@ -628,6 +629,34 @@ void virtio_blk_set_conf(DeviceState *dev, VirtIOBlkConf *blk)
> >      memcpy(&(s->blk), blk, sizeof(struct VirtIOBlkConf));
> >  }
> >  
> > +#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
> > +/* Disable dataplane thread during live migration since it does not
> > + * update the dirty memory bitmap yet.
> > + */
> > +static void virtio_blk_migration_state_changed(Notifier *notifier, void *data)
> > +{
> > +    VirtIOBlock *s = container_of(notifier, VirtIOBlock,
> > +                                  migration_state_notifier);
> > +    MigrationState *mig = data;
> > +
> > +    if (migration_is_active(mig)) {
> > +        if (!s->dataplane) {
> > +            return;
> > +        }
> > +        virtio_blk_data_plane_destroy(s->dataplane);
> > +        s->dataplane = NULL;
> > +    } else if (migration_has_finished(mig) ||
> > +               migration_has_failed(mig)) {
> > +        if (s->dataplane) {
> > +            return;
> > +        }
> > +        bdrv_drain_all(); /* complete in-flight non-dataplane requests */
> > +        virtio_blk_data_plane_create(VIRTIO_DEVICE(s), &s->blk,
> > +                                     &s->dataplane);
> > +    }
> > +}
> 
> Perhaps you can call bdrv_set_in_use here (set it to 1 after
> destruction, and to 0 before creation), so that you do not need the
> check in virtio_blk_data_plane_create?

The bdrv_in_use() check fixes a bug that was present before this series.
Therefore I split it into a separate commit in v3 and CCed
qemu-stable@nongnu.org.

Stefan

      reply	other threads:[~2013-07-23 13:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17  9:35 [Qemu-devel] [PATCH 0/3] dataplane: virtio-blk live migration with x-data-plane=on Stefan Hajnoczi
2013-07-17  9:35 ` [Qemu-devel] [PATCH 1/3] dataplane: sync virtio.c and vring.c virtqueue state Stefan Hajnoczi
2013-07-17  9:35 ` [Qemu-devel] [PATCH 2/3] migration: notify migration state before starting thread Stefan Hajnoczi
2013-07-17 10:22   ` Paolo Bonzini
2013-07-17  9:35 ` [Qemu-devel] [PATCH 3/3] dataplane: enable virtio-blk x-data-plane=on live migration Stefan Hajnoczi
2013-07-17 10:26   ` Paolo Bonzini
2013-07-23 13:39     ` Stefan Hajnoczi [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=20130723133944.GC27684@stefanha-thinkpad.redhat.com \
    --to=stefanha@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@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).