On 01/15/2014 07:23 AM, Thorsten Behrens wrote:
This reads blkio stats from blkio.throttle.io_service_bytes and
blkio.throttle.io_serviced.
---
src/libvirt_private.syms | 2 +
src/util/vircgroup.c | 208 +++++++++++++++++++++++++++++++++++++++++++++++
src/util/vircgroup.h | 12 +++
3 files changed, 222 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 3b3de15..edbf6ba 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1003,6 +1003,8 @@ virCgroupDenyDevice;
virCgroupDenyDeviceMajor;
virCgroupDenyDevicePath;
virCgroupFree;
+virCgroupGetBlkioIoDeviceServiced;
+virCgroupGetBlkioIoServiced;
virCgroupGetBlkioWeight;
virCgroupGetCpuacctPercpuUsage;
virCgroupGetCpuacctStat;
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 43eb649..1a579f0 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1826,6 +1826,191 @@ virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int
*weight)
/**
+ * virCgroupGetBlkioIoServiced:
+ *
+ * @group: The cgroup to get throughput for
+ * @kb: Pointer to returned serviced io in kilobytes
+ *
+ * Returns: 0 on success, -1 on error
+ */
+int
+virCgroupGetBlkioIoServiced(virCgroupPtr group,
+ long long *bytes_read,
+ long long *bytes_write,
+ long long *requests_read,
+ long long *requests_write)
+{
+ long long stats_val;
+ char *str1=NULL, *str2=NULL, *p1, *p2;
please add blank.
char *str1 = NULL, *str2 = NULL, *p1, *p2;