From nobody Sun May 19 14:14:27 2024 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=1691503255; cv=none; d=zohomail.com; s=zohoarc; b=X8gd6LHMd9v6qsN0IBQq18AlAsCv6o9zrVDXu/hj3SfMX5OUxklTRNeh/WKAn1WlPsB+0ss3wCiH9tnG+m4levf2pg3i8SizwAVHTLXdEuu11LDtHS35sUqEG/OqSl8lOIyPhO+aIQlxDrV/Il218r62xPPWQdGeffTd7rLnBl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1691503255; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=qNT2XqyPCBfsabpiHQFs8ykl0eca8md10EdVtPr/3MA=; b=ZB5XFc6+nDQ5GQpWw9KnPz99vItBP7mfguigUGwRRRbvpnQrb7aM4xGeBt//9Ztw6zRb6A+RzyV/FzVAEJrG9irQnW4S9QmOUVT0zl8BhgRhepg4hq23q/EENtVn8gbutQI1Xnwt0nwI4QtQfDlXoAZYbviIvMlZM1KQGSjuMbI= 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 1691503255248450.9269519284536; Tue, 8 Aug 2023 07:00:55 -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-623-g_H07YeANci8tG4ub-Gm0Q-1; Tue, 08 Aug 2023 10:00:28 -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 6597E85D067; Tue, 8 Aug 2023 14:00:22 +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 E1B751121314; Tue, 8 Aug 2023 14:00:19 +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 679361946587; Tue, 8 Aug 2023 14:00:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8A1E61946586 for ; Tue, 8 Aug 2023 14:00:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 67BFE2026D68; Tue, 8 Aug 2023 14:00:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9E4A2026D4B for ; Tue, 8 Aug 2023 14:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691503254; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qNT2XqyPCBfsabpiHQFs8ykl0eca8md10EdVtPr/3MA=; b=NSSinISqB8I2H1+csGRvEonzZIRdwwhxAx1IpeusAarWv3GlfpV+6JegPYg1wAB5N+T5cI h28Zy0av4X/IoofI7FdcJvvDdoptWdvGDewiB0IU1zRkR/sxejSO3P8m2R634RatC25kf6 zrebYHFiG4ad1RoQqBM2de05CHnZ/Aw= X-MC-Unique: g_H07YeANci8tG4ub-Gm0Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] virStorageBackendLogicalCheckPool: Properly mark empty logical pools as active Date: Tue, 8 Aug 2023 16:00:16 +0200 Message-ID: <3d0cd13a1d80bb0ec358e8bcc41d8847b1add9d5.1691503216.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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 3.1 on 10.11.54.3 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: 1691503275567100001 Content-Type: text/plain; charset="utf-8" The '/dev' filesystem convenience directory for a LVM volume group is not created when the volume group is empty. The logic in 'virStorageBackendLogicalCheckPool' which is used to see whether a pool is active was first checking presence of the directory, which failed for an empty VG. Since the second step is virStorageBackendLogicalMatchPoolSource which is checking mapping between configured PVs and the VG, we can simply rely on the function to also check presence of the pool. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2228223 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/storage/storage_backend_logical.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_ba= ckend_logical.c index 9462ac6790..6acbc37f18 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -624,13 +624,7 @@ static int virStorageBackendLogicalCheckPool(virStoragePoolObj *pool, bool *isActive) { - virStoragePoolDef *def =3D virStoragePoolObjGetDef(pool); - - /* If we can find the target.path as well as ensure that the - * pool's def source - */ - *isActive =3D virFileExists(def->target.path) && - virStorageBackendLogicalMatchPoolSource(pool); + *isActive =3D virStorageBackendLogicalMatchPoolSource(pool); return 0; } --=20 2.41.0