From nobody Sun Feb 8 21:29:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1585316722; cv=none; d=zohomail.com; s=zohoarc; b=A6Sdx1y2o8KFD+zjJ3PCy8IiqPZ/cnz63eYxwgfAkhXr/2PFkxBpv97mpSJfRPym73XFriyDgTEkHLrpL6gW9MEIwwiFWUrxXNg1y/4frYC3Du2OtS6S3UOBLZ31sqoVHV3/h92UsoAzf0Zp2bqR50GHvFOnWXpUTnVV988NZZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585316722; 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=1RQQGPVJ+M/7qJSpm1iZMnxEjPVAw+MMe84XOgzD9+M=; b=MpPPB8GivXTytHKplJ2zsJ54VO6hs1ejKzRsOwiTlVyZePws/MIR2oHHoFLjbcYpU1inUeyOPKdAEnbHE9QjPS4Agqbi30OcmDjcjjeansdVa5t/XhyEJheU/OTcg6oYNkuBEzEG5MhbvMj+OMShEaizqmmG87nuyf2KAIFUy6Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585316722288462.16276774442485; Fri, 27 Mar 2020 06:45:22 -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-415-szceZEGPMH6MsvjLiELIqQ-1; Fri, 27 Mar 2020 09:45:18 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C61B149C0; Fri, 27 Mar 2020 13:45:13 +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 BDD475DA85; Fri, 27 Mar 2020 13:45:12 +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 11C3118033C7; Fri, 27 Mar 2020 13:45:12 +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 02RDiNEn006390 for ; Fri, 27 Mar 2020 09:44:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id B9A037E303; Fri, 27 Mar 2020 13:44:23 +0000 (UTC) Received: from rein.int.mamuti.net (unknown [10.40.192.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8C1465C1BA for ; Fri, 27 Mar 2020 13:44:23 +0000 (UTC) Received: by rein.int.mamuti.net (Postfix, from userid 500) id 07AF918D5B0; Fri, 27 Mar 2020 14:44:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585316721; 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=1RQQGPVJ+M/7qJSpm1iZMnxEjPVAw+MMe84XOgzD9+M=; b=Z9S3+LnB46UUixg6FiMe3hkedDSSzInSTOFNCpCQxna26ONtCzraoW7/Rx5+iXnSIIml9B iCHYApAUDASfahiiRi5my3oWZXXWXn1ZXMJV3IH7XMD8zndA6VFc9JIHHLpXUJvB0kyO8E l20+CqaE/6DTAWmDfjY2HJoVgz2pZEk= X-MC-Unique: szceZEGPMH6MsvjLiELIqQ-1 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt PATCH 21/39] cpu_x86: Use g_auto* in virCPUx86GetHost Date: Fri, 27 Mar 2020 14:43:50 +0100 Message-Id: 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.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_x86.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 3b3a428ecd..7bd19a1676 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -2641,18 +2641,18 @@ static int virCPUx86GetHost(virCPUDefPtr cpu, virDomainCapsCPUModelsPtr models) { - virCPUDataPtr cpuData =3D NULL; - int ret =3D -1; + g_autoptr(virCPUData) cpuData =3D NULL; + int ret; =20 if (virCPUx86DriverInitialize() < 0) - goto cleanup; + return -1; =20 if (!(cpuData =3D virCPUDataNew(archs[0]))) - goto cleanup; + return -1; =20 if (cpuidSet(CPUX86_BASIC, cpuData) < 0 || cpuidSet(CPUX86_EXTENDED, cpuData) < 0) - goto cleanup; + return -1; =20 /* Read the IA32_ARCH_CAPABILITIES MSR (0x10a) if supported. * This is best effort since there might be no way to read the MSR @@ -2672,7 +2672,7 @@ virCPUx86GetHost(virCPUDefPtr cpu, }; =20 if (virCPUx86DataAdd(cpuData, &item) < 0) - goto cleanup; + return -1; } } =20 @@ -2688,8 +2688,6 @@ virCPUx86GetHost(virCPUDefPtr cpu, VIR_DEBUG("Host CPU does not support invariant TSC"); } =20 - cleanup: - virCPUx86DataFree(cpuData); return ret; } #endif --=20 2.26.0