[libvirt] [PATCH 2/9] qemu: monitor: Add transaction generators for dirty bitmap APIs

Eric Blake eblake at redhat.com
Thu Sep 26 22:36:28 UTC 2019


On 9/26/19 11:05 AM, Peter Krempa wrote:
> Rather than generating the transaction contents in random places add a
> unified set of APIs to generate the contents for a 'transaction' for the
> dirty bitmap APIs.
> 
> Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> ---
>   src/qemu/qemu_monitor.c      | 48 ++++++++++++++++++++++++
>   src/qemu/qemu_monitor.h      | 24 ++++++++++++

How much longer do we have to keep qemu_monitor.h?  I guess as long as 
we still use savevm over HMP.  Oh well, not the problem to be solving now.

>   src/qemu/qemu_monitor_json.c | 71 ++++++++++++++++++++++++++++++++++++
>   src/qemu/qemu_monitor_json.h | 24 ++++++++++++

I also wonder if we could reduce a LOT of duplication by having 
qemu_monitor.h declare typedefs, and then qemu_monitor_json.c populate a 
structure with function pointers, rather than having to declare every 
function in two .h files.  It doesn't reduce the fact that we have to 
implement everything in two .c files, but 3 files would be slightly 
nicer than 4 for every monitor addition.  Again, not necessarily the 
problem to be solving now.


> +
> +int
> +qemuMonitorJSONTransactionBitmapRemove(virJSONValuePtr actions,
> +                                       const char *node,
> +                                       const char *name)
> +{
> +    return qemuMonitorJSONTransactionAdd(actions,
> +                                         "block-dirty-bitmap-remove",
> +                                         "s:node", node,
> +                                         "s:name", name,
> +                                         NULL);
> +}
> +

This one is not in qemu 4.1.  I guess that's why you're trying to depend 
on that feature, even though I still think it is possible to use 
non-atomic removal (which does not affect correctness of remaining 
bitmaps) even though the resulting cleanup is more complex.

Reviewed-by: Eric Blake <eblake at redhat.com>

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




More information about the libvir-list mailing list