mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
libqos: add qvirtqueue_cleanup()
qvirtqueue_setup() allocates the vring and virtqueue state. So far there has been no function to free it. Callers have been using guest_free() for the vring but forgot to free the QVirtQueue state. This patch solves the memory leak by introducing qvirtqueue_cleanup(). Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
c75f4c061b
commit
f1d3b99154
7 changed files with 36 additions and 7 deletions
|
@ -54,6 +54,12 @@ QVirtQueue *qvirtqueue_setup(const QVirtioBus *bus, QVirtioDevice *d,
|
|||
return bus->virtqueue_setup(d, alloc, index);
|
||||
}
|
||||
|
||||
void qvirtqueue_cleanup(const QVirtioBus *bus, QVirtQueue *vq,
|
||||
QGuestAllocator *alloc)
|
||||
{
|
||||
return bus->virtqueue_cleanup(vq, alloc);
|
||||
}
|
||||
|
||||
void qvirtio_reset(const QVirtioBus *bus, QVirtioDevice *d)
|
||||
{
|
||||
bus->set_status(d, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue