|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/2] TestSupport.pm: introduce host_get_free_memory
Wei Liu writes ("[PATCH 1/2] TestSupport.pm: introduce host_get_free_memory"):
> ... which returns the size of free memory in MB.
...
> +sub host_get_free_memory($$) {
> + my ($ho,$toolstack) = @_;
> + # The line is as followed:
> + # free_memory : XXXX
> + my $cmd = "$toolstack info | grep free_memory | awk {'print \$3'}";
> + my $free_memory_mb = target_cmd_root($ho, $cmd, 10);
> + return $free_memory_mb;
> +}
Surely it would be better do to the parsing on the control host in
Perl rather than sending grep/awk runes to the target ? One regexp
ought to do it.
Also, did you test this ? target_cmd_root doesn't return you the
output.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |