4 * Copyright (C) 2013 Proxmox Server Solutions
5 * Copyright (c) 2019 Virtuozzo International GmbH.
8 * Dietmar Maurer (dietmar@proxmox.com)
9 * Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
18 #include "block/block.h"
19 #include "qemu/co-shared-resource.h"
21 typedef void (*ProgressBytesCallbackFunc
)(int64_t bytes
, void *opaque
);
22 typedef struct BlockCopyState BlockCopyState
;
24 BlockCopyState
*block_copy_state_new(BdrvChild
*source
, BdrvChild
*target
,
26 BdrvRequestFlags write_flags
,
29 void block_copy_set_progress_callback(
31 ProgressBytesCallbackFunc progress_bytes_callback
,
32 void *progress_opaque
);
34 void block_copy_set_progress_meter(BlockCopyState
*s
, ProgressMeter
*pm
);
36 void block_copy_state_free(BlockCopyState
*s
);
38 int64_t block_copy_reset_unallocated(BlockCopyState
*s
,
39 int64_t offset
, int64_t *count
);
41 int coroutine_fn
block_copy(BlockCopyState
*s
, int64_t offset
, int64_t bytes
,
44 BdrvDirtyBitmap
*block_copy_dirty_bitmap(BlockCopyState
*s
);
45 void block_copy_set_skip_unallocated(BlockCopyState
*s
, bool skip
);
47 #endif /* BLOCK_COPY_H */