Re: [Qemu-devel] [PATCH v2] qemu: avoid memory leak while remove disk

2019-01-04 Thread Eric Blake
On 12/22/18 4:27 AM, w00426999 wrote: > 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_cle

Re: [Qemu-devel] [PATCH v2] qemu: avoid memory leak while remove disk

2019-01-04 Thread Stefan Hajnoczi
On Sat, Dec 22, 2018 at 06:27:28PM +0800, w00426999 wrote: > 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

[Qemu-devel] [PATCH v2] qemu: avoid memory leak while remove disk

2018-12-22 Thread w00426999
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