[PATCH 0/2] introduce QEMU_AUTO_VFREE

Vladimir Sementsov-Ogievskiy posted 2 patches 2 years, 10 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
include/qemu/osdep.h |  2 ++
block/commit.c       | 25 +++++++++----------------
2 files changed, 11 insertions(+), 16 deletions(-)
[PATCH 0/2] introduce QEMU_AUTO_VFREE
Posted by Vladimir Sementsov-Ogievskiy 2 years, 10 months ago
Hi all!

There is a good movement to use g_autofree macro, that helps to
automatically call g_free on exit from code block.

We lack similar possibility for qemu_memalign() functions family. Let's
add, it seems rather simple with help of "cleanup" attribute.

I'll update more places with a follow-up if this is accepted.

Vladimir Sementsov-Ogievskiy (2):
  introduce QEMU_AUTO_VFREE
  block/commit: use QEMU_AUTO_VFREE

 include/qemu/osdep.h |  2 ++
 block/commit.c       | 25 +++++++++----------------
 2 files changed, 11 insertions(+), 16 deletions(-)

-- 
2.29.2


Re: [PATCH 0/2] introduce QEMU_AUTO_VFREE
Posted by Stefan Hajnoczi 2 years, 10 months ago
On Sat, Jun 19, 2021 at 05:21:18PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> There is a good movement to use g_autofree macro, that helps to
> automatically call g_free on exit from code block.
> 
> We lack similar possibility for qemu_memalign() functions family. Let's
> add, it seems rather simple with help of "cleanup" attribute.
> 
> I'll update more places with a follow-up if this is accepted.
> 
> Vladimir Sementsov-Ogievskiy (2):
>   introduce QEMU_AUTO_VFREE
>   block/commit: use QEMU_AUTO_VFREE
> 
>  include/qemu/osdep.h |  2 ++
>  block/commit.c       | 25 +++++++++----------------
>  2 files changed, 11 insertions(+), 16 deletions(-)
> 
> -- 
> 2.29.2
> 

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>