From nobody Sun Feb 8 18:43:09 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=1639404047; cv=none; d=zohomail.com; s=zohoarc; b=Be47R/36Z2LTalwEP1m/kAuqK7tFl9fnNEjPW0lT3PBewjIyDRhmSy4CfDfVKaBCWbfeFkoT/o9Q1SAdxU0N+NVAyGEpHK4sPFfyh9yNjajHsswLSJ44M+O6WVzOu6aOtDVGxv2NlNCVQ8U93oa9OKxeF4QdyU2SPyIn5PmEVrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639404047; 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=Klw9XPpWtMxUPohMIXg9MLP8lSxMheT7zICwXxdyf7o=; b=I8I1zFHVv0/gtOsAVAzT7E6W0zasnPfjr2sMQOoHxMPzAyKg/gnsUlCgLK/YuRpdW1CzgI3o1039/wWQVqrjf7F8gxpUy6rxCa/fEPFZaIBRlBMDGgv3TmEwexLkd9581pDT2bqc9dm6/k5uaH+/Cn9YNRSFzgg7ZLMIM5/QbJ8= 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 1639404047745745.0792275374537; Mon, 13 Dec 2021 06:00:47 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-560-RDDJiLKfO3CYI-aTpUrgEA-1; Mon, 13 Dec 2021 09:00:38 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8CE56344E5; Mon, 13 Dec 2021 14:00:04 +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 62CEB22DFE; Mon, 13 Dec 2021 14:00:04 +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 1EC1B4A70A; Mon, 13 Dec 2021 14:00:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1BDDxsSn002595 for ; Mon, 13 Dec 2021 08:59:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id DF47316A31; Mon, 13 Dec 2021 13:59:54 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66C7F16A32 for ; Mon, 13 Dec 2021 13:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639404046; 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=Klw9XPpWtMxUPohMIXg9MLP8lSxMheT7zICwXxdyf7o=; b=XTmwGyJv7mNYFuSSV6qA/cB1fJg7Zmf4cGWiCwH0b0YmPirCVxu6HWhYv9mcqrqG40SKQs OFRPV5Y2nVx+Gh8oa1CGJHqVpjZXxLgqy/n+aQgs6bDfJ1z0hle+sy+kh9fSQ2Skam5O3/ VilPg0WX6o0WPJmqQrco78p6tc5GBVg= X-MC-Unique: RDDJiLKfO3CYI-aTpUrgEA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 11/14] storage: logical: use two cmd vars in GetPoolSources Date: Mon, 13 Dec 2021 14:59:40 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1639404058811100002 Do not mix manual and automatic freeing. Signed-off-by: J=C3=A1n Tomko --- src/storage/storage_backend_logical.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index ed490b0201..3f27e63aeb 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -477,23 +477,23 @@ virStorageBackendLogicalGetPoolSources(virStoragePool= SourceList *sourceList) int vars[] =3D { 2 }; - g_autoptr(virCommand) cmd =3D NULL; + g_autoptr(virCommand) vgcmd =3D NULL; + g_autoptr(virCommand) pvcmd =3D NULL; =20 /* * NOTE: ignoring errors here; this is just to "touch" any logical vol= umes * that might be hanging around, so if this fails for some reason, the * worst that happens is that scanning doesn't pick everything up */ - cmd =3D virCommandNew(VGSCAN); - if (virCommandRun(cmd, NULL) < 0) + vgcmd =3D virCommandNew(VGSCAN); + if (virCommandRun(vgcmd, NULL) < 0) VIR_WARN("Failure when running vgscan to refresh physical volumes"= ); - virCommandFree(cmd); =20 - cmd =3D virCommandNewArgList(PVS, - "--noheadings", - "-o", "pv_name,vg_name", - NULL, NULL); - return virCommandRunRegex(cmd, 1, regexes, vars, + pvcmd =3D virCommandNewArgList(PVS, + "--noheadings", + "-o", "pv_name,vg_name", + NULL, NULL); + return virCommandRunRegex(pvcmd, 1, regexes, vars, virStorageBackendLogicalFindPoolSourcesFunc, sourceList, "pvs", NULL); } --=20 2.31.1