[Qemu-devel] [PATCH v1 0/1] qemu-img: add new function to remove bitmap in image

Ma Haocong posted 1 patch 7 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180911083706.5378-1-mahaocong_work@163.com
Test docker-clang@ubuntu failed
Test checkpatch passed
qemu-img-cmds.hx |   6 +++
qemu-img.c       | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 125 insertions(+)
[Qemu-devel] [PATCH v1 0/1] qemu-img: add new function to remove bitmap in image
Posted by Ma Haocong 7 years, 3 months ago
Hello,

In our scene, we need to delete dirty-bitmap created by using qmp command 
'block-dirty-bitmap-add'. we can use qmp command 'block-dirty-bitmap-remove'
to remove bitmap. Then I think that we should add a new function in qemu-img
to do the same work. 

The command format is: qemu-img removebmp file-name bitmap-name

I test the function by using qmp command to create a named dirty-bitmap in
qcow2 image, then shutdown the vm and using qemu-img to remove it. Then I
test to remove a bitmap with 'IN_USE' flags in qcow2 file, and it works.
I alse test to do the same job to the qcow2 image encrypted by luks.

Please help to review. Thanks.

mahaocong (1):
  Add new command 'removebmp' to remove bitmap in qcow2 file. The format
    is: qemu-img removebmp qcow2-file-name bitmap-name

 qemu-img-cmds.hx |   6 +++
 qemu-img.c       | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)

-- 
2.14.1



Re: [Qemu-devel] [PATCH v1 0/1] qemu-img: add new function to remove bitmap in image
Posted by Eric Blake 7 years, 3 months ago
On 9/11/18 3:37 AM, Ma Haocong wrote:
> Hello,
> 
> In our scene, we need to delete dirty-bitmap created by using qmp command
> 'block-dirty-bitmap-add'. we can use qmp command 'block-dirty-bitmap-remove'
> to remove bitmap. Then I think that we should add a new function in qemu-img
> to do the same work.
> 
> The command format is: qemu-img removebmp file-name bitmap-name

John was working on a more general 'qemu-img bitmap' command that did 
multiple operations from qemu-img, rather than just remove. That feels 
like a more extensible approach than adding a new command for every 
individual bitmap operation.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org