From nobody Sat Feb 7 05:57:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1632344232; cv=none; d=zohomail.com; s=zohoarc; b=jtesi9qt3o8xiZsrOV2zeSCWqMZxczCtdX+Q4qJv0tJHJgR6uUZZ4mRnjLqG9fCnle97KoG0iAHxLOrV7sxFCPHKB11B5q1GGHfxc+ak1MRAKmsuoRecoXFu0I3x+7Bq8vl2syZkTT9Z6CtqfQjw1xvVgS2UAHCgLj/TPLq8F9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632344232; h=Content-Type:Content-Transfer-Encoding:Cc: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=CP1daSIvvsYYLp1Y/ed0FqmZhGDweBwj7bZVDKVwY7M=; b=bvDzRsVgPcp4zsdge4DenGGQgdCIfnVm14MzLF3TVfY85j2bj4xMs5UnXHdB72x4iCzEFP6apUqd3ZrsXJMQL2a665/QLt0+8NkigZYfzU6MuFesDWC5DCmt8lw8UijmZmqk2dzSbMJC28I1HDNLImcxEP9XZVkJzLlmeDdeIj4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1632344232640992.1470958950399; Wed, 22 Sep 2021 13:57:12 -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-600--U5ybilEMSCHyqTCSEtqUg-1; Wed, 22 Sep 2021 16:56:14 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B578180830F; Wed, 22 Sep 2021 20:56:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7BB9660C9D; Wed, 22 Sep 2021 20:56:09 +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 23FCE1806D01; Wed, 22 Sep 2021 20:56:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18MKtxNc007547 for ; Wed, 22 Sep 2021 16:55:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65BEC19733; Wed, 22 Sep 2021 20:55:59 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD42819724; Wed, 22 Sep 2021 20:55:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632344231; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=CP1daSIvvsYYLp1Y/ed0FqmZhGDweBwj7bZVDKVwY7M=; b=HtS+yEl9edhdUv9nnx0oeM5NRepPEfrl9+igh3AxHK0K64H+GS+LH4KMKDkt1iLwXe8qXn 95KKflT44nNR1fymmMvIQX7RLBJViaxeGNB24iOs320nnWhRLFYePRedJioCQ1a37vBax5 LDUGOAsvYeVmpKwCEAnrsrUEiVtZt2E= X-MC-Unique: -U5ybilEMSCHyqTCSEtqUg-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/9] ch: use g_auto in virCHMonitorBuildDisksJson Date: Wed, 22 Sep 2021 22:55:31 +0200 Message-Id: <130f308b6dc9f8b092a1cec303a986453410c0c3.1632344053.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: william.douglas@intel.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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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) X-ZM-MESSAGEID: 1632344233031100003 Signed-off-by: J=C3=A1n Tomko --- src/ch/ch_monitor.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c index 174ea47c51..d268dc3c90 100644 --- a/src/ch/ch_monitor.c +++ b/src/ch/ch_monitor.c @@ -211,7 +211,7 @@ virCHMonitorBuildDiskJson(virJSONValue *disks, virDomai= nDiskDef *diskdef) static int virCHMonitorBuildDisksJson(virJSONValue *content, virDomainDef *vmdef) { - virJSONValue *disks; + g_autoptr(virJSONValue) disks =3D NULL; size_t i; =20 if (vmdef->ndisks > 0) { @@ -219,17 +219,13 @@ virCHMonitorBuildDisksJson(virJSONValue *content, vir= DomainDef *vmdef) =20 for (i =3D 0; i < vmdef->ndisks; i++) { if (virCHMonitorBuildDiskJson(disks, vmdef->disks[i]) < 0) - goto cleanup; + return -1; } if (virJSONValueObjectAppend(content, "disks", &disks) < 0) - goto cleanup; + return -1; } =20 return 0; - - cleanup: - virJSONValueFree(disks); - return -1; } =20 static int --=20 2.31.1