block_stats: Fix rd_req and wr_req compat hash keys
authorVille Skyttä <ville.skytta@iki.fi>
Mon, 15 Jan 2018 17:50:10 +0000 (19:50 +0200)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 15 Jan 2018 18:11:31 +0000 (18:11 +0000)
When virDomainBlockStatsFlags with NULL params fails, the returned
read and write requests hash keys are said to be backwards compatible
with the key names success case. However, they were rd_reqs and
wr_reqs (in plural) as opposed to the success case's rd_req and
wr_req.

There is also a similar flush_reqs key, but that one does not have a
corresponding value in the success case's hash, so it is left
unmodified here.

Virt.xs

diff --git a/Virt.xs b/Virt.xs
index c47b915..a6f0477 100644 (file)
--- a/Virt.xs
+++ b/Virt.xs
@@ -5611,9 +5611,9 @@ block_stats(dom, path, flags=0)
               field = NULL;
               /* For back compat with previous hash above */
               if (strcmp(params[i].field, "rd_operations") == 0)
-                  field = "rd_reqs";
+                  field = "rd_req";
               else if (strcmp(params[i].field, "wr_operations") == 0)
-                  field = "wr_reqs";
+                  field = "wr_req";
               else if (strcmp(params[i].field, "flush_operations") == 0)
                   field = "flush_reqs";
               if (field) {