WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Add memory size checking for xm create/mem-set comma

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Add memory size checking for xm create/mem-set command
From: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Date: Tue, 19 Sep 2006 13:16:15 +0900
Delivery-date: Mon, 18 Sep 2006 21:17:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxx>

Best regards,
 Kan

Attachment: memory_size.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>