mirror of https://gitee.com/openkylin/qemu.git
virtio-pci: reset modern vq meta data
We don't reset proxy->vqs[].{num|desc[]|avail[]|used[]}. This means if a driver enable the vq without setting vq address after reset. The old addresses were leaked. Fixing this by resetting modern vq meta data during device reset. Cc: qemu-stable@nongnu.org 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>
This commit is contained in:
parent
f0edf23978
commit
60a8d80234
|
@ -1857,6 +1857,10 @@ static void virtio_pci_reset(DeviceState *qdev)
|
|||
|
||||
for (i = 0; i < VIRTIO_QUEUE_MAX; i++) {
|
||||
proxy->vqs[i].enabled = 0;
|
||||
proxy->vqs[i].num = 0;
|
||||
proxy->vqs[i].desc[0] = proxy->vqs[i].desc[1] = 0;
|
||||
proxy->vqs[i].avail[0] = proxy->vqs[i].avail[1] = 0;
|
||||
proxy->vqs[i].used[0] = proxy->vqs[i].used[1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue