Bug 639587
| Summary: | virsh freecell' prints the available amount of memory even if an invalid cellno is specified. | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Humble Chirammal <hchiramm> |
| Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | 6.1 | CC: | dallan, eblake, jdenemar, mprivozn, mzhan, skito, xen-maint, yoyzhang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.8.7-11.el6 | Doc Type: | Bug Fix |
| Doc Text: |
The "virsh freecell" command could be run with an invalid (non-integer) argument without error, and the free memory for node 0 would still be printed. The validity of the argument is now checked, and an error message is now printed when an invalid value is detected.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-05-19 13:22:16 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Humble Chirammal
2010-10-02 11:39:23 UTC
A patch has ben posted: https://www.redhat.com/archives/libvir-list/2011-March/msg00003.html https://www.redhat.com/archives/libvir-list/2011-March/msg00004.html Patches posted to rhvirt-patches: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-March/msg00147.html http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-March/msg00148.html Verified with Passed with below environment: libvirt-0.8.7-11.el6 qemu-kvm-0.12.1.2-2.150.el6 kernel-2.6.32-120.el6 # uname -a Linux dhcp-65-85.nay.redhat.com 2.6.32-120.el6.x86_64 #1 SMP Mon Mar 7 11:59:40 EST 2011 x86_64 x86_64 x86_64 GNU/Linux Steps: # virsh freecell Total: 5994588 kB # virsh freecell --cellno 0 0: 5990484 kB # virsh freecell foo000 error: unexpected data 'foo000' # virsh freecell foo error: unexpected data 'foo' # virsh freecell 0 error: unexpected data '0' ---------------- I can reproduce this bug with libvirt-0.8.1-27.el6.x86_64. Verified with Passed with below environment: libvirt-0.8.7-17.el6 qemu-kvm-0.12.1.2-2.158.el6.x86_64 # uname -a Linux localhost.localdomain 2.6.32-131.0.1.el6.x86_64 #1 SMP Tue Apr 12 16:40:23 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux And there is a bug 693963 tracking problem below: # virsh freecell --cellno 0 0: 7441144 kB # virsh freecell 0 error: unexpected data '0'
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Cause:
run virsh freecell with non-integer value
Consequence:
virsh print free memory for node 0
Fix:
Changed parsing functions of optional arguments so we can detect if given argument is (in-)valid as well.
Result:
virsh prints error message about argument being non-integer
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1,8 +1 @@
-Cause:
+The "virsh freecell" command could be run with an invalid (non-integer) argument without error, and the free memory for node 0 would still be printed. The validity of the argument is now checked, and an error message is now printed when an invalid value is detected.- run virsh freecell with non-integer value
-Consequence:
- virsh print free memory for node 0
-Fix:
- Changed parsing functions of optional arguments so we can detect if given argument is (in-)valid as well.
-Result:
- virsh prints error message about argument being non-integer
* The problem was we didn't parse the arguments right, the parsing functions returned the value of argument by value instead of reference, so we were not able to detect situations for incorrect argument. * Which led to a situation when incorrect argument given was treated like 0 * We changed the parsing functions, so we can now distinguish cases like that * So what will user see now is error message about incorrect argument specified An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0596.html |