[libvirt] [PATCH rfc v2 0/8] fspool: backend directory

Olga Krishtal okrishtal at virtuozzo.com
Thu Sep 15 07:32:19 UTC 2016


Hi everyone, we would like to propose the first implementation of fspool
with directory backend.

Filesystem pools is a facility to manage filesystems resources similar
to how storage pools manages volume resources. Furthermore new API follows
storage API closely where it makes sense. 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.

The patchset provides 'dir' backend which simply expose directories in some
directory in host filesystem. The virsh commands are provided too. So it is
ready to play with, just replace 'pool' in xml descriptions and virsh commands
to 'fspool' and 'volume' to 'item'.
Examle and usage:
Define:
virsh -c qemu:///system fspool-define-as fs_pool_name dir --target /path/on/host
Build
virsh -c qemu:///system fspool-build fs_pool_name
Start
virsh -c qemu:///system fspool-start fs_pool_name
Look inside
virsh -c qemu:///system fspool-list (--all) fspool_name

Fspool called POOL, on the host fs uses /fs_driver to hold items.
  virsh -c qemu:///system fspool-dumpxml POOL
  <fspool type='dir'>
    <name>POOL</name>
    <uuid>c57c9d7c-b1d5-4c45-ba9c-67f03d4da160</uuid>
    <capacity unit='bytes'>733722615808</capacity>
    <allocation unit='bytes'>1331486720</allocation>
    <available unit='bytes'>534810800128</available>
    <source>
    </source>
    <target>
      <path>/fs_driver</path>
      <permissions>
        <mode>0755</mode>
        <owner>0</owner>
        <group>0</group>
      </permissions>
    </target>
  </fspool>

virsh -c qemu:///system fspool-info POOL
Name:           POOL
UUID:           c57c9d7c-b1d5-4c45-ba9c-67f03d4da160
State:          running
Persistent:     yes
Autostart:      no autostart
Capacity:       683.33 GiB
Allocation:     1.24 GiB
Available:      498.08 GiB

virsh -c qemu+unix:///system item-list POOL
  Name                 Path
------------------------------------------------------------------------------
item1                /fs_driver/item1
item10               /fs_driver/item10
item11               /fs_driver/item11
item12               /fs_driver/item12
item15               /fs_driver/item15

Fspool of directory type is some directory on host fs that holds items (subdirs).
Example of usage for items:
virsh -c vz+unix:///system item-create-as POOL item1 1g - create item
virsh -c qemu+unix:///system item-dumpxml item1 POOL
<fsitem>
    <name>item1</name>
    <key>/fs_driver/item1</key>
    <source>
    </source>
    <capacity unit='bytes'>0</capacity>
    <allocation unit='bytes'>0</allocation>
    <target>
      <format type='dir'/>
    </target>
  </fsitem>

virsh -c qemu+unix:///system item-info item1 POOL
Name:           item1
Type:           dir
Capacity:       683.33 GiB
Allocation:     634.87 MiB
Autostart:      no autostart
Capacity:       683.33 GiB
Allocation:     1.24 GiB
Available:      498.08 GiB
virsh -c qemu+unix:///system item-list POOL
  Name                 Path
------------------------------------------------------------------------------
  item1                /fs_driver/item1
  item10               /fs_driver/item10
  item11               /fs_driver/item11
  item12               /fs_driver/item12
  item15               /fs_driver/item15

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

Olga Krishtal (8):
  fspool: introduce filesystem pools API
  fspool: usual driver based implementation of filesystem pools API
  fspools: configuration and internal representation
  fspools: acl support for filesystem pools
  remote: filesystem pools driver implementation
  fspool: default implementation of filesystem pools
  virsh: filesystem pools commands
  fspools: docs and tests for fspool directory backend

 configure.ac                                       |   38 +
 daemon/Makefile.am                                 |    4 +
 daemon/libvirtd.c                                  |   10 +
 daemon/remote.c                                    |   35 +
 docs/formatfs.html.in                              |  208 ++
 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                       |  260 +++
 include/libvirt/libvirt.h                          |    1 +
 include/libvirt/virterror.h                        |    8 +
 m4/virt-driver-fspool.m4                           |   52 +
 po/POTFILES.in                                     |    6 +
 src/Makefile.am                                    |   46 +
 src/access/viraccessdriver.h                       |   12 +
 src/access/viraccessdrivernop.c                    |   19 +
 src/access/viraccessdriverpolkit.c                 |   47 +
 src/access/viraccessdriverstack.c                  |   49 +
 src/access/viraccessmanager.c                      |   31 +
 src/access/viraccessmanager.h                      |   11 +
 src/access/viraccessperm.c                         |   15 +-
 src/access/viraccessperm.h                         |  124 ++
 src/check-driverimpls.pl                           |    2 +
 src/conf/fs_conf.c                                 | 1637 ++++++++++++++++
 src/conf/fs_conf.h                                 |  323 +++
 src/datatypes.c                                    |  154 ++
 src/datatypes.h                                    |   94 +
 src/driver-fs.h                                    |  192 ++
 src/driver.h                                       |    3 +
 src/fs/fs_backend.h                                |  107 +
 src/fs/fs_backend_dir.c                            |  355 ++++
 src/fs/fs_backend_dir.h                            |    8 +
 src/fs/fs_driver.c                                 | 2058 ++++++++++++++++++++
 src/fs/fs_driver.h                                 |   10 +
 src/libvirt-fs.c                                   | 1556 +++++++++++++++
 src/libvirt.c                                      |   28 +
 src/libvirt_private.syms                           |   53 +
 src/libvirt_public.syms                            |   42 +
 src/remote/remote_driver.c                         |   66 +
 src/remote/remote_protocol.x                       |  466 ++++-
 src/remote_protocol-structs                        |  165 ++
 src/rpc/gendispatch.pl                             |   23 +-
 src/util/virerror.c                                |   37 +
 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                               | 1292 ++++++++++++
 tools/virsh-fsitem.h                               |   39 +
 tools/virsh-fspool.c                               | 1586 +++++++++++++++
 tools/virsh-fspool.h                               |   38 +
 tools/virsh.c                                      |    4 +
 tools/virsh.h                                      |    9 +
 tools/virsh.pod                                    |  252 ++-
 60 files changed, 12028 insertions(+), 10 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 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




More information about the libvir-list mailing list