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

Hui Kang hkang at cs.stonybrook.edu
Fri Nov 12 04:00:03 UTC 2010


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;
----------------------------------------------------------------------
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. 

- Hui

On 11/5/10 2:43 PM, "Richard W.M. Jones" <rjones at redhat.com> wrote:

> On Fri, Nov 05, 2010 at 02:35:06PM -0400, Hui Kang wrote:
>> Hi, Richard
>> I found a problem when using --script with virt-top.
>> Virt-top runs well with "virt-top --csv perf.csv" and generates the correct
>> csv file. However, after I add "--script", it reports the error as follows
>> 
>> "libvir: Linux stats error: internal error read_bd_stats: Failed to read any
>> block statistics"
>> 
>> Is this a bug with virt-top?
> 
> Hi, please send messages to the virt-tools mailing list:
> 
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 
> I don't know particularly why --script would affect libvirt.  However
> I can report that it works fine for me.
> 
> Rich.





More information about the virt-tools-list mailing list