qemu: monitor: Finish implementation of infrastructure for 'query-jobs'

Commit ed56851f1b didn't wire up fetching of the statistics for the
job which are reported by 'query-jobs'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Peter Krempa 2019-11-25 21:28:14 +01:00
parent 27660f7990
commit 01270a9a5f
2 changed files with 8 additions and 2 deletions

View File

@ -154,8 +154,8 @@ struct _qemuMonitorJobInfo {
qemuMonitorJobType type;
qemuMonitorJobStatus status;
char *error;
long long progressCurrent;
long long progressTotal;
unsigned long long progressCurrent;
unsigned long long progressTotal;
};

View File

@ -9221,6 +9221,12 @@ qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data)
job->id = g_strdup(id);
job->error = g_strdup(errmsg);
/* failure to fetch progress stats is not fatal */
ignore_value(virJSONValueObjectGetNumberUlong(data, "current-progress",
&job->progressCurrent));
ignore_value(virJSONValueObjectGetNumberUlong(data, "total-progress",
&job->progressTotal));
return g_steal_pointer(&job);
}