mbox series

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

Message ID 20180911083706.5378-1-mahaocong_work@163.com (mailing list archive)
Headers show
Series qemu-img: add new function to remove bitmap in image | expand

Message

mahaocong Sept. 11, 2018, 8:37 a.m. UTC
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(+)

Comments

Eric Blake Sept. 11, 2018, 1:49 p.m. UTC | #1
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.