]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
cgroup: read more data from cgroup cpuacct.usage_percpu
authorGuannan Ren <gren@redhat.com>
Fri, 31 Aug 2012 08:31:30 +0000 (16:31 +0800)
committerGuannan Ren <gren@redhat.com>
Fri, 31 Aug 2012 08:31:30 +0000 (16:31 +0800)
On NUMA machine, the length of string got from file
cpuacct.usage_percpu is quite large, so expand the
limit of 1024 bytes.

errors like:
Failed to read file \
'/cgroup/cpuacct/libvirt/qemu/rhel6q/cpuacct.usage_percpu': \
Value too large for defined data type

src/util/cgroup.c

index 8541c7fdaed49f4061703f47c5860510b7e0f553..5dc07649d3d16023f6264b610bec717cb76accc6 100644 (file)
@@ -360,7 +360,7 @@ static int virCgroupGetValueStr(virCgroupPtr group,
 
     VIR_DEBUG("Get value %s", keypath);
 
-    rc = virFileReadAll(keypath, 1024, value);
+    rc = virFileReadAll(keypath, 1024*1024, value);
     if (rc < 0) {
         rc = -errno;
         VIR_DEBUG("Failed to read %s: %m\n", keypath);