diff options
author | Jason Wang <jasowang@redhat.com> | 2015-08-05 17:50:07 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-08-05 16:56:34 +0300 |
commit | 74aae7b22b8a67cf31937b2f4bdefe2881e799e9 (patch) | |
tree | da5290e56a2434aca7abdd3b30f21536dba2a6dd /include | |
parent | 2be4f242b50a84bf360df02480b173bfed161107 (diff) | |
download | qemu-74aae7b22b8a67cf31937b2f4bdefe2881e799e9.zip qemu-74aae7b22b8a67cf31937b2f4bdefe2881e799e9.tar.gz qemu-74aae7b22b8a67cf31937b2f4bdefe2881e799e9.tar.bz2 |
virtio: fix 1.0 virtqueue migration
1.0 does not requires physically-contiguous pages layout for a
virtqueue. So we could not infer avail and used from desc. This means
we need to migrate vring.avail and vring.used when host support virtio
1.0. This fixes malfunction of virtio 1.0 device after migration.
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/virtio/virtio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 59f0763..cccae89 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -272,6 +272,12 @@ static inline bool virtio_has_feature(VirtIODevice *vdev, unsigned int fbit) return __virtio_has_feature(vdev->guest_features, fbit); } +static inline bool virtio_host_has_feature(VirtIODevice *vdev, + unsigned int fbit) +{ + return __virtio_has_feature(vdev->host_features, fbit); +} + static inline bool virtio_is_big_endian(VirtIODevice *vdev) { if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { |