[virt-tools-list] Virt-top --script problem

Richard W.M. Jones rjones at redhat.com
Thu Nov 18 09:56:57 UTC 2010


On Fri, Nov 12, 2010 at 04:00:03AM +0000, Hui Kang wrote:
> Hi, Richard
> I recompiled the libvirt from git with this patch
> ----------------------------------------------------------------------
> diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c
> index 1d875f2..1b780ba 100644
> --- a/src/xen/block_stats.c
> +++ b/src/xen/block_stats.c
> @@ -130,13 +130,13 @@ read_bd_stat (int device, int domid, const char *str)
>      if (r >= 0) return r;
>  
>      snprintf (path, sizeof path,
> -              "/sys/devices/xen-backend/vbd-%d-%d/statistics/%s",
> +              "/sys/devices/vbd-%d-%d/statistics/%s",
>                domid, device, str);
>      r = read_stat (path);
>      if (r >= 0) return r;
>  
>      snprintf (path, sizeof path,
> -              "/sys/devices/xen-backend/tap-%d-%d/statistics/%s",
> +              "/sys/devices/tap-%d-%d/statistics/%s",
>                domid, device, str);
>      r = read_stat (path);
>      return r;
> ----------------------------------------------------------------------

Paolo, is there a correct location for these statistics directories?
(It would have to work on RHEL 5 as well as upstream Xen).

> Now my "virsh domblkstat vm1 xvda" have these output.
> xvda rd_req 3715
> xvda rd_bytes 89224192
> xvda wr_req 183
> xvda wr_bytes 1400832
> xvda errs 0
> 
> However, the virt-top still fails to read the block stats. Any comment?
> Thanks. 

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the virt-tools-list mailing list