aboutsummaryrefslogtreecommitdiff
path: root/include/block/block-copy.h
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-10-22 14:18:04 +0300
committerMax Reitz <mreitz@redhat.com>2019-10-28 11:22:31 +0100
commit7f739d0e5375a934f0eade3cd38e6d33673beec0 (patch)
treee581fcaff3ce8515785317109f11f7a69d83795b /include/block/block-copy.h
parentf16ba00de946517e5cca4edeeec3e21f8f77132d (diff)
block/block-copy: add memory limit
Currently total allocation for parallel requests to block-copy instance is unlimited. Let's limit it to 128 MiB. For now block-copy is used only in backup, so actually we limit total allocation for backup job. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20191022111805.3432-6-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block/block-copy.h')
-rw-r--r--include/block/block-copy.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/block/block-copy.h b/include/block/block-copy.h
index e2e135ff1b..edcdf0072d 100644
--- a/include/block/block-copy.h
+++ b/include/block/block-copy.h
@@ -16,6 +16,7 @@
#define BLOCK_COPY_H
#include "block/block.h"
+#include "qemu/co-shared-resource.h"
typedef struct BlockCopyInFlightReq {
int64_t start_byte;
@@ -69,6 +70,8 @@ typedef struct BlockCopyState {
*/
ProgressResetCallbackFunc progress_reset_callback;
void *progress_opaque;
+
+ SharedResource *mem;
} BlockCopyState;
BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target,