Bug 861581
Summary: | [perl-Sys-Virt] error of get_node_cpu_stats and get_node_memory_stats | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | weizhang <weizhan> |
Component: | perl-Sys-Virt | Assignee: | Daniel Berrangé <berrange> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.4 | CC: | ajia, dallan |
Target Milestone: | rc | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | perl-Sys-Virt-0.10.2-3.el6 | Doc Type: | Bug Fix |
Doc Text: |
Cause:
The incorrect string length was used when setting hash keys
Consequence:
The name of some hash keys was truncated
Fix:
The correct string lengths were provided for hash keys
Result:
The hash keys for the get_node_memory_stats API match their documentation
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 09:52:22 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
weizhang
2012-09-29 09:29:25 UTC
Dan, is utilization available in the latest build? This isn't a bug - the exact set of fields provided varies per hypervisor. Ok, I'm closing it. (In reply to comment #0) > and according to the doc, get_node_memory_stats returned hash reference are > > total > The total memory > > free > The free memory > > buffers > The memory consumed by buffers > > cache > The memory consumed for cache > > But in fact the retured hash is buff, free, total and cached, so need to > change doc > And when getting total with \ > $con->get_node_memory_stats()->{total}; > > It can not get any value, but when print all keys and values, the total > value can be list. Others in get_node_memory_stats are ok > Hi DB, What about this 2 problem? Are they also not bugs? Both of these problems are bugs - the wrong length was used when setting the hash key names Test on perl-Sys-Virt-0.10.2-2.el6.x86_64 According to the doc, get_node_memory_stats returned hash reference are total The total memory free The free memory buffers The memory consumed by buffers cache The memory consumed for cache Test result for script list in description for get_node_memory_stats buffers => 20552 free => 3797896 total => 8060676 cached => 427700 memory state total is 8060676 Only a small problem, the doc is cache, and the list result is cached, is that need to be fixed again or just leave it? Oh yes, that is a docs bug still. Latest build has the docs fixed verify pass on perl-Sys-Virt-0.10.2-3.el6.x86_64 # cat perl-bug861581.pl #!/usr/bin/perl use warnings; use strict; use Sys::Virt; my $uri = "qemu:///system"; my $con = Sys::Virt->new(address => $uri, readonly => 0); my $memory_stats = $con->get_node_memory_stats(); while( my ($a, $b) = each %{$memory_stats}) { print "$a => $b\n"; } my $memory_state_total = $con->get_node_memory_stats()->{total}; print "memory state total is $memory_state_total\n"; # perl perl-bug861581.pl Result buffers => 35804 free => 6056976 total => 8060732 cached => 499232 memory state total is 8060732 And in doc my $info = $con->get_node_memory_stats($cellNum=-1, $flags=0) The fields in the returned hash reference are total The total memory free The free memory buffers The memory consumed by buffers cached The memory consumed for cache Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0377.html |