]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Allow using VIR_AUTOPTR for releasing virDomainPtr in virsh
authorPeter Krempa <pkrempa@redhat.com>
Mon, 9 Sep 2019 08:36:39 +0000 (10:36 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 19 Sep 2019 12:31:14 +0000 (14:31 +0200)
I opted to alias the 'virDomainType' to 'virshDomain' so that it's
obvious in all cases that this is a virsh-only construct. This is also
somewhat consistent with virsh's use of 'virshDomainFree' wrapper for
the freeing function which actually accepts NULL.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tools/virsh-util.h

index 9005aa9d36a8910d8ac72547e9982b4f437b76dc..7fdd39dd12ad529efb9b30fba3560cfad1608046 100644 (file)
@@ -39,8 +39,11 @@ virshCommandOptDomain(vshControl *ctl,
                       const vshCmd *cmd,
                       const char **name);
 
+typedef virDomain virshDomain;
+
 void
 virshDomainFree(virDomainPtr dom);
+VIR_DEFINE_AUTOPTR_FUNC(virshDomain, virshDomainFree);
 
 void
 virshDomainCheckpointFree(virDomainCheckpointPtr chk);