From nobody Mon May 20 00:56:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615362434; cv=none; d=zohomail.com; s=zohoarc; b=edUSwHW7vkpWArkod/di2w7ucCgoHoMvla+tnMaapWeP0W9p57pSIrQgY1s84HL/A0JsvCwY2+jhIhhWR2J4IQQpepBrlNvuqfalyJTm0XMrbPip/Q4bI8YmGsiPn+6HOucebgBAJCAS2vTsrKWtKNo3Qq5a8vW8nAHrWIFTDWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615362434; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=cJZM5siYEJZPzscjVE8iMFP3BWziLbe52Yv9qlN/gmk=; b=gbh6MYD41FF8sKQ/Xw1XLCWItPFaNYA80O0pSZr//9jfW1n0V2VOJ35qg2wWDtCmML412P/FJIC4AY0Wu7CxtxxSbLrfX2s4/b2ezAbIzwBtvtKI4dfxxgpxM5al20oUhfgqW+/3quEVj+aGFSxzO8nk4ydtnFMTJRZFR9yGs0s= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1615362434294873.1276130504928; Tue, 9 Mar 2021 23:47:14 -0800 (PST) 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-604-2VBukEWGMP6LSwsF6hikwA-1; Wed, 10 Mar 2021 02:47:11 -0500 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 053C8189E60B; Wed, 10 Mar 2021 07:47:00 +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 7FE785DA2D; Wed, 10 Mar 2021 07:46:59 +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 B74E685F2; Wed, 10 Mar 2021 07:46:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12A7ksZb022770 for ; Wed, 10 Mar 2021 02:46:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id C3CA9201140A; Wed, 10 Mar 2021 07:46:54 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCE3F20113E8 for ; Wed, 10 Mar 2021 07:46:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 135B885A5B7 for ; Wed, 10 Mar 2021 07:46:44 +0000 (UTC) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.206]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-PxVbJ-jDPJuQPzERmDtB5g-1; Wed, 10 Mar 2021 02:46:41 -0500 Received: from localhost (unknown [192.168.167.69]) by regular1.263xmail.com (Postfix) with ESMTP id BBCCD1B0E for ; Wed, 10 Mar 2021 15:46:35 +0800 (CST) Received: from localhost.localdomain (unknown [14.18.236.70]) by smtp.263.net (postfix) whith ESMTP id P1828T139670320981760S1615362389989350_; Wed, 10 Mar 2021 15:46:35 +0800 (CST) X-MC-Unique: 2VBukEWGMP6LSwsF6hikwA-1 X-MC-Unique: PxVbJ-jDPJuQPzERmDtB5g-1 X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: yili@winhong.com X-SENDER: yili@winhong.com X-LOGIN-NAME: yili@winhong.com X-FST-TO: libvir-list@redhat.com X-SENDER-IP: 14.18.236.70 X-ATTACHMENT-NUM: 0 X-System-Flag: 0 From: Yi Li To: libvir-list@redhat.com Subject: [PATCH] virQEMUCapsInitQMPArch: Refactor cleanup Date: Wed, 10 Mar 2021 15:46:29 +0800 Message-Id: <20210310074629.630859-1-yili@winhong.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 12A7ksZb022770 X-loop: libvir-list@redhat.com Cc: Yi Li 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 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Switch to using the 'g_auto*' helpers. Signed-off-by: Yi Li Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 790375ac38..447cf77875 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -5044,23 +5044,18 @@ static int virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps, qemuMonitorPtr mon) { - char *archstr =3D NULL; - int ret =3D -1; + g_autofree char *archstr =3D NULL; =20 if (!(archstr =3D qemuMonitorGetTargetArch(mon))) - goto cleanup; + return -1; =20 if ((qemuCaps->arch =3D virQEMUCapsArchFromString(archstr)) =3D=3D VIR= _ARCH_NONE) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Unknown QEMU arch %s"), archstr); - goto cleanup; + return -1; } =20 - ret =3D 0; - - cleanup: - VIR_FREE(archstr); - return ret; + return 0; } =20 =20 --=20 2.25.3