Hi everyone, we would like to propose the first implementation of fspool
with directory backend according to previous discussions:
https://www.redhat.com/archives/libvir-list/2016-April/msg01941.html
https://www.redhat.com/archives/libvir-list/2016-May/msg00208.html
https://www.redhat.com/archives/libvir-list/2016-September/msg00463.html
Filesystem pools is a facility to manage filesystems resources similar
to how storage pools manages volume resources.The manageble unit is a single
filesystem, so fspool items have only one type - dir (storage pools can manage files,
block devices, etc). However, backends for fspools can be different.
This series introduses the simplest backend - host directory.
API mostly follows storage pool API: we can create fspool, build it,
populate with items. Moreover, to create filesystem pool we need
some storage. So, all structures to describe storage that will hold
fspool is borrowed from storage pool ones. The same is true for functions
that work with them.
As it was mentioned before - here we present directory backend for fspool.
To mangae fspools and items we tried to use as much functionality from storage pool
(directory and fs backend) as possible.
The first 3 patches - is preparational refactoring. Both storage pool and fspool
reside upon some storage, so there is a good chance to use the same code for
describing storage source and functions that work with it. All reusable code is moved
virpoolcommon.c/.h It would be great if you share you thoughts about such changes.
Because what we trying to achive - is to have less copy/paste and to have
separate drivers for storage pools and filesystem pools.
All other patches is devoted to fspool implementation and is presented according
libvirt recommendations.
Uploading/downloading operations
are not defined yet as it is not obvious how to make it properly. I guess
we can use some kind of tar to make a stream from a filesystem. Please share
you thoughts on this particular issue.
v2:
- renamed Fs to FS
- in configure.ac script macro m4 is used
- updates docs
- created simple tests
- updated virsh.pod
- added information abot fspool in fotmatfs.html
v3:
- in this version storage pool code is reused
- resplitted patches
- fixed some errors
Olga Krishtal (15):
storage pools: refactoring of basic structs
storage pools: functions refactoring
storage pools: refactoring of fs backend
FSPool: defining the public API
FSPool: defining the internal API
FSpool: implementing the public API
FSPool: added access control objects and permissions
FSPool: added --with-fs compilation option
FSPool: implementation of remote protocol
FSPool: added configuration description
virsh: filesystem pools commands
FSPool: empty implementation of driver methods
FSPool: driver methods implementation
FSPool: directory backend inplementation
FSPool: Tests and documentation
configure.ac | 6 +
daemon/Makefile.am | 4 +
daemon/libvirtd.c | 9 +
daemon/remote.c | 35 +
docs/formatfs.html.in | 206 ++
docs/fspool.html.in | 41 +
docs/schemas/fsitem.rng | 66 +
docs/schemas/fspool.rng | 82 +
docs/sitemap.html.in | 4 +
include/libvirt/libvirt-fs.h | 254 +++
include/libvirt/libvirt-storage.h | 5 +-
include/libvirt/libvirt.h | 1 +
include/libvirt/virterror.h | 7 +
m4/virt-driver-fspool.m4 | 43 +
po/POTFILES.in | 7 +
src/Makefile.am | 59 +-
src/access/viraccessdriver.h | 15 +
src/access/viraccessdrivernop.c | 21 +
src/access/viraccessdriverpolkit.c | 47 +
src/access/viraccessdriverstack.c | 50 +
src/access/viraccessmanager.c | 32 +
src/access/viraccessmanager.h | 11 +-
src/access/viraccessperm.c | 15 +-
src/access/viraccessperm.h | 126 ++
src/check-driverimpls.pl | 2 +
src/conf/fs_conf.c | 1479 ++++++++++++++
src/conf/fs_conf.h | 262 +++
src/conf/storage_conf.c | 162 --
src/conf/storage_conf.h | 137 +-
src/datatypes.c | 150 ++
src/datatypes.h | 60 +-
src/driver-fs.h | 193 ++
src/driver.h | 3 +
src/fs/fs_backend.h | 94 +
src/fs/fs_backend_dir.c | 290 +++
src/fs/fs_backend_dir.h | 8 +
src/fs/fs_driver.c | 2044 ++++++++++++++++++++
src/fs/fs_driver.h | 10 +
src/libvirt-fs.c | 1555 +++++++++++++++
src/libvirt.c | 30 +-
src/libvirt_private.syms | 58 +-
src/libvirt_public.syms | 46 +
src/remote/remote_driver.c | 66 +
src/remote/remote_protocol.x | 466 ++++-
src/remote_protocol-structs | 165 ++
src/rpc/gendispatch.pl | 23 +-
src/storage/storage_backend.h | 1 -
src/storage/storage_backend_fs.c | 74 +-
src/util/virerror.c | 37 +
src/util/virpoolcommon.c | 212 ++
src/util/virpoolcommon.h | 189 ++
src/util/virstoragefile.c | 73 +
src/util/virstoragefile.h | 3 +
tests/Makefile.am | 12 +
tests/fsitemxml2xmlin/item.xml | 13 +
tests/fsitemxml2xmlout/item.xml | 13 +
tests/fsitemxml2xmltest.c | 105 +
.../dir-missing-target-path-invalid.xml | 12 +
tests/fspoolxml2xmlin/fspool-dir.xml | 16 +
tests/fspoolxml2xmlout/fspool-dir.xml | 16 +
tests/fspoolxml2xmltest.c | 81 +
tools/Makefile.am | 2 +
tools/virsh-fsitem.c | 1293 +++++++++++++
tools/virsh-fsitem.h | 39 +
tools/virsh-fspool.c | 1574 +++++++++++++++
tools/virsh-fspool.h | 38 +
tools/virsh.c | 4 +
tools/virsh.h | 9 +
tools/virsh.pod | 252 ++-
69 files changed, 12128 insertions(+), 389 deletions(-)
create mode 100644 docs/formatfs.html.in
create mode 100644 docs/fspool.html.in
create mode 100644 docs/schemas/fsitem.rng
create mode 100644 docs/schemas/fspool.rng
create mode 100644 include/libvirt/libvirt-fs.h
create mode 100644 m4/virt-driver-fspool.m4
create mode 100644 src/conf/fs_conf.c
create mode 100644 src/conf/fs_conf.h
create mode 100644 src/driver-fs.h
create mode 100644 src/fs/fs_backend.h
create mode 100644 src/fs/fs_backend_dir.c
create mode 100644 src/fs/fs_backend_dir.h
create mode 100644 src/fs/fs_driver.c
create mode 100644 src/fs/fs_driver.h
create mode 100644 src/libvirt-fs.c
create mode 100644 src/util/virpoolcommon.c
create mode 100644 src/util/virpoolcommon.h
create mode 100644 tests/fsitemxml2xmlin/item.xml
create mode 100644 tests/fsitemxml2xmlout/item.xml
create mode 100644 tests/fsitemxml2xmltest.c
create mode 100644 tests/fspoolschemadata/dir-missing-target-path-invalid.xml
create mode 100644 tests/fspoolxml2xmlin/fspool-dir.xml
create mode 100644 tests/fspoolxml2xmlout/fspool-dir.xml
create mode 100644 tests/fspoolxml2xmltest.c
create mode 100644 tools/virsh-fsitem.c
create mode 100644 tools/virsh-fsitem.h
create mode 100644 tools/virsh-fspool.c
create mode 100644 tools/virsh-fspool.h
--
1.8.3.1