From nobody Tue Jan 21 07:24: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=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1736413854393246.81066308402853; Thu, 9 Jan 2025 01:10:54 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 534B31562; Thu, 9 Jan 2025 04:10:53 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 54906154C; Thu, 9 Jan 2025 04:10:15 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 71CC214B1; Thu, 9 Jan 2025 04:10:12 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 E2D6814B6 for ; Thu, 9 Jan 2025 04:10:11 -0500 (EST) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-340-fLDCfblQPo6Z6Dp_T4GaEg-1; Thu, 09 Jan 2025 04:10:10 -0500 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 413E319560BA for ; Thu, 9 Jan 2025 09:10:09 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.7]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 70570195E3DE for ; Thu, 9 Jan 2025 09:10:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736413811; h=from:from: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; bh=qjMYaIOE84bF6HXA6o5J1TRG98k2dt0dTX8/bG24VXM=; b=PdSdeHC8fSJzbcrnbqdS+SqVFZHpP94Twz05o/iUH630DLzxH5wQjh3g6YmlZhoXNgfuAT aYhFOSXv/UKRvMoB9eNDCSYlEL2jdcsyvMzVujva30Ma7Ap7hi3dwI7dPFSZP6aHGr873l nDbq9HdgcUWgLpbfqxnKrZRu/gFSY4c= X-MC-Unique: fLDCfblQPo6Z6Dp_T4GaEg-1 X-Mimecast-MFC-AGG-ID: fLDCfblQPo6Z6Dp_T4GaEg From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 1/2] storage_file: de-modularize the local file backend Date: Thu, 9 Jan 2025 10:10:03 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wZLgSSbwo3LgYhr8Cfh49KjT-9XKcKBK0B_jfV1nK-8_1736413809 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YM32NU74RFLI6GTQJC22VDQ42VUA3O3U X-Message-ID-Hash: YM32NU74RFLI6GTQJC22VDQ42VUA3O3U X-MailFrom: pkrempa@redhat.com 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; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header 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 (Header signature does not verify) X-ZM-MESSAGEID: 1736413856528116600 Content-Type: text/plain; charset="utf-8" The 'storage_file' infrastructure serves as an abstraction on top of file-looking storage technologies. Apart from local file it currently implements also a backend for 'gluster'. Historically it was all modularized and the local file module was usually packaged with the 'core' part of the storage driver. Now with split daemons one can install e.g. 'virqemud' without the storage driver core which contains the 'fs' backend module. Since the qemu driver uses the storage file backends to e.g. create storage for snapshots and backups this allows users to create a deployment where some things will not work properly. As the 'fs' backend doesn't use any code that wouldn't be linked directly anyways there's no point in actually shipping it as a module. Let's compile it in so that all deployments can use it. To achieve that, compile the source directly into the 'virt_storage_file_lib' static library and remove the loading code. Also adjust the spec file. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- libvirt.spec.in | 1 - src/storage_file/meson.build | 16 ---------------- src/storage_file/storage_file_backend.c | 11 ++++++----- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 2bc8dfd323..b1e223cfbe 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -2268,7 +2268,6 @@ exit 0 %ghost %dir %{_rundir}/libvirt/storage/ %{_libdir}/libvirt/connection-driver/libvirt_driver_storage.so %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_fs.so -%{_libdir}/libvirt/storage-file/libvirt_storage_file_fs.so %{_mandir}/man8/virtstoraged.8* %files daemon-driver-storage-disk diff --git a/src/storage_file/meson.build b/src/storage_file/meson.build index d40e98befa..27c4e5a432 100644 --- a/src/storage_file/meson.build +++ b/src/storage_file/meson.build @@ -3,9 +3,6 @@ storage_file_sources =3D [ 'storage_source_backingstore.c', 'storage_file_backend.c', 'storage_file_probe.c', -] - -stoarge_file_fs_sources =3D [ 'storage_file_backend_fs.c', ] @@ -30,19 +27,6 @@ virt_storage_file_lib =3D static_library( libvirt_libs +=3D virt_storage_file_lib -if conf.has('WITH_STORAGE') - virt_modules +=3D { - 'name': 'virt_storage_file_fs', - 'sources': [ - files(stoarge_file_fs_sources), - ], - 'include': [ - storage_inc_dir, - ], - 'install_dir': storage_file_install_dir, - } -endif - if conf.has('WITH_STORAGE_GLUSTER') virt_modules +=3D { 'name': 'virt_storage_file_gluster', diff --git a/src/storage_file/storage_file_backend.c b/src/storage_file/sto= rage_file_backend.c index 03583803de..1eeec5fb43 100644 --- a/src/storage_file/storage_file_backend.c +++ b/src/storage_file/storage_file_backend.c @@ -26,6 +26,7 @@ #include "virerror.h" #include "internal.h" #include "storage_file_backend.h" +#include "storage_file_backend_fs.h" #include "virlog.h" #include "virmodule.h" #include "virfile.h" @@ -40,7 +41,7 @@ VIR_LOG_INIT("storage.storage_source_backend"); static virStorageFileBackend *virStorageFileBackends[VIR_STORAGE_BACKENDS_= MAX]; static size_t virStorageFileBackendsCount; -#if WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER +#if WITH_STORAGE_GLUSTER # define STORAGE_FILE_MODULE_DIR LIBDIR "/libvirt/storage-file" @@ -64,14 +65,14 @@ virStorageFileLoadBackendModule(const char *name, return ret; } -#endif /* WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER */ +#endif /* WITH_STORAGE_GLUSTER */ static int virStorageFileBackendOnceInit(void) { -#if WITH_STORAGE_DIR || WITH_STORAGE_FS - if (virStorageFileLoadBackendModule("fs", "virStorageFileFsRegister", = false) < 0) + /* The backend for local files is compiled in */ + if (virStorageFileFsRegister() < 0) return -1; -#endif /* WITH_STORAGE_DIR || WITH_STORAGE_FS */ + #if WITH_STORAGE_GLUSTER if (virStorageFileLoadBackendModule("gluster", "virStorageFileGlusterR= egister", false) < 0) return -1; --=20 2.47.1