Re: [libvirt] [PATCHv4 02/10] Implement domainMemoryStats API slot for LXC driver.

2014-02-20 Thread Thorsten Behrens
Hi Michal, thx for further cleaning up, and pushing - Michal Privoznik wrote: +if (!virCgroupGetMemoryUsage(priv-cgroup, mem_usage)) +goto cleanup; + +ret = 0; +if (!virDomainObjIsActive(vm)) +goto cleanup; I think these two lines (well three), otherwise we

Re: [libvirt] [PATCHv3 00/10] Add BlkIO and CPU/mem stat API implementations for lxc

2014-02-19 Thread Thorsten Behrens
I wrote: This patch set adds block io, memory and domain cpu statistics API slot implementations to the LXC driver, in order to get linux container monitoring and accounting a bit closer to qemu standards. Hi guys, hmm, this would be cool to get into 1.2.2 - any chance for that? ;) Some

[libvirt] [PATCHv4 01/10] Add util virCgroupGetBlkioIo*Serviced methods.

2014-02-14 Thread Thorsten Behrens
This reads blkio stats from blkio.throttle.io_service_bytes and blkio.throttle.io_serviced. --- src/libvirt_private.syms | 2 + src/util/vircgroup.c | 254 +++ src/util/vircgroup.h | 12 +++ 3 files changed, 268 insertions(+) diff --git

[libvirt] [PATCHv4 06/10] Widening API change - accept empty path for virDomainBlockStats

2014-02-14 Thread Thorsten Behrens
And provide domain summary stat in that case, for lxc backend. Use case is a container inheriting all devices from the host, e.g. when doing application containerization. --- src/libvirt.c| 8 ++-- tools/virsh-domain-monitor.c | 11 --- tools/virsh.pod |

[libvirt] [PATCHv4 10/10] Add unit test for virCgroupGetPercpuStats.

2014-02-14 Thread Thorsten Behrens
--- tests/vircgrouptest.c | 66 +++ 1 file changed, 66 insertions(+) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index e05b882..5c14efb 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -33,6 +33,7 @@ # include

[libvirt] [PATCHv4 00/10] Add BlkIO and CPU/mem stat API implementations for lxc

2014-02-14 Thread Thorsten Behrens
domains's block io'. v4 addresses the last remaining review comments. Thorsten Behrens (10): Add util virCgroupGetBlkioIo*Serviced methods. Implement domainMemoryStats API slot for LXC driver. Make qemuGetDomainTotalCPUStats a virCgroup function. Implement domainGetCPUStats for lxc driver

[libvirt] [PATCHv4 02/10] Implement domainMemoryStats API slot for LXC driver.

2014-02-14 Thread Thorsten Behrens
--- Notes to v4: - check errors before filling param array - UL-ULL change punted to separate patch src/lxc/lxc_driver.c | 56 1 file changed, 56 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index f735631..827d989

[libvirt] [PATCHv4 05/10] Implement lxcDomainBlockStats* for lxc driver

2014-02-14 Thread Thorsten Behrens
Adds lxcDomainBlockStatsFlags and lxcDomainBlockStats functions. --- src/lxc/lxc_driver.c | 195 +++ 1 file changed, 195 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index e31b3ac..e1fcceb 100644 --- a/src/lxc/lxc_driver.c

[libvirt] [PATCHv4 03/10] Make qemuGetDomainTotalCPUStats a virCgroup function.

2014-02-14 Thread Thorsten Behrens
To reuse this from other drivers, like lxc. --- src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 54 ++-- src/util/vircgroup.c | 53 +++ src/util/vircgroup.h | 5 + 4 files changed, 61

[libvirt] [PATCHv4 07/10] Add unit test for virCgroupGetBlkioIo*Serviced

2014-02-14 Thread Thorsten Behrens
--- Notes to v4: - share fake disk device path via header file instead of env var tests/testutilslxc.h | 3 ++ tests/vircgroupmock.c | 98 +- tests/vircgrouptest.c | 129 ++ 3 files changed, 228

[libvirt] [PATCHv4 08/10] Add unit test for virCgroupGetMemoryUsage.

2014-02-14 Thread Thorsten Behrens
--- tests/vircgrouptest.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index df29531..e05b882 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -530,6 +530,38 @@ static int

