From nobody Sun Feb 8 23:42:36 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=1630940406; cv=none; d=zohomail.com; s=zohoarc; b=Pm6iU/SEZhHKiyxzV8zEuMAiqdCeGMSc/1fkog1876QBgxCwWN8xOtsjbwHuPhcuNHD+ubJ5goULUJ0xzcTEOQRGKLVf35j1rHZE3ruoeCvREenfo4rSVdadbmxyeS3W0ybh50lu+pK6wvRSolYpv8LwmKAlHxhyzo5kAiLWEtA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1630940406; 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=w/YSi/OYGs7GEwDvkh3E5poDrjRnkTJi7q+vhKu4L3U=; b=GLynPt0A0NoikK4WsN2JAtg7Dp+OjgmhQDTKDzhHobmRp9CIkrkaSFuxaQ+bwVTuErEELU/sbynbJLs5DD68n075nOFH8M9pML1FsZ+VMYiheJ1W5Z0CJvsvLmgvhBhJ+2QZpsC8lHryXeX3B6lO7T21rOu42sYUU/p/cg++TFc= 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 1630940406473749.145645339621; Mon, 6 Sep 2021 08:00:06 -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-73-vHTRpXwcNu-jj3ZwCkp6Dw-1; Mon, 06 Sep 2021 10:59:12 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BAD18802CB8; Mon, 6 Sep 2021 14:59:06 +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 8781469FAE; Mon, 6 Sep 2021 14:59:06 +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 59F7B44A61; Mon, 6 Sep 2021 14:59:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 186EwvHY004486 for ; Mon, 6 Sep 2021 10:58:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 575FD77716; Mon, 6 Sep 2021 14:58:57 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id D69986608B for ; Mon, 6 Sep 2021 14:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630940405; 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=w/YSi/OYGs7GEwDvkh3E5poDrjRnkTJi7q+vhKu4L3U=; b=Z5yGc379AtBqTe2VvRY8KPDyyhBlWht4Zgiv35l5epKkTXY/Yxryzz4PUNG6B9AbiVWis6 Yw185PJD929Ht3ZQ0ebFwRdK3EQUDRDetvvUe5LHSKbUr2VvQfByQVG0ECfdHhz2S0W7WY AZ8vtMaJm7jjZyIIaqWdL7zvLzQELXo= X-MC-Unique: vHTRpXwcNu-jj3ZwCkp6Dw-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/6] libxl: use g_auto in libxlCapsNodeData Date: Mon, 6 Sep 2021 16:58:48 +0200 Message-Id: <22d5698c74831accf4c4f1a7aa2e0b919c331541.1630939770.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.11 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: 1630940409064100001 Also remove pointless labels. Signed-off-by: J=C3=A1n Tomko --- src/libxl/libxl_capabilities.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 38a9b36d8b..ef77bec7a0 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -104,7 +104,7 @@ static virCPUData * libxlCapsNodeData(virCPUDef *cpu, libxl_hwcap hwcap) { ssize_t ncaps; - virCPUData *cpudata =3D NULL; + g_autoptr(virCPUData) cpudata =3D NULL; virCPUx86CPUID cpuid[] =3D { { .eax_in =3D 0x00000001, .edx =3D hwcap[0] }, { .eax_in =3D 0x00000001, .ecx =3D hwcap[1] }, @@ -117,17 +117,13 @@ libxlCapsNodeData(virCPUDef *cpu, libxl_hwcap hwcap) }; =20 if (!(cpudata =3D virCPUDataNew(cpu->arch))) - goto error; + return NULL; =20 ncaps =3D G_N_ELEMENTS(cpuid); if (libxlCapsAddCPUID(cpudata, cpuid, ncaps) < 0) - goto error; + return NULL; =20 - return cpudata; - - error: - virCPUDataFree(cpudata); - return NULL; + return g_steal_pointer(&cpudata); } =20 /* hw_caps is an array of 32-bit words whose meaning is listed in --=20 2.31.1