qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 6/9] qemu-img: Add bitmap sub-command


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v4 6/9] qemu-img: Add bitmap sub-command
Date: Thu, 14 May 2020 18:09:22 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

14.05.2020 17:20, Eric Blake wrote:
On 5/14/20 1:45 AM, Vladimir Sementsov-Ogievskiy wrote:
13.05.2020 04:16, Eric Blake wrote:
Include actions for --add, --remove, --clear, --enable, --disable, and
--merge (note that --clear is a bit of fluff, because the same can be
accomplished by removing a bitmap and then adding a new one in its
place, but it matches what QMP commands exist).  Listing is omitted,
because it does not require a bitmap name and because it was already
possible with 'qemu-img info'.  A single command line can play one or
more bitmap commands in sequence on the same bitmap name (although all
added bitmaps share the same granularity, and and all merged bitmaps
come from the same source file).  Merge defaults to other bitmaps in
the primary image, but can also be told to merge bitmaps from a
distinct image.



I'm sorry for asking it only now on v4.. But still. Why do we need it?

Ease of use.

We can instead run qemu binary (or even new qemu-storage-daemon) and just use 
existing qmp commands. Is there a real benefit in developing qemu-img, 
maintaining two interfaces for the same thing?

If it makes someone's life easier, and is not hard to maintain, then yes.  A 
command line interface that calls into QMP is not hard to maintain.  And _I_ 
certainly found it easier to write iotests with this patch in place, so it 
already has at least one client.

Of-course, just run qmp commands from terminal is a lot less comfortable than 
just a qemu img command.. But may be we need some wrapper, which make it simple 
to run one qmp command on an image?

It's simple to make a python wrapper working like

qemu-qmp block-dirty-bitmap-add '{node: self, name: bitmap0, persistent: true}' 
/path/to/x.qcow2

This _IS_ such a wrapper.  The whole point of this patch is that it is now 
simpler to run one (or more) QMP command on an offline image from the command 
line.  Just because I wrote it in C instead of python, and attached it to an 
existing tool instead of writing a new tool, doesn't change the fact that it is 
just a wrapper around the existing QMP commands.


OK, that's right.

The thing that I didn't like is that we have to make cli-to-qapi interface 
mapping by hand. But I see now that interface you implementing is prepared to 
make several actions with same bitmap-name, which can't be achieved with some 
kind of automatic interface matching anyway, so my proposal don't match your 
needs, sorry for my haste)


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]