]> git.ipfire.org Git - thirdparty/qemu.git/commit
blockdev-backup: Add error handling option for copy-before-write jobs
authorRaman Dzehtsiar <raman.dzehtsiar@gmail.com>
Mon, 14 Apr 2025 09:00:25 +0000 (11:00 +0200)
committerVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Mon, 12 May 2025 15:19:31 +0000 (18:19 +0300)
commit3d3911f16b6ceb9ed202aadf2cd75ded516a1a0b
treefb2853125031b98b8150ba621ccf87bd6e64db10
parentb836bf2ab68fbc1e253c10bee95fa36399762967
blockdev-backup: Add error handling option for copy-before-write jobs

This patch extends the blockdev-backup QMP command to allow users to specify
how to behave when IO errors occur during copy-before-write operations.
Previously, the behavior was fixed and could not be controlled by the user.

The new 'on-cbw-error' option can be set to one of two values:
- 'break-guest-write': Forwards the IO error to the guest and triggers
  the on-source-error policy. This preserves snapshot integrity at the
  expense of guest IO operations.
- 'break-snapshot': Allows the guest OS to continue running normally,
  but invalidates the snapshot and aborts related jobs. This prioritizes
  guest operation over backup consistency.

This enhancement provides more flexibility for backup operations in different
environments where requirements for guest availability versus backup
consistency may vary.

The default behavior remains unchanged to maintain backward compatibility.

Signed-off-by: Raman Dzehtsiar <Raman.Dzehtsiar@gmail.com>
Message-ID: <20250414090025.828660-1-Raman.Dzehtsiar@gmail.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
[vsementsov: fix long lines]
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
block/backup.c
block/copy-before-write.c
block/copy-before-write.h
block/replication.c
blockdev.c
include/block/block_int-global-state.h
qapi/block-core.json
tests/qemu-iotests/tests/copy-before-write
tests/qemu-iotests/tests/copy-before-write.out