Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 703693

Summary: [balloon] Set maxmem of hvm guest got error
Product: Red Hat Enterprise Linux 5 Reporter: Yufang Zhang <yuzhang>
Component: xenAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.7CC: byu, drjones, leiwang, pbonzini, shwang, xen-maint, yuzhou
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: xen-3.0.3-133.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 05:54:59 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:
Bug Depends On:    
Bug Blocks: 699611    

Description Yufang Zhang 2011-05-11 03:29:20 UTC
Description of problem:
On both Intel and AMD machines, I got error when I set maxmem as the same value of current memory size via 'xm mem-max'. No such issue for pv guest.  

Version-Release number of selected component (if applicable):
xen-3.0.3-130.el5
kernel-xen-2.6.18-259.el5

How reproducible:
Always.

Steps to Reproduce:

# xm li
Name                                      ID Mem(MiB) VCPUs State   Time(s)
Domain-0                                   0     3650    32 r-----  24645.2
vm1                                      146     1031     4 -b----   4953.1

# xm li vm1 -l | grep mem
    (memory 1024)
    (shadow_memory 12)
    (maxmem 1031)

# xm mem-max vm1 1031
Error: (22, 'Invalid argument')
Usage: xm mem-max <Domain> <Mem>

Set the maximum amount reservation for a domain.
  

Actual results:


Expected results:
No error when set maxmem to a valid value.

Additional info:
Nothing special in xend.log:

# tail -f /var/log/xen/xend.log
[2011-05-10 16:08:50 xend 8638] DEBUG (DevController:179) Waiting for devices ioports.
[2011-05-10 16:08:50 xend 8638] DEBUG (DevController:179) Waiting for devices tap.
[2011-05-10 16:08:50 xend 8638] DEBUG (DevController:179) Waiting for devices vtpm.
[2011-05-10 16:08:50 xend 8638] INFO (XendDomain:388) Domain vm1 (146) unpaused.
[2011-05-10 16:09:04 xend.XendDomainInfo 8638] DEBUG (XendDomainInfo:1437) Setting maximum memory value of domain vm1 (146) to 1024 MiB.
[2011-05-10 16:09:24 xend.XendDomainInfo 8638] DEBUG (XendDomainInfo:1437) Setting maximum memory value of domain vm1 (146) to 1031 MiB.
[2011-05-10 16:09:28 xend.XendDomainInfo 8638] DEBUG (XendDomainInfo:1437) Setting maximum memory value of domain vm1 (146) to 1035 MiB.
[2011-05-10 16:09:38 xend.XendDomainInfo 8638] DEBUG (XendDomainInfo:1437) Setting maximum memory value of domain vm1 (146) to 1031 MiB.
[2011-05-10 16:10:24 xend.XendDomainInfo 8638] DEBUG (XendDomainInfo:1437) Setting maximum memory value of domain vm1 (146) to 1031 MiB.
[2011-05-11 06:06:09 xend.XendDomainInfo 8638] DEBUG (XendDomainInfo:1437) Setting maximum memory value of domain vm1 (146) to 1031 MiB.

Comment 1 Yufang Zhang 2011-05-11 03:51:39 UTC
An update of this bug, the hvm guest is rhel5.5 or rhel5.6 in Description.

Comment 2 Paolo Bonzini 2011-05-31 10:56:31 UTC
*** Bug 643295 has been marked as a duplicate of this bug. ***

Comment 3 Paolo Bonzini 2011-05-31 11:01:51 UTC
oops, closed by mistake.

Comment 4 Paolo Bonzini 2011-06-03 13:41:14 UTC
The bug is simply that getSysMem is rounding down the amount in kilobytes.  So the actual value is 2055.something and it should be printed as 2056.  From a quick look, it is safe to change getSysMem to round up.

Comment 10 errata-xmlrpc 2012-02-21 05:54:59 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-2012-0160.html