From: Peter Krempa Date: Mon, 9 Sep 2019 08:36:39 +0000 (+0200) Subject: virsh: Allow using VIR_AUTOPTR for releasing virDomainPtr in virsh X-Git-Tag: v5.8.0-rc1~145 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=96143986caa2c74ccca12fe52340a189b0ef30aa;p=thirdparty%2Flibvirt.git virsh: Allow using VIR_AUTOPTR for releasing virDomainPtr in virsh 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 Reviewed-by: Daniel Henrique Barboza Reviewed-by: Ján Tomko --- diff --git a/tools/virsh-util.h b/tools/virsh-util.h index 9005aa9d36..7fdd39dd12 100644 --- a/tools/virsh-util.h +++ b/tools/virsh-util.h @@ -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);