[PATCH 0/2] Fix storage_file_backend_fs demodularization

2 bugs were missed; brown paper bag was installed Peter Krempa (2): libvirt.spec: Move ownership of 'storage-file' backends directory to gluster storage_file_backend_fs: Compile out 'chown' backend on mingw libvirt.spec.in | 2 +- src/storage_file/storage_file_backend_fs.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) -- 2.48.1

Commit f8558a87ac8525b16f4cbba4f24e0885fde2b79e de-modularized the 'storage-file' backend for local files, and thus now the only possibility to have the directory is when compiling with gluster. This breaks RPM builds when building without gluster as the backend directory no longer exists in such case. Move the stanza requiring the directory under the gluster driver declarations. Fixes: f8558a87ac8525b16f4cbba4f24e0885fde2b79e Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- libvirt.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index b1e223cfbe..f513ca9173 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -2098,7 +2098,6 @@ exit 0 %dir %attr(0755, root, root) %{_libdir}/libvirt/ %dir %attr(0755, root, root) %{_libdir}/libvirt/connection-driver/ %dir %attr(0755, root, root) %{_libdir}/libvirt/storage-backend/ -%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/ %{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.api.policy %{_datadir}/polkit-1/rules.d/50-libvirt.rules @@ -2293,6 +2292,7 @@ exit 0 %if %{with_storage_gluster} %files daemon-driver-storage-gluster %{_libdir}/libvirt/storage-backend/libvirt_storage_backend_gluster.so +%dir %attr(0755, root, root) %{_libdir}/libvirt/storage-file/ %{_libdir}/libvirt/storage-file/libvirt_storage_file_gluster.so %endif -- 2.48.1

Otherwise build on mingw complains: src/storage_file/storage_file_backend_fs.c:142:12: error: implicit declaration of function 'chown Fixes: f8558a87ac8525b16f4cbba4f24e0885fde2b79e Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/storage_file/storage_file_backend_fs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/storage_file/storage_file_backend_fs.c b/src/storage_file/storage_file_backend_fs.c index 1de822200d..92de403e3a 100644 --- a/src/storage_file/storage_file_backend_fs.c +++ b/src/storage_file/storage_file_backend_fs.c @@ -23,6 +23,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <unistd.h> #include "virerror.h" #include "storage_file_backend.h" @@ -134,6 +135,7 @@ virStorageFileBackendFileAccess(virStorageSource *src, } +#ifndef WIN32 static int virStorageFileBackendFileChown(const virStorageSource *src, uid_t uid, @@ -141,6 +143,7 @@ virStorageFileBackendFileChown(const virStorageSource *src, { return chown(src->path, uid, gid); } +#endif virStorageFileBackend virStorageFileBackendFile = { @@ -154,7 +157,9 @@ virStorageFileBackend virStorageFileBackendFile = { .storageFileStat = virStorageFileBackendFileStat, .storageFileRead = virStorageFileBackendFileRead, .storageFileAccess = virStorageFileBackendFileAccess, +#ifndef WIN32 .storageFileChown = virStorageFileBackendFileChown, +#endif }; @@ -167,7 +172,9 @@ virStorageFileBackend virStorageFileBackendBlock = { .storageFileStat = virStorageFileBackendFileStat, .storageFileRead = virStorageFileBackendFileRead, .storageFileAccess = virStorageFileBackendFileAccess, +#ifndef WIN32 .storageFileChown = virStorageFileBackendFileChown, +#endif }; @@ -178,7 +185,9 @@ virStorageFileBackend virStorageFileBackendDir = { .backendDeinit = virStorageFileBackendFileDeinit, .storageFileAccess = virStorageFileBackendFileAccess, +#ifndef WIN32 .storageFileChown = virStorageFileBackendFileChown, +#endif }; -- 2.48.1

On Mon, Jan 20, 2025 at 16:18:36 +0100, Peter Krempa wrote:
2 bugs were missed; brown paper bag was installed
Peter Krempa (2): libvirt.spec: Move ownership of 'storage-file' backends directory to gluster storage_file_backend_fs: Compile out 'chown' backend on mingw
libvirt.spec.in | 2 +- src/storage_file/storage_file_backend_fs.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
participants (2)
-
Jiri Denemark
-
Peter Krempa