]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: move storage file sources to separate directory
authorPavel Hrdina <phrdina@redhat.com>
Wed, 2 Dec 2020 12:10:59 +0000 (13:10 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Fri, 22 Jan 2021 10:10:27 +0000 (11:10 +0100)
Introduce a new storage_file directory where we will keep storage file
related code. Add a backend prefix to the file name to separate it from
other future files with 'storage_file' prefix.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
po/POTFILES.in
src/meson.build
src/storage/meson.build
src/storage_file/meson.build [new file with mode: 0644]
src/storage_file/storage_file_backend_fs.c [moved from src/storage/storage_file_fs.c with 98% similarity]
src/storage_file/storage_file_backend_fs.h [moved from src/storage/storage_file_fs.h with 90% similarity]
src/storage_file/storage_file_backend_gluster.c [moved from src/storage/storage_file_gluster.c with 98% similarity]
src/storage_file/storage_file_backend_gluster.h [moved from src/storage/storage_file_gluster.h with 91% similarity]

index 14636d4b937e4e670b931eac1495e9be27c5b9ba..397453a1c9e48fa4b2812c6ebda65482438c9256 100644 (file)
 @SRCDIR@src/storage/storage_backend_vstorage.c
 @SRCDIR@src/storage/storage_backend_zfs.c
 @SRCDIR@src/storage/storage_driver.c
-@SRCDIR@src/storage/storage_file_fs.c
-@SRCDIR@src/storage/storage_file_gluster.c
 @SRCDIR@src/storage/storage_util.c
+@SRCDIR@src/storage_file/storage_file_backend_fs.c
+@SRCDIR@src/storage_file/storage_file_backend_gluster.c
 @SRCDIR@src/test/test_driver.c
 @SRCDIR@src/util/iohelper.c
 @SRCDIR@src/util/viralloc.c
index 7c478219d65ec6f3b69ec05398fa4aff3816704b..3aa9498b98a36b6eaf2b0863d374625528b6a475 100644 (file)
@@ -266,6 +266,7 @@ subdir('nwfilter')
 subdir('secret')
 subdir('security')
 subdir('storage')
+subdir('storage_file')
 
 subdir('bhyve')
 subdir('esx')
index b4cefe9a89bde06bc9a16fc2a5ebe6f80df9205a..8537359e93f9c6b899cff130fad6ab7ced0a3293 100644 (file)
@@ -15,10 +15,6 @@ storage_backend_fs_sources = [
   'storage_backend_fs.c',
 ]
 
-stoarge_file_fs_sources = [
-  'storage_file_fs.c',
-]
-
 storage_backend_disk_sources = [
   'storage_backend_disk.c',
 ]
@@ -31,10 +27,6 @@ storage_backend_gluster_sources = [
   'storage_backend_gluster.c',
 ]
 
-storage_file_gluster_sources = [
-  'storage_file_gluster.c',
-]
-
 storage_backend_iscsi_sources = [
   'storage_backend_iscsi.c',
 ]
@@ -72,7 +64,6 @@ storage_backend_zfs_sources = [
 ]
 
 storage_backend_install_dir = libdir / 'libvirt' / 'storage-backend'
-storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
 
 if conf.has('WITH_STORAGE')
   storage_driver_impl_lib = static_library(
@@ -109,14 +100,6 @@ if conf.has('WITH_STORAGE')
     'install_dir': storage_backend_install_dir,
   }
 
-  virt_modules += {
-    'name': 'virt_storage_file_fs',
-    'sources': [
-      files(stoarge_file_fs_sources),
-    ],
-    'install_dir': storage_file_install_dir,
-  }
-
   virt_daemons += {
     'name': 'virtstoraged',
     'c_args': [
@@ -181,17 +164,6 @@ if conf.has('WITH_STORAGE_GLUSTER')
     ],
     'install_dir': storage_backend_install_dir,
   }
-
-  virt_modules += {
-    'name': 'virt_storage_file_gluster',
-    'sources': [
-      files(storage_file_gluster_sources),
-    ],
-    'deps': [
-      glusterfs_dep,
-    ],
-    'install_dir': storage_file_install_dir,
-  }
 endif
 
 if conf.has('WITH_STORAGE_ISCSI')
@@ -303,3 +275,5 @@ if conf.has('WITH_STORAGE_ZFS')
     'install_dir': storage_backend_install_dir,
   }
 endif
