qemu-e2k/hw/block
Jian Wang a5390d9367 qemu: avoid memory leak while remove disk
Memset vhost_dev to zero in the vhost_dev_cleanup function.
This causes dev.vqs to be NULL, so that
vqs does not free up space when calling the g_free function.
This will result in a memory leak. But you can't release vqs
directly in the vhost_dev_cleanup function, because vhost_net
will also call this function, and vhost_net's vqs is assigned by array.
In order to solve this problem, we first save the pointer of vqs,
and release the space of vqs after vhost_dev_cleanup is called.

Signed-off-by: Jian Wang <wangjian161@huawei.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-01-14 19:31:04 -05:00
..
dataplane xen-block: avoid repeated memory allocation 2019-01-14 13:45:40 +00:00
block.c
cdrom.c
ecc.c
fdc.c
hd-geometry.c
m25p80.c
Makefile.objs xen: remove the legacy 'xen_disk' backend 2019-01-14 13:45:40 +00:00
nand.c
nvme.c
nvme.h
onenand.c
pflash_cfi01.c
pflash_cfi02.c
tc58128.c
trace-events xen: automatically create XenBlockDevice-s 2019-01-14 13:45:40 +00:00
vhost-user-blk.c qemu: avoid memory leak while remove disk 2019-01-14 19:31:04 -05:00
virtio-blk.c
xen_blkif.h
xen-block.c xen: automatically create XenBlockDevice-s 2019-01-14 13:45:40 +00:00