[libvirt] [PATCH 0/7] More detailed description

Olga Krishtal okrishtal at virtuozzo.com
Thu Aug 18 12:05:41 UTC 2016


This is the first implementation of fspool with directory backend(dir).
Fspool is some host directory that holds another directories (items).
In an item fs of container can be placed.
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>
      fspoo ='POOL'
    </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


On 11/07/16 11:28, Nikolay Shirokovskiy wrote:
> filesystem pools inception
>
>    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'.
>
> Olga Krishtal (7):
>    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
>
>   configure.ac                       |   33 +
>   daemon/Makefile.am                 |    4 +
>   daemon/libvirtd.c                  |   10 +
>   daemon/remote.c                    |   35 +
>   include/libvirt/libvirt-fs.h       |  273 +++++
>   include/libvirt/libvirt.h          |    1 +
>   include/libvirt/virterror.h        |    8 +
>   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/conf/fs_conf.c                 | 1624 +++++++++++++++++++++++++++
>   src/conf/fs_conf.h                 |  310 ++++++
>   src/datatypes.c                    |  154 +++
>   src/datatypes.h                    |   94 ++
>   src/driver-fs.h                    |  210 ++++
>   src/driver.h                       |    3 +
>   src/fs/fs_backend.h                |   85 ++
>   src/fs/fs_backend_dir.c            |  334 ++++++
>   src/fs/fs_backend_dir.h            |    8 +
>   src/fs/fs_driver.c                 | 2164 ++++++++++++++++++++++++++++++++++++
>   src/fs/fs_driver.h                 |   10 +
>   src/libvirt-fs.c                   | 1715 ++++++++++++++++++++++++++++
>   src/libvirt.c                      |   28 +
>   src/libvirt_private.syms           |   53 +
>   src/libvirt_public.syms            |   46 +
>   src/remote/remote_driver.c         |   72 +-
>   src/remote/remote_protocol.x       |  522 ++++++++-
>   src/rpc/gendispatch.pl             |   19 +-
>   src/util/virerror.c                |   37 +
>   tools/Makefile.am                  |    4 +
>   tools/virsh-fspool.c               | 1728 ++++++++++++++++++++++++++++
>   tools/virsh-fspool.h               |   36 +
>   tools/virsh-item.c                 | 1274 +++++++++++++++++++++
>   tools/virsh-item.h                 |   37 +
>   tools/virsh.c                      |    4 +
>   tools/virsh.h                      |    9 +
>   43 files changed, 11294 insertions(+), 10 deletions(-)
>   create mode 100644 include/libvirt/libvirt-fs.h
>   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 tools/virsh-fspool.c
>   create mode 100644 tools/virsh-fspool.h
>   create mode 100644 tools/virsh-item.c
>   create mode 100644 tools/virsh-item.h
>




More information about the libvir-list mailing list