[libvirt] [PATCH RFC 26/40] qemu: checkpoint: Use qemuMonitorTransactionBitmapMergeSourceAddBitmap

Peter Krempa posted 40 patches 6 years, 2 months ago
[libvirt] [PATCH RFC 26/40] qemu: checkpoint: Use qemuMonitorTransactionBitmapMergeSourceAddBitmap
Posted by Peter Krempa 6 years, 2 months ago
Use the new helper in qemuCheckpointDiscard rather than constructing the
array manually.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_checkpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index 6a272f9dab..937d9d6b3e 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -173,7 +173,7 @@ qemuCheckpointDiscard(virQEMUDriverPtr driver,
                     if (!(arr = virJSONValueNewArray()))
                         return -1;

-                    if (virJSONValueArrayAppendString(arr, disk->bitmap) < 0)
+                    if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(arr, node, disk->bitmap) < 0)
                         return -1;

                     if (chk == virDomainCheckpointGetCurrent(vm->checkpoints)) {
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH RFC 26/40] qemu: checkpoint: Use qemuMonitorTransactionBitmapMergeSourceAddBitmap
Posted by Ján Tomko 6 years, 1 month ago
On Fri, Oct 18, 2019 at 06:11:11PM +0200, Peter Krempa wrote:
>Use the new helper in qemuCheckpointDiscard rather than constructing the
>array manually.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_checkpoint.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
>index 6a272f9dab..937d9d6b3e 100644
>--- a/src/qemu/qemu_checkpoint.c
>+++ b/src/qemu/qemu_checkpoint.c
>@@ -173,7 +173,7 @@ qemuCheckpointDiscard(virQEMUDriverPtr driver,
>                     if (!(arr = virJSONValueNewArray()))
>                         return -1;
>
>-                    if (virJSONValueArrayAppendString(arr, disk->bitmap) < 0)
>+                    if (qemuMonitorTransactionBitmapMergeSourceAddBitmap(arr, node, disk->bitmap) < 0)
>                         return -1;

This would look better with less indentation.

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list