From nobody Sat Feb 7 04:40:26 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=1654697330; cv=none; d=zohomail.com; s=zohoarc; b=XeVNMNeoOnPatAsHyYc5m+zTqWuvyvgBn6UmYten/WmezK9oY3pbW3/dNonGXIUOmkzwDYbqmACB214QDldwHcyyhheW7R7FimFRyRPEBOgmYXp3ZU0jZpayKYYrm2BfjpBO0y6WKeR84707rNZvWMHK6DIMH4lWjYMimXvXlWI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654697330; 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=+g5MmJ1F16BjzkfKong4Z/bEMDqgx2H/JBht7A6sUfo=; b=Nk9BDin9uFEXrv4vwXWRfVsODsJFOA5clOYquUklfwwDjeW92eZLHcE+NcggOT9NY1bau8BDfb3nYU/gahYVhWp7+Mgw5x8/L048Ir6w7vVlV+EtRcrarzX/FBmsICZkXuMAmyNswBi8UE/U46Cek9IZrGEF843pcKT6W59dQw4= 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 1654697330399835.777385009539; Wed, 8 Jun 2022 07:08:50 -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-648-5QqM63Y0OAG6WezPbLvIyg-1; Wed, 08 Jun 2022 10:08:40 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 755E4196F5BA; Wed, 8 Jun 2022 14:08:35 +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 3513D1121314; Wed, 8 Jun 2022 14:08:35 +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 E24901947055; Wed, 8 Jun 2022 14:08:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5BC661947040 for ; Wed, 8 Jun 2022 13:43:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3E3EC492C3B; Wed, 8 Jun 2022 13:43:12 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id D9EBA492CA3 for ; Wed, 8 Jun 2022 13:43:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654697329; 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=+g5MmJ1F16BjzkfKong4Z/bEMDqgx2H/JBht7A6sUfo=; b=ScmN34Fopb5gTMEOvFmjFkm4h1nuiHS+FqfDh5E10H3m7dblQJ1WeerZoblKORpXEAq5eB q9NBTufn06PNilzN72FZMhfODHwSDN4o8r/zOdJYT+CgqNpUWmX7lZtbcbMsJD4pT2tU0M 7WpB5q2hXWs6mNcUXHFQxhKlrCC7lAE= X-MC-Unique: 5QqM63Y0OAG6WezPbLvIyg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 02/15] virDomainDefParseIOThreads: Use g_autoptr() for @iothrid Date: Wed, 8 Jun 2022 15:42:56 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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.78 on 10.11.54.3 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: 1654697330679100001 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 9f75012f1f..cc1f765ca9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17047,7 +17047,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 @@ -17055,10 +17056,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