Signed-off-by: Peter Krempa <pkrempa(a)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