diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org> | 2022-04-07 16:27:21 +0300 |
---|---|---|
committer | Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> | 2022-06-28 10:20:31 +0300 |
commit | f1bb39a8a5b6d486faa1a51a7f28c577155642c9 (patch) | |
tree | de0305a84f22213bbff56777df2038c5270dece3 /qapi | |
parent | 79ef0cebb5694411e7452f0cf15c4bd170c7f2d6 (diff) | |
download | qemu-f1bb39a8a5b6d486faa1a51a7f28c577155642c9.zip qemu-f1bb39a8a5b6d486faa1a51a7f28c577155642c9.tar.gz qemu-f1bb39a8a5b6d486faa1a51a7f28c577155642c9.tar.bz2 |
block/copy-before-write: add on-cbw-error open parameter
Currently, behavior on copy-before-write operation failure is simple:
report error to the guest.
Let's implement alternative behavior: break the whole copy-before-write
process (and corresponding backup job or NBD client) but keep guest
working. It's needed if we consider guest stability as more important.
The realisation is simple: on copy-before-write failure we set
s->snapshot_ret and continue guest operations. s->snapshot_ret being
set will lead to all further snapshot API requests. Note that all
in-flight snapshot-API requests may still success: we do wait for them
on BREAK_SNAPSHOT-failure path in cbw_do_copy_before_write().
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/block-core.json | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json index 457df16..3e8456a 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -4185,6 +4185,25 @@ 'data': { '*bottom': 'str' } } ## +# @OnCbwError: +# +# An enumeration of possible behaviors for copy-before-write operation +# failures. +# +# @break-guest-write: report the error to the guest. This way, the guest +# will not be able to overwrite areas that cannot be +# backed up, so the backup process remains valid. +# +# @break-snapshot: continue guest write. Doing so will make the provided +# snapshot state invalid and any backup or export +# process based on it will finally fail. +# +# Since: 7.1 +## +{ 'enum': 'OnCbwError', + 'data': [ 'break-guest-write', 'break-snapshot' ] } + +## # @BlockdevOptionsCbw: # # Driver specific block device options for the copy-before-write driver, @@ -4205,11 +4224,15 @@ # modifications (or removing) of specified bitmap doesn't # influence the filter. (Since 7.0) # +# @on-cbw-error: Behavior on failure of copy-before-write operation. +# Default is @break-guest-write. (Since 7.1) +# # Since: 6.2 ## { 'struct': 'BlockdevOptionsCbw', 'base': 'BlockdevOptionsGenericFormat', - 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap' } } + 'data': { 'target': 'BlockdevRef', '*bitmap': 'BlockDirtyBitmap', + '*on-cbw-error': 'OnCbwError' } } ## # @BlockdevOptions: |