[libvirt PATCH v2 04/13] storage: move storage file sources to separate directory

Pavel Hrdina phrdina at redhat.com
Thu Jan 21 19:34:18 UTC 2021


Introduce a new storage_file directory where we will keep storage file
related code.

Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
 po/POTFILES.in                                |  4 +-
 src/meson.build                               |  1 +
 src/storage/meson.build                       | 30 +--------------
 src/storage_file/meson.build                  | 38 +++++++++++++++++++
 .../storage_file_fs.c                         |  0
 .../storage_file_fs.h                         |  0
 .../storage_file_gluster.c                    |  0
 .../storage_file_gluster.h                    |  0
 8 files changed, 43 insertions(+), 30 deletions(-)
 create mode 100644 src/storage_file/meson.build
 rename src/{storage => storage_file}/storage_file_fs.c (100%)
 rename src/{storage => storage_file}/storage_file_fs.h (100%)
 rename src/{storage => storage_file}/storage_file_gluster.c (100%)
 rename src/{storage => storage_file}/storage_file_gluster.h (100%)

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 14636d4b93..e9fc3991f1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -222,9 +222,9 @@
 @SRCDIR at src/storage/storage_backend_vstorage.c
 @SRCDIR at src/storage/storage_backend_zfs.c
 @SRCDIR at src/storage/storage_driver.c
- at SRCDIR@src/storage/storage_file_fs.c
- at SRCDIR@src/storage/storage_file_gluster.c
 @SRCDIR at src/storage/storage_util.c
+ at SRCDIR@src/storage_file/storage_file_fs.c
+ at SRCDIR@src/storage_file/storage_file_gluster.c
 @SRCDIR at src/test/test_driver.c
 @SRCDIR at src/util/iohelper.c
 @SRCDIR at src/util/viralloc.c
diff --git a/src/meson.build b/src/meson.build
index 7c478219d6..3aa9498b98 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -266,6 +266,7 @@ subdir('nwfilter')
 subdir('secret')
 subdir('security')
 subdir('storage')
+subdir('storage_file')
 
 subdir('bhyve')
 subdir('esx')
diff --git a/src/storage/meson.build b/src/storage/meson.build
index b4cefe9a89..8537359e93 100644
--- a/src/storage/meson.build
+++ b/src/storage/meson.build
@@ -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
index 0000000000..20eb0176fc
--- /dev/null
+++ b/src/storage_file/meson.build
@@ -0,0 +1,38 @@
+stoarge_file_fs_sources = [
+  'storage_file_fs.c',
+]
+
+storage_file_gluster_sources = [
+  'storage_file_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
diff --git a/src/storage/storage_file_fs.c b/src/storage_file/storage_file_fs.c
similarity index 100%
rename from src/storage/storage_file_fs.c
rename to src/storage_file/storage_file_fs.c
diff --git a/src/storage/storage_file_fs.h b/src/storage_file/storage_file_fs.h
similarity index 100%
rename from src/storage/storage_file_fs.h
rename to src/storage_file/storage_file_fs.h
diff --git a/src/storage/storage_file_gluster.c b/src/storage_file/storage_file_gluster.c
similarity index 100%
rename from src/storage/storage_file_gluster.c
rename to src/storage_file/storage_file_gluster.c
diff --git a/src/storage/storage_file_gluster.h b/src/storage_file/storage_file_gluster.h
similarity index 100%
rename from src/storage/storage_file_gluster.h
rename to src/storage_file/storage_file_gluster.h
-- 
2.29.2




More information about the libvir-list mailing list