storage: move storage file sources to separate directory

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>
This commit is contained in:
Pavel Hrdina 2020-12-02 13:10:59 +01:00
parent 3e210d204c
commit 90caf9d763
8 changed files with 49 additions and 36 deletions

View File

@ -222,9 +222,9 @@
@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

View File

@ -266,6 +266,7 @@ subdir('nwfilter')
subdir('secret')
subdir('security')
subdir('storage')
subdir('storage_file')
subdir('bhyve')
subdir('esx')

View 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('.')

View File

@ -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

View 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"

View 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.
*

View 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"

View 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.
*