[PATCH v3 0/8] linux-user: Adding support for a group of btrfs ioctls

Filip Bozuta posted 8 patches 3 years, 8 months ago
Test docker-quick@centos7 failed
Test docker-mingw@fedora failed
Test checkpatch failed
Test FreeBSD failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200823195014.116226-1-Filip.Bozuta@syrmia.com
Maintainers: Laurent Vivier <laurent@vivier.eu>
configure                  |   9 ++
linux-user/ioctls.h        | 124 ++++++++++++++++++++++++++++
linux-user/syscall.c       |   3 +
linux-user/syscall_defs.h  |  37 +++++++++
linux-user/syscall_types.h | 163 +++++++++++++++++++++++++++++++++++++
5 files changed, 336 insertions(+)
[PATCH v3 0/8] linux-user: Adding support for a group of btrfs ioctls
Posted by Filip Bozuta 3 years, 8 months ago
This series covers support for following btrfs ioctls

    *BTRFS_SUBVOL_CREATE           *BTRFS_IOC_ADD_DEV
    *BTRFS_SUBVOL_SETFLAGS         *BTRFS_IOC_RM_DEV
    *BTRFS_SUBVOL_GETFLAGS         *BTRFS_IOC_DEV_INFO
    *BTRFS_GET_SUBVOL_INFO         *BTRFS_IOC_GET_DEV_STATS
    *BTRFS_IOC_SNAP_CREATE         *BTRFS_IOC_GET_FEATURES
    *BTRFS_IOC_SNAP_DESTROY        *BTRFS_IOC_SET_FEATURES
    *BTRFS_IOC_SCAN_DEV            *BTRFS_IOC_GET_SUPPORTED_FEATURES
    *BTRFS_IOC_DEFAULT_SUBVOL      *BTRFS_IOC_QUOTA_RESCAN
    *BTRFS_IOC_GET_SUBVOL_ROOTREF  *BTRFS_IOC_QUOTA_RESCAN_WAIT
    *BTRFS_IOC_QUOTA_CTL           *BTRFS_IOC_SCRUB
    *BTRFS_IOC_QGROUP_CREATE       *BTRFS_IOC_SCRUB_CANCEL
    *BTRFS_IOC_QGROUP_ASSIGN       *BTRFS_IOC_SCRUB_PROGRESS
    *BTRFS_IOC_INO_PATHS           *BTRFS_IOC_QGROUP_LIMIT
    *BTRFS_IOC_LOGICAL_INO         *BTRFS_IOC_QUOTA_RESCAN_STATUS
    *BTRFS_IOC_LOGICAL_INO_V2
    *BTRFS_IOC_INO_LOOKUP_USER
    *BTRFS_IOC_INO_LOOKUP

The functionalities of individual ioctls were described in this series
patch commit messages. Since all of these ioctls are added in kernel
version 3.9, their definitions in file 'linux-user/ioctls.h' are
enwrapped in an #ifdef directive.

Testing method:

    Mini test programs were written for these ioctls. These test programs
    can be found on a repositort which is located on the link:
    https://github.com/bozutaf/btrfs-tests

    These test programs were compiled (sometimes using cross compilers) for
    following architectures:

         * Intel 64-bit (little endian)
         * Power pc 32-bit (big endian)
         * Power pc 64-bit (big endian)

    The corresponding native programs were executed without using QEMU on
    an intel x86_64 host.

    All applicable compiled programs were in turn executed through QEMU
    and the results obtained were the same ones gotten for native
    execution.

v2:

    * Merged two series in one 8 patch series
    * Changed target ioctl definitions from IOR/IOW/IOWR to IORU/IOWU/IOWRU
    * Fixed some thunk struct definitions

v3:

   * Added some checks in fine 'syscall_types.h' to see whether the ioctls that
     use the defined thunk types are present. This is done to support systems
     that have older versions of 'btrfs.h' file or if the file is not present
     at all. This is neccesary as to not cause build errors as some structures
     depend on values which are defined in 'btrfs.h'.

Filip Bozuta (8):
  linux-user: Add support for a group of btrfs ioctls used for
    subvolumes
  linux-user: Add support for a group of btrfs ioctls used for snapshots
  linux-user: Add support for btrfs ioctls used to manipulate with
    devices
  linux-user: Add support for btrfs ioctls used to get/set features
  linux-user: Add support for a group of btrfs inode ioctls
  linux-user: Add support for two btrfs ioctls used for subvolume
  linux-user: Add support for btrfs ioctls used to manage quota
  linux-user: Add support for btrfs ioctls used to scrub a filesystem

 configure                  |   9 ++
 linux-user/ioctls.h        | 124 ++++++++++++++++++++++++++++
 linux-user/syscall.c       |   3 +
 linux-user/syscall_defs.h  |  37 +++++++++
 linux-user/syscall_types.h | 163 +++++++++++++++++++++++++++++++++++++
 5 files changed, 336 insertions(+)

