Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 727094

Summary: Error return value and output for memtune command when use --min-guarantee option
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Alex Jia <ajia>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: dallan, dyuan, mzhan, rwu, veillard
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.4-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:20:28 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 Alex Jia 2011-08-01 10:09:48 UTC
Description of problem:
Although actual result is fail when setting --min-guarantee for a inactive guest, virsh is still return 0 and without any error information output.

Version-Release number of selected component (if applicable):
# uname -r
2.6.32-160.el6.x86_64

# rpm -q libvirt
libvirt-0.9.4-0rc2.el6.x86_64

# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.169.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. virsh domstate ${guestname} and make sure guest status is "shut off"
2. virsh memtune ${guestname} --min-guarantee 1024 && echo $?
3. check /var/log/libvirtd.log
  
Actual results:
# virsh memtune vr-rhel6u1-x86_64-kvm --min-guarantee 1024 && echo $?

0

# tail -1 /var/log/libvirtd.log 
17:47:23.737: 13256: error : qemuDomainSetMemoryParameters:5976 : invalid argument in Memory tunable `min_guarantee' not implemented


Expected results:
virsh raises correct error information and return value is 1.

Additional info:
This a similar return value issue to https://bugzilla.redhat.com/show_bug.cgi?id=726304, I will commit a patch to fix this issue.

Comment 2 Alex Jia 2011-08-01 14:59:39 UTC
here is a latest patch:
https://www.redhat.com/archives/libvir-list/2011-August/msg00035.html

Comment 3 Dave Allan 2011-08-01 15:42:21 UTC
commit 868453db1ebcc8e7b2e17e8ae99a207ca880530e
Author: Alex Jia <ajia>
Date:   Mon Aug 1 23:06:07 2011 +0800

    qemu: fix return value issue in qemuDomainSetMemoryParameters
    
    whether or not previous return value is -1, the following codes will be
    executed for a inactive guest in qemuDomainSetMemoryParameters:
    ret = virDomainSaveConfig(driver->configDir, persistentDef);
    and if everything is okay, 'ret' is assigned to 0, the previous 'ret'
    will be overwritten, this patch will fix this issue.
    
    * src/qemu/qemu_driver.c: avoid return value is overwritten when set
      min_guarante value to a inactive guest.
    
    * how to reproduce?
      % virsh memtune ${guestname} --min_guarante 1024
      % echo $?
    
      Note: guest must be inactive, in fact, 'min_guarante' hasn't been implemented
      in memory tunable, and I can get the error when check actual libvirtd.log,
      however, virsh hasn't raised any error information, and return value is 0.
    
    Signed-off-by: Alex Jia <ajia>

Comment 5 Alex Jia 2011-08-03 07:47:12 UTC
I can get a appropriate error information and virsh return value is 1, the bug has been fixed on rhel6.2(2.6.32-160.el6.x86_64) with libvirt-0.9.4-1.el6.

# virsh memtune vr-rhel6u1-x86_64-kvm --min_guarante 1024
error: command 'memtune' doesn't support option --min_guarante

# echo $?
1

Comment 6 Min Zhan 2011-11-14 06:51:34 UTC
Some typo in Comment 5. The correct one should be as following:

# virsh memtune rhel62 --min-guarantee 1024 
error: Unable to change memory parameters
error: invalid argument: Memory tunable `min_guarantee' not implemented

# echo $?
1

Comment 7 errata-xmlrpc 2011-12-06 11:20:28 UTC
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-2011-1513.html