Masaki Kanno
2006-Sep-19 04:16 UTC
[Xen-devel] [PATCH] Add memory size checking for xm create/mem-set command
Hi, The "xm create" command does not check the value of memory size now. The "xm mem-set" command does not check, too. When I tested the "xm create" and the "xm mem-set" command by setting an obviously wrong value to the memory size, the results were as follows. # xm create /xen/vm1.conf memory=0 Using config file "/xen/vm1.conf". Error: (22, ''Invalid argument'') # xm create /xen/vm1.conf memory=-1 Using config file "/xen/vm1.conf". Error: (22, ''Invalid argument'') # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 506 2 r----- 108.4 vm1 5 128 1 -b---- 31.3 # xm mem-set vm1 0 # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 506 2 r----- 109.2 vm1 5 27 1 -b---- 31.8 *The following message was output to the console of domU. Out of Memory: Kill process 2 (migration/0) score 0 and children. # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 506 2 r----- 159.2 vm1 7 128 1 -b---- 31.6 # xm mem-set vm1 -1 # xm list Name ID Mem(MiB) VCPUs State Time(s) Domain-0 0 506 2 r----- 159.9 vm1 7 -1 1 -b---- 31.6 I think that the xm/xend should check the obviously wrong memory size, and should show an error message. This patch adds the checking of obviously wrong memory size about the "xm create" and "xm mem-set" command. # xm create /xen/vm1.conf memory=0 Using config file "/xen/vm1.conf". Error: invalid memory size # xm create /xen/vm1.conf memory=-1 Using config file "/xen/vm1.conf". Error: invalid memory size # xm mem-set vm1 0 Error: Invalid memory size # xm mem-set vm1 -1 Error: Invalid memory size Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com> Best regards, Kan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Alastair Tse
2006-Sep-22 16:36 UTC
Re: [Xen-devel] [PATCH] Add memory size checking for xm create/mem-set command
On Tue, 2006-09-19 at 13:16 +0900, Masaki Kanno wrote:> I think that the xm/xend should check the obviously wrong memory > size, and should show an error message. > This patch adds the checking of obviously wrong memory size > about the "xm create" and "xm mem-set" command.[snip..] Thanks for the patch. Applied to xen-unstable. Cheers, Alastair _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel