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.
An update of this bug, the hvm guest is rhel5.5 or rhel5.6 in Description.
*** Bug 643295 has been marked as a duplicate of this bug. ***
oops, closed by mistake.
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.
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