-- 
2.25.1


Re: [PATCH v3 0/8] linux-user: Adding support for a group of btrfs ioctls
Posted by Daniel P. Berrangé 3 years, 8 months ago
On Sun, Aug 23, 2020 at 09:50:06PM +0200, Filip Bozuta wrote:
> This series covers support for following btrfs ioctls
> 
>     *BTRFS_SUBVOL_CREATE           *BTRFS_IOC_ADD_DEV
>     *BTRFS_SUBVOL_SETFLAGS         *BTRFS_IOC_RM_DEV
>     *BTRFS_SUBVOL_GETFLAGS         *BTRFS_IOC_DEV_INFO
>     *BTRFS_GET_SUBVOL_INFO         *BTRFS_IOC_GET_DEV_STATS
>     *BTRFS_IOC_SNAP_CREATE         *BTRFS_IOC_GET_FEATURES
>     *BTRFS_IOC_SNAP_DESTROY        *BTRFS_IOC_SET_FEATURES
>     *BTRFS_IOC_SCAN_DEV            *BTRFS_IOC_GET_SUPPORTED_FEATURES
>     *BTRFS_IOC_DEFAULT_SUBVOL      *BTRFS_IOC_QUOTA_RESCAN
>     *BTRFS_IOC_GET_SUBVOL_ROOTREF  *BTRFS_IOC_QUOTA_RESCAN_WAIT
>     *BTRFS_IOC_QUOTA_CTL           *BTRFS_IOC_SCRUB
>     *BTRFS_IOC_QGROUP_CREATE       *BTRFS_IOC_SCRUB_CANCEL
>     *BTRFS_IOC_QGROUP_ASSIGN       *BTRFS_IOC_SCRUB_PROGRESS
>     *BTRFS_IOC_INO_PATHS           *BTRFS_IOC_QGROUP_LIMIT
>     *BTRFS_IOC_LOGICAL_INO         *BTRFS_IOC_QUOTA_RESCAN_STATUS
>     *BTRFS_IOC_LOGICAL_INO_V2
>     *BTRFS_IOC_INO_LOOKUP_USER
>     *BTRFS_IOC_INO_LOOKUP
> 
> The functionalities of individual ioctls were described in this series
> patch commit messages. Since all of these ioctls are added in kernel
> version 3.9, their definitions in file 'linux-user/ioctls.h' are
> enwrapped in an #ifdef directive.
> 
> Testing method:
> 
>     Mini test programs were written for these ioctls. These test programs
>     can be found on a repositort which is located on the link:
>     https://github.com/bozutaf/btrfs-tests
> 
>     These test programs were compiled (sometimes using cross compilers) for
>     following architectures:
> 
>          * Intel 64-bit (little endian)
>          * Power pc 32-bit (big endian)
>          * Power pc 64-bit (big endian)
> 
>     The corresponding native programs were executed without using QEMU on
>     an intel x86_64 host.
> 
>     All applicable compiled programs were in turn executed through QEMU
>     and the results obtained were the same ones gotten for native
>     execution.
> 
> v2:
> 
>     * Merged two series in one 8 patch series
>     * Changed target ioctl definitions from IOR/IOW/IOWR to IORU/IOWU/IOWRU
>     * Fixed some thunk struct definitions
> 
> v3:
> 
>    * Added some checks in fine 'syscall_types.h' to see whether the ioctls that
>      use the defined thunk types are present. This is done to support systems
>      that have older versions of 'btrfs.h' file or if the file is not present
>      at all. This is neccesary as to not cause build errors as some structures
>      depend on values which are defined in 'btrfs.h'.
> 
> Filip Bozuta (8):
>   linux-user: Add support for a group of btrfs ioctls used for
>     subvolumes
>   linux-user: Add support for a group of btrfs ioctls used for snapshots
>   linux-user: Add support for btrfs ioctls used to manipulate with
>     devices
>   linux-user: Add support for btrfs ioctls used to get/set features
>   linux-user: Add support for a group of btrfs inode ioctls
>   linux-user: Add support for two btrfs ioctls used for subvolume
>   linux-user: Add support for btrfs ioctls used to manage quota
>   linux-user: Add support for btrfs ioctls used to scrub a filesystem
> 
>  configure                  |   9 ++
>  linux-user/ioctls.h        | 124 ++++++++++++++++++++++++++++
>  linux-user/syscall.c       |   3 +
>  linux-user/syscall_defs.h  |  37 +++++++++
>  linux-user/syscall_types.h | 163 +++++++++++++++++++++++++++++++++++++
>  5 files changed, 336 insertions(+)

Tested-by: Daniel P. Berrangé <berrange@redhat.com>

This series solves a problem that Fedora has with creating btrfs volumes
inside a mock chroot using qemu-user.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|