1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-09 09:57:23 +03:00

Modified xen im probe to deal with #54

git-svn-id: http://svn.opennebula.org/one/trunk@431 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Javier Fontán Muiños 2009-03-27 13:58:41 +00:00
parent 80bd74457b
commit efb64dc516

View File

@ -41,6 +41,9 @@ domains_info=xentop_text[3..-1]
memory_info=Hash.new
cpu_info=Hash.new
free_memory=nil
max_free_memory=nil
xm_text.each_line {|line|
columns=line.split(":").collect {|c| c.strip }
@ -48,7 +51,9 @@ xm_text.each_line {|line|
when 'total_memory'
memory_info[:total]=columns[1].to_i*1024
when 'max_free_memory'
memory_info[:free]=columns[1].to_i*1024
max_free_memory=columns[1].to_i*1024
when 'max_free_memory'
free_memory=columns[1].to_i*1024
when 'nr_cpus'
cpu_info[:total]=columns[1].to_f*100
when 'cpu_mhz'
@ -56,6 +61,12 @@ xm_text.each_line {|line|
end
}
if max_free_memory
memory_info[:free]=max_free_memory
else
memory_info[:free]=free_memory
end
memory_info[:used]=memory_info[:total]-memory_info[:free]
# DOMAINS LINES