mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
qapi: add x-block-dirty-bitmap-merge
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 20180606182449.1607-5-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
c649044740
commit
b598e531f1
4 changed files with 88 additions and 1 deletions
30
blockdev.c
30
blockdev.c
|
@ -3043,6 +3043,36 @@ void qmp_x_block_dirty_bitmap_disable(const char *node, const char *name,
|
|||
bdrv_disable_dirty_bitmap(bitmap);
|
||||
}
|
||||
|
||||
void qmp_x_block_dirty_bitmap_merge(const char *node, const char *dst_name,
|
||||
const char *src_name, Error **errp)
|
||||
{
|
||||
BlockDriverState *bs;
|
||||
BdrvDirtyBitmap *dst, *src;
|
||||
|
||||
dst = block_dirty_bitmap_lookup(node, dst_name, &bs, errp);
|
||||
if (!dst) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (bdrv_dirty_bitmap_frozen(dst)) {
|
||||
error_setg(errp, "Bitmap '%s' is frozen and cannot be modified",
|
||||
dst_name);
|
||||
return;
|
||||
} else if (bdrv_dirty_bitmap_readonly(dst)) {
|
||||
error_setg(errp, "Bitmap '%s' is readonly and cannot be modified",
|
||||
dst_name);
|
||||
return;
|
||||
}
|
||||
|
||||
src = bdrv_find_dirty_bitmap(bs, src_name);
|
||||
if (!src) {
|
||||
error_setg(errp, "Dirty bitmap '%s' not found", src_name);
|
||||
return;
|
||||
}
|
||||
|
||||
bdrv_merge_dirty_bitmap(dst, src, errp);
|
||||
}
|
||||
|
||||
BlockDirtyBitmapSha256 *qmp_x_debug_block_dirty_bitmap_sha256(const char *node,
|
||||
const char *name,
|
||||
Error **errp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue