qemu: Implement VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Peter Krempa 2019-11-25 14:19:10 +01:00
parent 7884b40659
commit 2dae916de4

View File

@ -13964,7 +13964,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_KEEP_COMPLETED, -1);
if (!(vm = qemuDomainObjFromDomain(dom)))
goto cleanup;
@ -13986,7 +13987,7 @@ qemuDomainGetJobStats(virDomainPtr dom,
ret = qemuDomainJobInfoToParams(&jobInfo, type, params, nparams);
if (completed && ret == 0)
if (completed && ret == 0 && !(flags & VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED))
VIR_FREE(priv->job.completed);
cleanup: