From nobody Tue Feb 10 12:39:48 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=fail(p=quarantine dis=quarantine) header.from=huawei.com ARC-Seal: i=1; a=rsa-sha256; t=1672922020; cv=none; d=zohomail.com; s=zohoarc; b=NSNlLiuEn0ljq73O104YHkYrLlMymfqI7G4P6pQHd0lED/kj1oqgFBazCa9TK7G8a46c9rjskee26c56R8VRW1BeSUHYBokr2VujrK/iO/R5idh7Y+soTHEB57eA59cG3gMdG+3nrVaxjqkNqbcmdGxWrsbeGFLWlADEp8OFuSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672922020; 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=gMohrj4+gQFM+6E72ru/PLuIBk7HC/Yqxkpocfjowpk=; b=OzJozx73PZb1twyaVLnHUvXB7x214N9zFUt0ZksqGjiY/obV3bdqNGTv0/YKChFA41OFgwQ7WyvMZj7coKTVQKcU5sJHfr/5oxpjKQbygXtrBf3SlPf164sXB2qjxJD+fA8Od6rOV+FgGL2NjOqShLH0HWhNaKre4cFpzGHEpiM= 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=fail header.from= (p=quarantine dis=quarantine) 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 1672922020955202.55806660585608; Thu, 5 Jan 2023 04:33:40 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-312-8b1RfXX8Nxe2gzAviM3AsQ-1; Thu, 05 Jan 2023 07:33:23 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 46F7F38123C2; Thu, 5 Jan 2023 12:33:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27254492B09; Thu, 5 Jan 2023 12:33:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E70D019465BA; Thu, 5 Jan 2023 12:33:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E01E619465A2 for ; Thu, 5 Jan 2023 12:33:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CE92D1415303; Thu, 5 Jan 2023 12:33:13 +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 C723E14152F6 for ; Thu, 5 Jan 2023 12:33:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id ACB6F857A9F for ; Thu, 5 Jan 2023 12:33:13 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-olu5w8uPOhG_r8UCCVintg-1; Thu, 05 Jan 2023 07:33:11 -0500 Received: from dggpeml500022.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Nnm3J0zLqzqTwp for ; Thu, 5 Jan 2023 20:28:28 +0800 (CST) Received: from localhost.localdomain (10.175.124.27) by dggpeml500022.china.huawei.com (7.185.36.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Thu, 5 Jan 2023 20:33:08 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672922019; 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=gMohrj4+gQFM+6E72ru/PLuIBk7HC/Yqxkpocfjowpk=; b=Bshc/uR77CpQsX3WC0iuM7dSCIeVgxCHYO+d230vkEWdTBde3haDTtXzMxX4ig8GYstP8t +c6E76dMU8llJy/+P43+i89OolhbdM2TbQkAW5qDlfHbpA5aXmrCptxmIQHJhBfeOj/euB gr7iP0o2j2GfAOFK62p7QyCCeGsWvBA= X-MC-Unique: 8b1RfXX8Nxe2gzAviM3AsQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: olu5w8uPOhG_r8UCCVintg-1 From: Jiang Jiacheng To: Subject: [PATCH 9/9] vz: use g_autofree and remove unnecessary label Date: Thu, 5 Jan 2023 20:26:55 +0800 Message-ID: <20230105122655.3413625-10-jiangjiacheng@huawei.com> In-Reply-To: <20230105122655.3413625-1-jiangjiacheng@huawei.com> References: <20230105122655.3413625-1-jiangjiacheng@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500022.china.huawei.com (7.185.36.66) X-CFilter-Loop: Reflected 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 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yubihong@huawei.com, zhengchuan@huawei.com, linyilu@huawei.com, jiangjiacheng@huawei.com, xiexiangyou@huawei.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672922022482100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiang Jiacheng --- src/vz/vz_utils.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c index fcf6d363a9..219d13823b 100644 --- a/src/vz/vz_utils.c +++ b/src/vz/vz_utils.c @@ -151,7 +151,8 @@ vzInitCaps(unsigned long vzVersion, struct _vzCapabilit= ies *vzCaps) int vzInitVersion(struct _vzDriver *driver) { - char *output, *sVer, *tmp; + g_autofree char *output =3D NULL; + char *sVer, *tmp; const char *searchStr =3D "prlsrvctl version "; int ret =3D -1; =20 @@ -159,12 +160,12 @@ vzInitVersion(struct _vzDriver *driver) =20 if (!output) { vzParseError(); - goto cleanup; + return -1; } =20 if (!(sVer =3D strstr(output, searchStr))) { vzParseError(); - goto cleanup; + return -1; } =20 sVer =3D sVer + strlen(searchStr); @@ -173,26 +174,23 @@ vzInitVersion(struct _vzDriver *driver) * In libvirt we handle only first two numbers. */ if (!(tmp =3D strchr(sVer, '.'))) { vzParseError(); - goto cleanup; + return -1; } =20 if (!(tmp =3D strchr(tmp + 1, '.'))) { vzParseError(); - goto cleanup; + return -1; } =20 tmp[0] =3D '\0'; if (virStringParseVersion(&(driver->vzVersion), sVer, true) < 0) { vzParseError(); - goto cleanup; + return -1; } =20 vzInitCaps(driver->vzVersion, &driver->vzCaps); - ret =3D 0; =20 - cleanup: - VIR_FREE(output); - return ret; + return 0; } =20 static int --=20 2.33.0