[libvirt] [PATCH 4/9] qemu: Implement VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP

Peter Krempa posted 9 patches 12 weeks ago

[libvirt] [PATCH 4/9] qemu: Implement VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP

Posted by Peter Krempa 12 weeks ago
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_driver.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 669c12d6ca..5d6a82bc13 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13958,7 +13958,8 @@ qemuDomainGetJobStats(virDomainPtr dom,
     bool completed = !!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED);
     int ret = -1;

-    virCheckFlags(VIR_DOMAIN_JOB_STATS_COMPLETED, -1);
+    virCheckFlags(VIR_DOMAIN_JOB_STATS_COMPLETED |
+                  VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP, -1);

     if (!(vm = qemuDomainObjFromDomain(dom)))
         goto cleanup;
@@ -13980,7 +13981,7 @@ qemuDomainGetJobStats(virDomainPtr dom,

     ret = qemuDomainJobInfoToParams(&jobInfo, type, params, nparams);

-    if (completed && ret == 0)
+    if (completed && ret == 0 && !(flags & VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP))
         VIR_FREE(priv->job.completed);

  cleanup:
-- 
2.23.0

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

Re: [libvirt] [PATCH 4/9] qemu: Implement VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP

Posted by Eric Blake 12 weeks ago
On 11/25/19 9:01 AM, Peter Krempa wrote:
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>   src/qemu/qemu_driver.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)

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

(Any renaming ripple from 2/9 should be obvious)

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

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