[libvirt] [PATCHv4 04/10] Implement domainGetCPUStats for lxc driver.

2014-02-14 Thread Thorsten Behrens
--- Notes to v4: - removed extraneous variable src/libvirt_private.syms | 1 + src/lxc/lxc_driver.c | 49 +++ src/util/vircgroup.c | 75 src/util/vircgroup.h | 7 + 4 files changed, 132 insertions(+)

[libvirt] [PATCHv4 09/10] Fix misspelled cpuacct.usage_percpu in cgroup mock.

2014-02-14 Thread Thorsten Behrens
--- tests/vircgroupmock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c index d154a4a..ae88984 100644 --- a/tests/vircgroupmock.c +++ b/tests/vircgroupmock.c @@ -215,7 +215,7 @@ static int make_controller(const char *path, mode_t

[libvirt] [PATCHv3 10/10] Add unit test for virCgroupGetPercpuStats.

2014-02-03 Thread Thorsten Behrens
--- tests/vircgrouptest.c | 66 +++ 1 file changed, 66 insertions(+) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index 6826442..dfcb0aa 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -32,6 +32,7 @@ # include

[libvirt] [PATCHv3 06/10] Widening API change - accept empty path for virDomainBlockStats

2014-02-03 Thread Thorsten Behrens
And provide domain summary stat in that case, for lxc backend. Use case is a container inheriting all devices from the host, e.g. when doing application containerization. --- src/libvirt.c| 8 ++-- tools/virsh-domain-monitor.c | 11 --- tools/virsh.pod |

[libvirt] [PATCHv3 09/10] Fix misspelled cpuacct.usage_percpu in cgroup mock.

2014-02-03 Thread Thorsten Behrens
--- Turned out during test writing, when this was actually used the first time. tests/vircgroupmock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c index d772652..84bb1b0 100644 --- a/tests/vircgroupmock.c +++

[libvirt] [PATCHv3 05/10] Implement lxcDomainBlockStats* for lxc driver

2014-02-03 Thread Thorsten Behrens
Adds lxcDomainBlockStatsFlags and lxcDomainBlockStats functions. --- Notes v3: - merged patch, both api methods now added in one - addressed comments from v2 review - check for cgroup controllers actually being mounted src/lxc/lxc_driver.c | 196

[libvirt] [PATCHv3 08/10] Add unit test for virCgroupGetMemoryUsage.

2014-02-03 Thread Thorsten Behrens
--- tests/vircgrouptest.c | 35 +++ 1 file changed, 35 insertions(+) diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index a29cdd2..6826442 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -532,6 +532,38 @@ static int

[libvirt] [PATCHv3 07/10] Add unit test for virCgroupGetBlkioIo*Serviced

2014-02-03 Thread Thorsten Behrens
--- Adds another dummy device to push the cgroup parsing code a bit harder tests/vircgroupmock.c | 107 +++- tests/vircgrouptest.c | 133 ++ 2 files changed, 238 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCHv3 01/10] Add util virCgroupGetBlkioIo*Serviced methods.

2014-02-03 Thread Thorsten Behrens
This reads blkio stats from blkio.throttle.io_service_bytes and blkio.throttle.io_serviced. --- Notes v3: - beyond the minor nits from the last review, virCgroupGetBlkioIoDeviceServiced was rather busted wrt. string ptr p. Now fixed, and with unit test (separate patch)

[libvirt] [PATCHv3 03/10] Make qemuGetDomainTotalCPUStats a virCgroup function.

2014-02-03 Thread Thorsten Behrens
To reuse this from other drivers, like lxc. --- src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 54 ++-- src/util/vircgroup.c | 53 +++ src/util/vircgroup.h | 5 + 4 files changed, 61

[libvirt] [PATCHv3 00/10] Add BlkIO and CPU/mem stat API implementations for lxc

2014-02-03 Thread Thorsten Behrens
domains's block io'. v3 addresses review comments, and adds unit tests for good measure. Thorsten Behrens (10): Add util virCgroupGetBlkioIo*Serviced methods. Implement domainMemoryStats API slot for LXC driver. Make qemuGetDomainTotalCPUStats a virCgroup function. Implement

