From 74aae7b22b8a67cf31937b2f4bdefe2881e799e9 Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Wed, 5 Aug 2015 17:50:07 +0800 Subject: 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 Cc: Cornelia Huck Cc: Dr. David Alan Gilbert Signed-off-by: Jason Wang Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') 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)) { -- cgit v1.2.3