[virt-tools-list] [PATCH 0/3] virt-top stream mode

KAMEZAWA Hiroyuki kamezawa.hiroyu at jp.fujitsu.com
Wed Jan 26 04:41:31 UTC 2011


Now, virt-top has no option to dump information to stdout.

Considering usual top, I know some admins tend to do

 top -b | awk.... or his own script

to check his system.

I wondered --csv + --script + pipe by mknod may be able to give us
the same behavior but I think it can't, finally. Because
preparing pipe and delete it for each script is not good and
csv file format doesn't much enough for usual scripts which
use regular expressions and check lines one by one.

This patch adds --stream mode.

[Output example]
==
[root at bluextal virt-top-1.0.5]# ./virt-top/virt-top --stream
virt-top time  13:40:40 Host bluextal x86_64 8/8CPU 1999MHz 24033MB
   ID S RDRQ WRRQ RXBY TXBY %CPU %MEM   TIME    NAME
    5 R    0    0    0    0  0.0 34.0 503:52.43 RHEL6
virt-top time  13:40:43 Host bluextal x86_64 8/8CPU 1999MHz 24033MB
   ID S RDRQ WRRQ RXBY TXBY %CPU %MEM   TIME    NAME
    5 R    0    0  104    0  0.7 34.0 503:52.60 RHEL6
==

In this version, only supports "show domain" and "sort by ID".

To be honest, this is the 1st time for me to write program in ocaml.
I'm sorry if my code seems ugly or I misunderstand something.

Patches are divided into 3 patches.
1/3 .... add --stream mode. with dummy function.
2/3 .... fill dummy function to show domain data to stdout.
3/3 .... documentation.

Thanks,
-Kame




More information about the virt-tools-list mailing list