qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v1 12/16] virtio: add userspace migration of pac


From: Wei Xu
Subject: Re: [Qemu-devel] [PATCH v1 12/16] virtio: add userspace migration of packed ring
Date: Thu, 17 Jan 2019 01:50:03 +0800
User-agent: Mutt/1.5.24 (2015-08-30)

On Thu, Nov 22, 2018 at 10:45:36PM +0800, Jason Wang wrote:
> 
> On 2018/11/22 下午10:06, address@hidden wrote:
> >From: Wei Xu <address@hidden>
> >
> >Signed-off-by: Wei Xu <address@hidden>
> 
> 
> I think you need subsection. Otherwise you will break migration
> compatibility.

ok, thanks.

Wei

> 
> Thanks
> 
> 
> >---
> >  hw/virtio/virtio.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> >
> >diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
> >index 240c4e3..64d5c04 100644
> >--- a/hw/virtio/virtio.c
> >+++ b/hw/virtio/virtio.c
> >@@ -2558,6 +2558,12 @@ int virtio_save(VirtIODevice *vdev, QEMUFile *f)
> >           */
> >          qemu_put_be64(f, vdev->vq[i].vring.desc);
> >          qemu_put_be16s(f, &vdev->vq[i].last_avail_idx);
> >+        qemu_put_8s(f, (const uint8_t *)&vdev->vq[i].avail_wrap_counter);
> >+        qemu_put_8s(f, (const uint8_t *)&vdev->vq[i].event_wrap_counter);
> >+        qemu_put_8s(f, (const uint8_t *)&vdev->vq[i].used_wrap_counter);
> >+        qemu_put_be16s(f, &vdev->vq[i].used_idx);
> >+        qemu_put_be16s(f, &vdev->vq[i].shadow_avail_idx);
> >+        qemu_put_be32s(f, &vdev->vq[i].inuse);
> >          if (k->save_queue) {
> >              k->save_queue(qbus->parent, i, f);
> >          }
> >@@ -2705,6 +2711,14 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int 
> >version_id)
> >          }
> >          vdev->vq[i].vring.desc = qemu_get_be64(f);
> >          qemu_get_be16s(f, &vdev->vq[i].last_avail_idx);
> >+
> >+        qemu_get_8s(f, (uint8_t *)&vdev->vq[i].avail_wrap_counter);
> >+        qemu_get_8s(f, (uint8_t *)&vdev->vq[i].event_wrap_counter);
> >+        qemu_get_8s(f, (uint8_t *)&vdev->vq[i].used_wrap_counter);
> >+        qemu_get_be16s(f, &vdev->vq[i].used_idx);
> >+        qemu_get_be16s(f, &vdev->vq[i].shadow_avail_idx);
> >+        qemu_get_be32s(f, &vdev->vq[i].inuse);
> >+
> >          vdev->vq[i].signalled_used_valid = false;
> >          vdev->vq[i].notification = true;
> >@@ -2786,6 +2800,10 @@ int virtio_load(VirtIODevice *vdev, QEMUFile *f, int 
> >version_id)
> >                  virtio_queue_update_rings(vdev, i);
> >              }
> >+            if (virtio_vdev_has_feature(vdev, VIRTIO_F_RING_PACKED)) {
> >+                continue;
> >+            }
> >+
> >              nheads = vring_avail_idx(&vdev->vq[i]) - 
> > vdev->vq[i].last_avail_idx;
> >              /* Check it isn't doing strange things with descriptor 
> > numbers. */
> >              if (nheads > vdev->vq[i].vring.num) {
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]