On 01.04.22 15:24, Hanna Reitz wrote:
On 01.04.22 11:19, Vladimir Sementsov-Ogievskiy wrote:
In some scenarios, when copy-before-write operations lasts too long
time, it's better to cancel it.
Most useful would be to use the new option together with
on-cbw-error=break-snapshot: this way if cbw operation takes too long
time we'll just cancel backup process but do not disturb the guest too
much.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@openvz.org>
---
block/copy-before-write.c | 6 +++++-
qapi/block-core.json | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)
[...]
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 3f08025114..e077506e0f 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -4207,12 +4207,15 @@
# @on-cbw-error: Behavior on failure of copy-before-write operation.
# Default is @break-guest-write. (Since 7.0)
#
+# @cbw-timeout: Zero means no limit. Non-zero sets the timeout in seconds
+# for copy-before-write operation. Default 0. (Since 7.0)
*7.1, but:
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
On second thought, perhaps we should make an explicit note that a timeout means
an error? E.g. “When a timeout occurs, the respective copy-before-write
operation will fail, and the @on-cbw-error parameter will decide how this
failure is handled.”