summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorXuan Zhuo2022-10-17 11:25:48 +0200
committerMichael S. Tsirkin2022-11-07 19:12:20 +0100
commit805d782d284cba013707d5edf38b04047b21d4b5 (patch)
tree0b2e6195ab5eddd9bcebab5cccd93acda1c1f576 /include
parentvirtio: core: vq reset feature negotation support (diff)
downloadqemu-805d782d284cba013707d5edf38b04047b21d4b5.tar.gz
qemu-805d782d284cba013707d5edf38b04047b21d4b5.tar.xz
qemu-805d782d284cba013707d5edf38b04047b21d4b5.zip
virtio-pci: support queue reset
PCI devices support vq reset. Based on this function, the driver can adjust the size of the ring, and quickly recycle the buffer in the ring. The migration of the virtio devices will not happen during a reset operation. This is becuase the global iothread lock is held. Migration thread also needs the lock. As a result, when migration of virtio devices starts, the 'reset' status of VirtIOPCIQueue will always be 0. Thus, we do not need to add it in vmstate_virtio_pci_modern_queue_state. Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Kangjie Xu <kangjie.xu@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20221017092558.111082-6-xuanzhuo@linux.alibaba.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-pci.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index 2446dcd9ae..938799e8f6 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -117,6 +117,11 @@ typedef struct VirtIOPCIRegion {
typedef struct VirtIOPCIQueue {
uint16_t num;
bool enabled;
+ /*
+ * No need to migrate the reset status, because it is always 0
+ * when the migration starts.
+ */
+ bool reset;
uint32_t desc[2];
uint32_t avail[2];
uint32_t used[2];