From nobody Mon Feb 9 15:26:35 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1654154352; cv=none; d=zohomail.com; s=zohoarc; b=KXYmSh00bsNWEw1MnZYoDuHjoPlz9SuRiLCSQ7gCSbufkdA482Cjc/FohYkzxZXWksElBRx+OgMXPgX6Q3ndBUBWpYJ5KaTxPZHj1Tq3W3avdvHCvRFQ6JyAuQyfpC9xV8eRb3E8nQppEubdlxP5bXzb6/9Gl5Lw3QNYy760rUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654154352; 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=3BUsKLD5UMzscaf2aEzE6ePE49k92roUpP1+AYrTwjk=; b=nklCRwbMHxdp+0iMPKKlh2NupRlKbtDv2xCjlLfgN/ZNU2RSrYpvo8abKrubVxF+HQ4LwTjUauzch0bqIG7J5YOfbQRUOD1RAAAT1vqH3WH5feyC0eC1z8QGlvJE+aHWP3O1n9Y71kWMysQ316WojTGDHqL44iXH6vG2YR2cmU8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1654154352723416.80097223836754; Thu, 2 Jun 2022 00:19:12 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-543-p_PKa6VnMviKrQpsmiT6Ww-1; Thu, 02 Jun 2022 03:18:19 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 28C23100BAB7; Thu, 2 Jun 2022 07:18:16 +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 14269492C3B; Thu, 2 Jun 2022 07:18:16 +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 AEF631954F67; Thu, 2 Jun 2022 07:18:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EE4EC1954F5A for ; Thu, 2 Jun 2022 07:18:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B87232166B2D; Thu, 2 Jun 2022 07:18:13 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60D8F2166B26 for ; Thu, 2 Jun 2022 07:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654154351; 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=3BUsKLD5UMzscaf2aEzE6ePE49k92roUpP1+AYrTwjk=; b=Gd1LBbqjjr+4G2gNMRqGZHchdq/Ji/QPRmyDPkHoVom6T61zuAQxz2Y0sw3+b7MeHlh43p joNEQm1gkpTEUi+qHmiV1p+WxDWM8CQhQEd6ZoFoqS96AbefCHTsatP5mt6xN6IZWUounL S0KtOwKW+L40gIUmmZz5G6jCeUunHAI= X-MC-Unique: p_PKa6VnMviKrQpsmiT6Ww-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 03/16] virDomainDefParseIOThreads: Use g_autoptr() for @iothrid Date: Thu, 2 Jun 2022 09:17:53 +0200 Message-Id: <3eb76f2f003c72ce26c1929de93bb211cdad4bd6.1654154053.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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 X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1654154353912100017 Content-Type: text/plain; charset="utf-8"; x-default="true" Using g_autoptr() for @iothrid variable inside virDomainDefParseIOThreads() allows us to drop explicit call to virDomainIOThreadIDDefFree() in one case. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/conf/domain_conf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5d0d436a40..3b4274e037 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17046,7 +17046,8 @@ virDomainDefParseIOThreads(virDomainDef *def, def->iothreadids =3D g_new0(virDomainIOThreadIDDef *, n); =20 for (i =3D 0; i < n; i++) { - virDomainIOThreadIDDef *iothrid =3D NULL; + g_autoptr(virDomainIOThreadIDDef) iothrid =3D NULL; + if (!(iothrid =3D virDomainIOThreadIDDefParseXML(nodes[i]))) return -1; =20 @@ -17054,10 +17055,9 @@ virDomainDefParseIOThreads(virDomainDef *def, virReportError(VIR_ERR_XML_ERROR, _("duplicate iothread id '%u' found"), iothrid->iothread_id); - virDomainIOThreadIDDefFree(iothrid); return -1; } - def->iothreadids[def->niothreadids++] =3D iothrid; + def->iothreadids[def->niothreadids++] =3D g_steal_pointer(&iothrid= ); } =20 return virDomainIOThreadIDDefArrayInit(def, iothreads); --=20 2.35.1