From nobody Sun Feb 8 13:38:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1595979891; cv=none; d=zohomail.com; s=zohoarc; b=QIAdoUV416vVS6nRIBcNXtUx6/zjwwTnzW54DikKorwOqea2ItEUW6gYAj/SDmTvN8gg6mbcQpjUYN+sXTj+6MYY4uqvYS9dWtHJhgcnEGLYbhjdn5J6YuMXpN5klssQUd5B4AOLsE6EDTPfSjwxOIDLk60n12y29iOG9YfiOqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595979891; 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; bh=pUYvNyroLKA+NLt752bPoyo/DH95deEewvDjwxI8hs4=; b=GSdTjhoJ+KAQIlrDcifzhSsNnklW3HDlEE+90ukDESXraFWVRKRdPuF7Y4PX2n9ZBZ6kDQHoDC/OrT7xuGyhhJJH1mAem8e7NDkP9w4Dk5IkOdMdehH3CyKW7Yhp3woRyxu9WTnwY33undb+/NQZTIvU84wRDYxzL6CHPlk32J4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 159597989122159.771559627745205; Tue, 28 Jul 2020 16:44:51 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-uQ23XJSTOt6E63IDWVxKiQ-1; Tue, 28 Jul 2020 19:44:47 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 588AD8015CE; Tue, 28 Jul 2020 23:44:41 +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 39FF169327; Tue, 28 Jul 2020 23:44:41 +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 09FEEA35B4; Tue, 28 Jul 2020 23:44:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06SNidt0004488 for ; Tue, 28 Jul 2020 19:44:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 225682C724; Tue, 28 Jul 2020 23:44:39 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FA7759 for ; Tue, 28 Jul 2020 23:44:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595979890; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=pUYvNyroLKA+NLt752bPoyo/DH95deEewvDjwxI8hs4=; b=NtpFP3oR4p30m6mKaKSEOVSi93y1aHVA8lJL3d2KpGNqJw+4saIBgszNlbdV8m6K4hVHSw FZPtPmhiFU+EVT71DwVRElzgbloycNcgfG/nt+U6h3mn6w9a3C4yw5vSya1hpR3DFs6ulU zNghY8siHuDbi9YD6dhOWbQAht5uTq4= X-MC-Unique: uQ23XJSTOt6E63IDWVxKiQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] tests: bhyve: use g_autoptr where possible Date: Wed, 29 Jul 2020 01:44:26 +0200 Message-Id: <083d9227d5e68fc37650bc2ffab2c4142e126a68.1595979850.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: J=C3=A1n Tomko --- tests/bhyveargv2xmltest.c | 3 +-- tests/bhyvexml2argvtest.c | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index e58a36d17c..e7ec3ae020 100644 --- a/tests/bhyveargv2xmltest.c +++ b/tests/bhyveargv2xmltest.c @@ -32,7 +32,7 @@ testCompareXMLToArgvFiles(const char *xmlfile, g_autofree char *cmd =3D NULL; g_autofree char *log =3D NULL; int ret =3D -1; - virDomainDefPtr vmdef =3D NULL; + g_autoptr(virDomainDef) vmdef =3D NULL; =20 if (virTestLoadFile(cmdfile, &cmd) < 0) goto fail; @@ -86,7 +86,6 @@ testCompareXMLToArgvFiles(const char *xmlfile, ret =3D 0; =20 fail: - virDomainDefFree(vmdef); return ret; } =20 diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index ce2af08d4c..33e7ac5772 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -29,10 +29,10 @@ static int testCompareXMLToArgvFiles(const char *xml, g_autofree char *actualargv =3D NULL; g_autofree char *actualld =3D NULL; g_autofree char *actualdm =3D NULL; - virDomainDefPtr vmdef =3D NULL; - virCommandPtr cmd =3D NULL; - virCommandPtr ldcmd =3D NULL; - virConnectPtr conn; + g_autoptr(virDomainDef) vmdef =3D NULL; + g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) ldcmd =3D NULL; + g_autoptr(virConnect) conn =3D NULL; int ret =3D -1; =20 if (!(conn =3D virGetConnect())) @@ -99,10 +99,6 @@ static int testCompareXMLToArgvFiles(const char *xml, vmdef->graphics[0]->type =3D=3D VIR_DOMAIN_GRAPHICS_TYPE_VNC) virPortAllocatorRelease(vmdef->graphics[0]->data.vnc.port); =20 - virCommandFree(cmd); - virCommandFree(ldcmd); - virDomainDefFree(vmdef); - virObjectUnref(conn); return ret; } =20 --=20 2.26.2