summaryrefslogtreecommitdiff
path: root/include/hw/virtio/virtio.h
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2015-08-05 17:50:07 +0800
committerMichael S. Tsirkin <mst@redhat.com>2015-08-05 16:56:34 +0300
commit74aae7b22b8a67cf31937b2f4bdefe2881e799e9 (patch)
treeda5290e56a2434aca7abdd3b30f21536dba2a6dd /include/hw/virtio/virtio.h
parent2be4f242b50a84bf360df02480b173bfed161107 (diff)
downloadqemu-74aae7b22b8a67cf31937b2f4bdefe2881e799e9.tar.gz
qemu-74aae7b22b8a67cf31937b2f4bdefe2881e799e9.tar.bz2
qemu-74aae7b22b8a67cf31937b2f4bdefe2881e799e9.zip
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/hw/virtio/virtio.h')
-rw-r--r--include/hw/virtio/virtio.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 59f0763ed8..cccae89d83 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)) {