From nobody Sun Feb 8 19:56:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568637942; cv=none; d=zoho.com; s=zohoarc; b=htGt2tU3LHFZkDXnBafD0P8oQN2MJgth1CApT7v2SgoIfbCdu0uDRcGMKVM5vT3ttJC+Er34MlTZIHARxkmel1FJkxwo5iV136oQALwPveSW6T/XVZ5Ed3UHMZJBTnsV9WhpojWaT4WPyPHJqLbjJJjXBHG2GtH49EWTutozvas= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568637942; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Alu4aJ70TjmcRkd5CilOc/indw8jUx7md3j+6tVhVzs=; b=QCN2l2ESwGIu+bx97LK5Mu91rfIJuvAYK8ee4kLsiadDhE7wxZHQCnw6K2DaU7/IG4IfkjZtWg1h6IxxI3uWOLjjlGjEEWaWjnAWEsXK1LJMF+MV9TYDSejQFWeKjhv000rtXDhkbur0yod2M8s9SosLsV65FRSYEfokGLk2c7g= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568637942705181.0002490355339; Mon, 16 Sep 2019 05:45:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F373B1DD3; Mon, 16 Sep 2019 12:45:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C09BC6012A; Mon, 16 Sep 2019 12:45:40 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 47DB34E58A; Mon, 16 Sep 2019 12:45:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8GCjcxf026027 for ; Mon, 16 Sep 2019 08:45:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4D6F55D9E1; Mon, 16 Sep 2019 12:45:38 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3F6E5D9DC for ; Mon, 16 Sep 2019 12:45:37 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 16 Sep 2019 14:45:32 +0200 Message-Id: <11842e9b533e98da289e691af0c9b8e6328e8eba.1568637841.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] virsh: Allow using VIR_AUTOPTR for releasing virDomainPtr in virsh X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 16 Sep 2019 12:45:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 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 --- tools/virsh-util.h | 3 +++ 1 file changed, 3 insertions(+) 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); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list