[libvirt] [PATCH perl] block_stats: Fix rd_req and wr_req compat hash keys

Ville Skyttä posted 1 patch 6 years, 3 months ago
Failed in applying to current master (apply log)
Virt.xs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH perl] block_stats: Fix rd_req and wr_req compat hash keys
Posted by Ville Skyttä 6 years, 3 months ago
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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Virt.xs b/Virt.xs
index c47b915..a6f0477 100644
--- 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) {
-- 
2.14.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH perl] block_stats: Fix rd_req and wr_req compat hash keys
Posted by Daniel P. Berrange 6 years, 3 months ago
On Mon, Jan 15, 2018 at 07:50:10PM +0200, Ville Skyttä wrote:
> 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 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, pushed to git.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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