[PATCH 01/10] qemu: monitor: Finish implementation of infrastructure for 'query-jobs'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_monitor.h      | 4 ++--
 src/qemu/qemu_monitor_json.c | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index a17d7200c2..e2bfc420bb 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -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;
 };


diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 4d38030179..9f3783ab70 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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);
 }

-- 
2.23.0

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux