qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Jason Wang <jasowang@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH V3 1/6] virtio-pci: fix 1.0 virtqueue migration
Date: Mon, 9 Nov 2015 13:56:48 +0100	[thread overview]
Message-ID: <20151109135648.061eaaeb.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1446796969-8049-2-git-send-email-jasowang@redhat.com>

On Fri,  6 Nov 2015 16:02:44 +0800
Jason Wang <jasowang@redhat.com> wrote:

> We don't migrate the followings fields for virtio-pci:
> 
> uint32_t dfselect;
> uint32_t gfselect;
> uint32_t guest_features[2];
> struct {
>     uint16_t num;
>     bool enabled;
>     uint32_t desc[2];
>     uint32_t avail[2];
>     uint32_t used[2];
> } vqs[VIRTIO_QUEUE_MAX];
> 
> This will confuse driver if migrating during initialization. Solves
> this issue by:
> 
> - introduce transport specific callbacks to load and store extra
>   virtqueue states.
> - add a new subsection for virtio to migrate transport specific modern
>   device state.
> - implement pci specific callbacks.
> - add a new property for virtio-pci for whether or not to migrate
>   extra state.
> - compat the migration for 2.4 and elder machine types
> 
> Cc: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  hw/virtio/virtio-pci.c         | 129 +++++++++++++++++++++++++++++++++++++++++
>  hw/virtio/virtio-pci.h         |  20 ++++---
>  hw/virtio/virtio.c             |  58 ++++++++++++++++++
>  include/hw/compat.h            |   4 ++
>  include/hw/virtio/virtio-bus.h |   3 +
>  5 files changed, 207 insertions(+), 7 deletions(-)

> @@ -133,6 +256,7 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f)
>      if (vector != VIRTIO_NO_VECTOR) {
>          return msix_vector_use(&proxy->pci_dev, vector);
>      }
> +

whitespace change :)

>      return 0;
>  }
> 

(...)

> +static void put_extra_state(QEMUFile *f, void *pv, size_t size)
> +{
> +    VirtIODevice *vdev = pv;
> +    BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
> +    VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
> +

I'd probably put an 'assert(k->save_extra_state)' here. (I think we
have discussed this before, but I can't recall the outcome.)

> +    k->save_extra_state(qbus->parent, f);
> +}

Otherwise, this looks good to me. With or with out the assert,

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>

  reply	other threads:[~2015-11-09 12:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  8:02 [Qemu-devel] [PATCH V3 0/6] virtio 1.0 pci optimizations and fixes Jason Wang
2015-11-06  8:02 ` [Qemu-devel] [PATCH V3 1/6] virtio-pci: fix 1.0 virtqueue migration Jason Wang
2015-11-09 12:56   ` Cornelia Huck [this message]
2015-11-10  2:35     ` Jason Wang
2015-11-06  8:02 ` [Qemu-devel] [PATCH V3 2/6] memory: don't try to adjust endianness for zero length eventfd Jason Wang
2015-11-06  8:02 ` [Qemu-devel] [PATCH V3 3/6] KVM: add support for any length io eventfd Jason Wang
2015-11-11 11:01   ` Paolo Bonzini
2015-11-06  8:02 ` [Qemu-devel] [PATCH V3 4/6] virtio-pci: use zero length mmio eventfd for 1.0 notification cap when possible Jason Wang
2015-11-06  8:02 ` [Qemu-devel] [PATCH V3 5/6] virtio-pci: introduce pio notification capability for modern device Jason Wang
2015-11-06  8:02 ` [Qemu-devel] [PATCH V3 6/6] virtio-pci: unbreak queue_enable read Jason Wang
2015-11-09 13:14   ` Cornelia Huck
2015-11-10  2:51     ` Jason Wang

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=20151109135648.061eaaeb.cornelia.huck@de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=jasowang@redhat.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).