[libvirt] [PATCHv3 04/10] Implement domainGetCPUStats for lxc driver.

2014-02-03 Thread Thorsten Behrens
--- Notes v3: - moved most of the code out to virCgroupGetPercpuStats, for better testability. - addressed comments from v2 review src/libvirt_private.syms | 1 + src/lxc/lxc_driver.c | 51 src/util/vircgroup.c | 75

[libvirt] [PATCHv3 02/10] Implement domainMemoryStats API slot for LXC driver.

2014-02-03 Thread Thorsten Behrens
--- src/lxc/lxc_driver.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 138c706..02b5cc3 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -5169,6 +5169,55 @@

Re: [libvirt] [PATCHv2 0/6] Add BlkIO and CPU/mem stat API implementations for lxc

2014-01-27 Thread Thorsten Behrens
Hi, sorry for the noise - but I don't see the patch series pushed yet? Gao feng wrote: [...] ACK with these changed. Should I fix the editorial issues resubmit? Cheers, -- Thorsten signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com

[libvirt] [PATCH] Implement lxcDomainBlockStatsFlags for lxc driver

2014-01-21 Thread Thorsten Behrens
--- src/lxc/lxc_driver.c | 124 +++ 1 file changed, 124 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 7fa9612..57d8fcb 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -77,6 +77,8 @@ #define

[libvirt] [PATCHv2 0/6] Add BlkIO and CPU/mem stat API implementations for lxc

2014-01-20 Thread Thorsten Behrens
domains's block io'. Thorsten Behrens (6): Add util virCgroupGetBlkioIo*Serviced methods. Implement domainMemoryStats API slot for LXC driver. Make qemuGetDomainTotalCPUStats a virCgroup function. Implement domainGetCPUStats for lxc driver. Implemet lxcDomainBlockStats for lxc driver

Re: [libvirt] [PATCH 1/6] Add util virCgroupGetBlkioIo*Serviced methods.

