block/nbd-client: drop max_block restriction from block_status
[qemu/ar7.git] / include / block / block-copy.h
blobaac85e14880a430a0d37c6ac0ed570bdaaf9a327
1 /*
2 * block_copy API
4 * Copyright (C) 2013 Proxmox Server Solutions
5 * Copyright (c) 2019 Virtuozzo International GmbH.
7 * Authors:
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.
15 #ifndef BLOCK_COPY_H
16 #define BLOCK_COPY_H
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,
25 int64_t cluster_size,
26 BdrvRequestFlags write_flags,
27 Error **errp);
29 void block_copy_set_progress_callback(
30 BlockCopyState *s,
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,
42 bool *error_is_read);
44 BdrvDirtyBitmap *block_copy_dirty_bitmap(BlockCopyState *s);
45 void block_copy_set_skip_unallocated(BlockCopyState *s, bool skip);
47 #endif /* BLOCK_COPY_H */