virtio: make virtio_delete_queue idempotent
Let's make sure calling this twice is harmless - no known instances, but seems safer. Suggested-by: Pan Nengyuan <pannengyuan@huawei.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit8cd353ea0f
) *prereq for421afd2fe8
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
committed by
Michael Roth
parent
d5a5d43e27
commit
a843731d7f
@@ -2337,6 +2337,7 @@ void virtio_delete_queue(VirtQueue *vq)
|
||||
vq->handle_output = NULL;
|
||||
vq->handle_aio_output = NULL;
|
||||
g_free(vq->used_elems);
|
||||
vq->used_elems = NULL;
|
||||
}
|
||||
|
||||
void virtio_del_queue(VirtIODevice *vdev, int n)
|
||||
|
Reference in New Issue
Block a user