+
+storage_inc_dir = include_directories('.')
diff --git a/src/storage_file/meson.build b/src/storage_file/meson.build
new file mode 100644 (file)
index 0000000..898b1bd
--- /dev/null
@@ -0,0 +1,38 @@
+stoarge_file_fs_sources = [
+  'storage_file_backend_fs.c',
+]
+
+storage_file_gluster_sources = [
+  'storage_file_backend_gluster.c',
+]
+
+storage_file_install_dir = libdir / 'libvirt' / 'storage-file'
+
+if conf.has('WITH_STORAGE')
+  virt_modules += {
+    '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 += {
+    'name': 'virt_storage_file_gluster',
+    'sources': [
+      files(storage_file_gluster_sources),
+    ],
+    'include': [
+      storage_inc_dir,
+    ],
+    'deps': [
+      glusterfs_dep,
+    ],
+    'install_dir': storage_file_install_dir,
+  }
+endif
similarity index 98%
rename from src/storage/storage_file_fs.c
rename to src/storage_file/storage_file_backend_fs.c
index 5a44ef8c2d1bad0f19231fcf105391be0da590d1..42e514e4377bdaa363436249a65730390e9789a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * storage_file_fs.c: storage file code for FS and directory handling
+ * storage_file_backend_fs.c: storage file code for FS and directory handling
  *
  * Copyright (C) 2007-2018 Red Hat, Inc.
  *
@@ -25,7 +25,7 @@
 #include <fcntl.h>
 
 #include "virerror.h"
-#include "storage_file_fs.h"
+#include "storage_file_backend_fs.h"
 #include "storage_util.h"
 #include "virstoragefilebackend.h"
 #include "vircommand.h"
similarity index 90%
rename from src/storage/storage_file_fs.h
rename to src/storage_file/storage_file_backend_fs.h
index 86a625232d0eb375899329da4e64179d1e73e37f..330c6db383ced952a37e473d4a0d9113507e7ca6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * storage_file_fs.h: storage file code for FS and directory handling
+ * storage_file_backend_fs.h: storage file code for FS and directory handling
  *
  * Copyright (C) 2018 Red Hat, Inc.
  *
similarity index 98%
rename from src/storage/storage_file_gluster.c
rename to src/storage_file/storage_file_backend_gluster.c
index 2560e10d372648ace266aee76aba1997669b2f12..e6ce8d4c928c6a32084802b4842588c7bf5903b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * storage_file_gluster.c: storage file backend for Gluster handling
+ * storage_file_backend_gluster.c: storage file backend for Gluster handling
  *
  * Copyright (C) 2013-2018 Red Hat, Inc.
  *
@@ -23,7 +23,7 @@
 
 #include <glusterfs/api/glfs.h>
 
-#include "storage_file_gluster.h"
+#include "storage_file_backend_gluster.h"
 #include "viralloc.h"
 #include "virerror.h"
 #include "virlog.h"
similarity index 91%
rename from src/storage/storage_file_gluster.h
rename to src/storage_file/storage_file_backend_gluster.h
index 1feaf3a8b98aa5e2a9df94aaaf04d5ca67c3a6c3..3849e69902d9248514cc90f73d273b31617b9251 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * storage_file_gluster.h: storage file backend for Gluster handling
+ * storage_file_backend_gluster.h: storage file backend for Gluster handling
  *
  * Copyright (C) 2018 Red Hat, Inc.
  *