2014-01-20 Thread Thorsten Behrens
Gao feng wrote: +virCgroupGetBlkioIoServiced(virCgroupPtr group, +long long *bytes_read, +long long *bytes_write, +long long *requests_read, +long long *requests_write) +{

[libvirt] [PATCHv2 5/6] Implemet lxcDomainBlockStats for lxc driver

2014-01-20 Thread Thorsten Behrens
--- Notes on v2: - works as-is, will send lxcDomainBlockStatsFlags patch separately src/lxc/lxc_driver.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 19426f5..bf6fd5c 100644 ---

[libvirt] [PATCHv2 2/6] Implement domainMemoryStats API slot for LXC driver.

2014-01-20 Thread Thorsten Behrens
--- Notes on v2: - check if domain is running, fixed ret val calculation - api slot comment is now referencing 1.2.2 src/lxc/lxc_driver.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index

[libvirt] [PATCHv2 3/6] Make qemuGetDomainTotalCPUStats a virCgroup function.

2014-01-20 Thread Thorsten Behrens
To reuse this from other drivers, like lxc. --- Notes on v2: - renamed to proper camel case: virCgroupGetDomainTotalCpuStats src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 54 ++-- src/util/vircgroup.c | 53

[libvirt] [PATCHv2 1/6] Add util virCgroupGetBlkioIo*Serviced methods.

2014-01-20 Thread Thorsten Behrens
This reads blkio stats from blkio.throttle.io_service_bytes and blkio.throttle.io_serviced. --- Notes v2: - loop over all devices in io_service_bytes / io_serviced files - report value_names in error message - adds overflow checks to summation - moved loop invariants out for

[libvirt] [PATCHv2 4/6] Implement domainGetCPUStats for lxc driver.

2014-01-20 Thread Thorsten Behrens
--- Notes on v2: - elided extra memset and leftover loop var n - api slot comment references 1.2.2 now src/lxc/lxc_driver.c | 128 +++ 1 file changed, 128 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index

[libvirt] [PATCHv2 6/6] Widening API change - accept empty path for virDomainBlockStats

2014-01-20 Thread Thorsten Behrens
And provide domain summary stat in that case, for lxc backend. Use case is a container inheriting all devices from the host, e.g. when doing application containerization. --- Notes on v2: - adapted virDomainBlockStats docs - adapted virsh domblkstat docs - made virsh actually accept empty disk

[libvirt] [PATCH 1/2] Make syntax check notice assignments w/o surrounding spaces.

2014-01-20 Thread Thorsten Behrens
--- build-aux/bracket-spacing.pl | 8 1 file changed, 8 insertions(+) diff --git a/build-aux/bracket-spacing.pl b/build-aux/bracket-spacing.pl index 802a640..fd7438e 100755 --- a/build-aux/bracket-spacing.pl +++ b/build-aux/bracket-spacing.pl @@ -144,6 +144,14 @@ foreach my $file

[libvirt] [PATCH 2/2] maint: align whitespace with project conventions.

2014-01-20 Thread Thorsten Behrens
--- examples/object-events/event-test.c | 20 +-- src/conf/nwfilter_conf.c| 72 ++--- src/esx/esx_vi.c| 2 +- src/libvirt.c | 2 +- src/nwfilter/nwfilter_learnipaddr.c | 2 +- src/openvz/openvz_conf.c

[libvirt] [PATCH 0/2] Improve whitespace syntax checks

2014-01-20 Thread Thorsten Behrens
Check for whitespace around assignments / compount assignment operators. Fix syntax-check fallout in PATCH 2/2. Thorsten Behrens (2): Make syntax check notice assignments w/o surrounding spaces. maint: align whitespace with project conventions. build-aux/bracket-spacing.pl| 8

[libvirt] [PATCHv3] Add util virCgroupGetBlkioIo*Serviced methods.

2014-01-20 Thread Thorsten Behrens
This reads blkio stats from blkio.throttle.io_service_bytes and blkio.throttle.io_serviced. --- Note on v3: - rebased to current master, sadly the virCgroupSetBlkioDeviceReadBps etc conflicted src/libvirt_private.syms | 2 + src/util/vircgroup.c | 242

[libvirt] [PATCH 0/6] Add BlkIO and CPU/mem stat API implementations for lxc

2014-01-14 Thread Thorsten Behrens
for the entire domains's block io'. Thorsten Behrens (6): Add util virCgroupGetBlkioIo*Serviced methods. Implement domainMemoryStats API slot for LXC driver. Make qemuGetDomainTotalCPUStats a virCgroup function. Implement domainGetCPUStats for lxc driver. Implemet lxcDomainBlockStats

[libvirt] [PATCH 2/6] Implement domainMemoryStats API slot for LXC driver.

2014-01-14 Thread Thorsten Behrens
--- src/lxc/lxc_driver.c | 52 1 file changed, 52 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 7e56a59..9f586af 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -4554,6 +4554,57 @@

[libvirt] [PATCH 1/6] Add util virCgroupGetBlkioIo*Serviced methods.

2014-01-14 Thread Thorsten Behrens
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

[libvirt] [PATCH 3/6] Make qemuGetDomainTotalCPUStats a virCgroup function.

2014-01-14 Thread Thorsten Behrens
To reuse this from other drivers, like lxc. --- src/libvirt_private.syms | 1 + src/qemu/qemu_driver.c | 54 ++-- src/util/vircgroup.c | 53 +++ src/util/vircgroup.h | 5 + 4 files changed, 61

[libvirt] [PATCH 6/6] Widening API change - accept empty path for virDomainBlockStats

2014-01-14 Thread Thorsten Behrens
And provide domain summary stats in that case, for lxc backend. Use case is a container domain using passthrough bind mounts of the host filesystem, which is a common case for lxc. --- src/libvirt.c | 1 - src/lxc/lxc_driver.c | 10 ++ src/qemu/qemu_driver.c | 2

[libvirt] [PATCH 4/6] Implement domainGetCPUStats for lxc driver.

2014-01-14 Thread Thorsten Behrens
--- src/lxc/lxc_driver.c | 132 +++ 1 file changed, 132 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 9f586af..1e9c77a 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -75,6 +75,8 @@ #define

[libvirt] [PATCH 5/6] Implemet lxcDomainBlockStats for lxc driver

2014-01-14 Thread Thorsten Behrens
--- src/lxc/lxc_driver.c | 51 +++ 1 file changed, 51 insertions(+) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 1e9c77a..1d2a457 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -2021,6 +2021,56 @@