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>
This commit is contained in:
parent
722f8c51d8
commit
8cd353ea0f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user