Re: [RFC PATCH] qemumonitorjsontest: Use VIR_AUTOPTR for test cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 10, 2019 at 22:03:05 -0500, Eric Blake wrote:
> Everywhere else is switching, we might as well use it here, too.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> 
> ---
> 
> Partial patch - is it worth me continuing the cleanups on the rest of
> the file?

ACK to this one if you split it, but I'm unsure whether it's worth
investing time into converting all of the tests. Definitely the
definition of the AUTOPTR function is worth because new tests can use
the new format.

> ---
>  tests/qemumonitortestutils.h |  3 +++
>  tests/qemumonitorjsontest.c  | 35 +++++++++++++++--------------------
>  2 files changed, 18 insertions(+), 20 deletions(-)
> 
> diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h
> index 8461c80caa..a2d2d30820 100644
> --- a/tests/qemumonitortestutils.h
> +++ b/tests/qemumonitortestutils.h
> @@ -24,6 +24,7 @@
>  # include "qemu/qemu_conf.h"
>  # include "qemu/qemu_monitor.h"
>  # include "qemu/qemu_agent.h"
> +# include "virautoclean.h"
> 
>  typedef struct _qemuMonitorTest qemuMonitorTest;
>  typedef qemuMonitorTest *qemuMonitorTestPtr;
> @@ -102,4 +103,6 @@ qemuMonitorPtr qemuMonitorTestGetMonitor(qemuMonitorTestPtr test);
>  qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test);
>  virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test);
> 
> +VIR_DEFINE_AUTOPTR_FUNC(qemuMonitorTest, qemuMonitorTestFree);

Possibly add this in a separate patch?

Attachment: signature.asc
Description: PGP signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux