From nobody Mon Feb 9 05:41:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1607477886; cv=none; d=zohomail.com; s=zohoarc; b=KekH4xCv19h4aBs2ZCP7+wDafIzqGAo3I45CCXxfakgpx4uSVU4431hvUcvRABdQaPKjHcFRaKPLE1gOiCpC6obI0s099Ce6vXLbO4TPPqe3dOqeaZQ9tA2aQOKfQms8xLEmLtyDsmLNX7ThvS1Qv/y90BIeLjQh/Na7GdDETIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607477886; 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=q7ZJQENtCtg4f0WnT0RWcsSRu4lg4DSzYTO+BZXAU+8=; b=KHR9bqqnX/blCP1/0qmuUYMgsWzC45Y+dMsZuwpn7iW+gJsA43Xo41EMJoRotowWnvDneuKCbh1ZUL5/9Ih9d/Frajfo2HkUz6Dg1RrM8rwQxbTTT5807Q/0/7uTWf+idODTf/G6kHLFiRJQub+cLFcmIYdiGBZrkaxFcJ6feC4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607477886758819.6075745525833; Tue, 8 Dec 2020 17:38:06 -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-537-5FDRjTPqMeWi1j9yIxsZFQ-1; Tue, 08 Dec 2020 20:38:03 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2B7A51E8; Wed, 9 Dec 2020 01:37:56 +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 72DF65C230; Wed, 9 Dec 2020 01:37:56 +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 D9CB9180954D; Wed, 9 Dec 2020 01:37:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B91bpPU007381 for ; Tue, 8 Dec 2020 20:37:51 -0500 Received: by smtp.corp.redhat.com (Postfix) id 485A55D6D5; Wed, 9 Dec 2020 01:37:51 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-50.phx2.redhat.com [10.3.112.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10E9F5D6AB for ; Wed, 9 Dec 2020 01:37:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1607477885; 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=q7ZJQENtCtg4f0WnT0RWcsSRu4lg4DSzYTO+BZXAU+8=; b=FcDpAlHR0tulIMQ+7DRTIcOPG6QX818F89PRVScDJ2FiR04WweclzYSNZExwk5xdinonJU mALM5mL412eRAnQBHruOTObCGU4uUHXz6Zs23pKJb+Vp5RoYkUX7waVyKy+CBtdJXYOhCD t6RWclPPFO62uQUwSPBwXHVduZ/o9wM= X-MC-Unique: 5FDRjTPqMeWi1j9yIxsZFQ-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 1/7] qemu: use g_autoptr for a virPCIDevice Date: Tue, 8 Dec 2020 20:37:39 -0500 Message-Id: <20201209013745.599662-2-laine@redhat.com> In-Reply-To: <20201209013745.599662-1-laine@redhat.com> References: <20201209013745.599662-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.16 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) Content-Type: text/plain; charset="utf-8" The one instance of a virPCIDevice in qemuDomainDeviceCalculatePCIConnectFlags() needs to be converted to use g_autoptr as a prerequisite for a bugfix. It's in this patch by itself (rather than in a patch converting all virPCIDevice usages to g_autoptr) to simplify any backport of said bugfix. Signed-off-by: Laine Stump --- src/qemu/qemu_domain_address.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index d872f75b38..b07672e2f4 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -803,7 +803,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, case VIR_DOMAIN_DEVICE_HOSTDEV: { virDomainHostdevDefPtr hostdev =3D dev->data.hostdev; bool isExpress =3D false; - virPCIDevicePtr pciDev; + g_autoptr(virPCIDevice) pciDev =3D NULL; virPCIDeviceAddressPtr hostAddr =3D &hostdev->source.subsys.u.pci.= addr; =20 if (!virHostdevIsMdevDevice(hostdev) && @@ -891,8 +891,6 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, off_t configLen =3D virFileLength(virPCIDeviceGetConfigPath(pciDev), -1); =20 - virPCIDeviceFree(pciDev); - if (configLen =3D=3D 256) return pciFlags; =20 @@ -904,7 +902,6 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, * a definitive answer. */ isExpress =3D virPCIDeviceIsPCIExpress(pciDev); - virPCIDeviceFree(pciDev); =20 if (isExpress) return pcieFlags; --=20 2.28.0