aboutsummaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>2022-10-17 17:25:48 +0800
committerMichael S. Tsirkin <mst@redhat.com>2022-11-07 13:12:20 -0500
commit805d782d284cba013707d5edf38b04047b21d4b5 (patch)
tree0b2e6195ab5eddd9bcebab5cccd93acda1c1f576 /include/hw
parent69e1c14aa22284f933a6ea134b96d5cb5a88a94d (diff)
downloadqemu-805d782d284cba013707d5edf38b04047b21d4b5.zip
qemu-805d782d284cba013707d5edf38b04047b21d4b5.tar.gz
qemu-805d782d284cba013707d5edf38b04047b21d4b5.tar.bz2
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/hw')
-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 2446dcd..938799e 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];