mbox series

[00/10] Introduce BTRFS Snapshot Handler

Message ID 20241030101550.21014-1-stefano.babic@swupdate.org
Headers show
Series Introduce BTRFS Snapshot Handler | expand

Message

Stefano Babic Oct. 30, 2024, 10:15 a.m. UTC
This adds a handler that allows to stream a BTRFS snapshot and
to install it into a BTRS subvolume. The handler, due to missing
API for receive in libbtrfsutil library, requires that the btrfs
utility is installed on the target. SWUpdate executes the command
internally by creating pipes to drive and get answer from the btrfs
utility. The full-blown output from the utility is intercepted by
SWUpdate and added to the internal log.

As side effect, the infrastructure to support btrfs can be used for
any external command that accepts a stream from stdin. The "executor"
handler is part of this series.

Stefano Babic (10):
  util: introduce generic mount helpers
  Make use of introduced swupdate_temporary_(u)mount
  Cleanup: use bool instead of int for mount option
  Cleanup: drop sdup fuction
  Add helper to concatenate string
  Rename chained_handler.h in handler_helpers.h
  Factorize callback to transfer data via FIFO
  BUG: fix data transfer in callback used by docker
  Pass a stdin to run_cmd
  btrfs: introduce support for snapshot with btrfs receive

 core/pctl.c                |  23 ++++-
 core/swupdate.c            |   4 +-
 core/util.c                |  89 ++++++++++++++++--
 doc/source/handlers.rst    |  54 ++++++++++-
 handlers/Makefile          |   2 +-
 handlers/archive_handler.c |  13 +--
 handlers/btrfs_handler.c   | 115 +++++++++++++++++------
 handlers/chain_handler.c   |  49 ----------
 handlers/copy_handler.c    |   2 +-
 handlers/delta_handler.c   |  11 +--
 handlers/docker_handler.c  |  38 +-------
 handlers/handler_helpers.c | 181 +++++++++++++++++++++++++++++++++++++
 handlers/raw_handler.c     |  11 +--
 handlers/rdiff_handler.c   |   7 +-
 include/chained_handler.h  |  15 ---
 include/globals.h          |   6 ++
 include/handler_helpers.h  |  32 +++++++
 include/pctl.h             |   1 +
 include/util.h             |   4 +-
 19 files changed, 487 insertions(+), 170 deletions(-)
 delete mode 100644 handlers/chain_handler.c
 create mode 100644 handlers/handler_helpers.c
 delete mode 100644 include/chained_handler.h
 create mode 100644 include/handler_helpers.h

--
2.34.1