From nobody Tue Sep 9 19:05:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=free.fr Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1749713973242891.6718196211588; Thu, 12 Jun 2025 00:39:33 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 3936F129C; Thu, 12 Jun 2025 03:39:32 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id AA5D710F3; Thu, 12 Jun 2025 03:39:11 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 4D2D5E5C; Wed, 11 Jun 2025 17:58:00 -0400 (EDT) Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 33342D80 for ; Wed, 11 Jun 2025 17:57:59 -0400 (EDT) Received: from 7b1df854676f.paris.ld (unknown [78.198.18.175]) (Authenticated sender: krisstoffe@free.fr) by smtp1-g21.free.fr (Postfix) with ESMTPA id 816C7B0054E; Wed, 11 Jun 2025 23:57:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1749679076; bh=+j/KFe3kB1p//ravj1MjXoa44QO7XfXN6ADdvhMiBng=; h=From:To:Cc:Subject:Date:From; b=aam8FAuLGGE1g3/sc9IRO25VZYGdBRgoNM46gJ8vn90Un0HqkMFN1+0uwPH/w3EQg QmHu6aEuehaHUVuUKWsPSbDy9ozImJ0HnBwq7q+uO3L0PV3spEjLKSGxdtY8xgSdHu PoemSgVSRwO2M0Cg7H+QOPoduO0KNoaBMHdjWerA9nKwY3SGIKRawNYCNU65fVoV57 kxn4aWnxlL2V05JiMz8XSMbOUGhlY32xVub1avCFWJjFhGZAB0NzTKDBE4a2rwqtf/ nc2DujggP3V09iwZA7NA0U6HTAM7x0sTqiPLkryH+rBmgvsk2w9qLQLMJs43HTKSZd +dqHjw1ZzG6SQ== From: Krisstoffe To: devel@lists.libvirt.org Subject: [PATCH] storage: Implement a simple 'checkPool' method for 'rbd' type pools Date: Wed, 11 Jun 2025 21:57:15 +0000 Message-ID: <20250611215753.412-1-krisstoffe@free.fr> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: krisstoffe@free.fr X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: 6CZJOWIOJJBZNM4JILRQQG5AY2OINN2P X-Message-ID-Hash: 6CZJOWIOJJBZNM4JILRQQG5AY2OINN2P X-Mailman-Approved-At: Thu, 12 Jun 2025 07:39:09 -0400 CC: Krisstoffe X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Computed bodyhash is different from the expected one) X-ZM-MESSAGEID: 1749713975573116600 Content-Type: text/plain; charset="utf-8" From: Krisstoffe Resolves: https://gitlab.com/libvirt/libvirt/-/issues/448 Signed-off-by: Krisstoffe Reviewed-by: Peter Krempa --- src/storage/storage_backend_rbd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index 038a1a9e34..29d544d349 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -1442,9 +1442,21 @@ virStorageBackendRBDVolWipe(virStoragePoolObj *pool, } =20 =20 +static int +virStorageBackendRBDCheckPool(virStoragePoolObj *pool, + bool *active) +{ + /* Return previous state remembered by the status XML. If the pool is = not + * available we will fail to refresh it and end up in the same situati= on. */ + *active =3D virStoragePoolObjIsActive(pool); + return 0; +} + + virStorageBackend virStorageBackendRBD =3D { .type =3D VIR_STORAGE_POOL_RBD, =20 + .checkPool =3D virStorageBackendRBDCheckPool, .refreshPool =3D virStorageBackendRBDRefreshPool, .createVol =3D virStorageBackendRBDCreateVol, .buildVol =3D virStorageBackendRBDBuildVol, --=20 2.47.1