This patch series is superseded by
https://www.redhat.com/archives/libvir-list/2016-June/msg00065.html
which is more simple.
On 02.06.2016 14:24, Nikolay Shirokovskiy wrote:
Current stats cache uses same lock as domain cache, namely lock
of virDomainObjPtr. First this is not necessary, domain cache is
used to translate id of object of interest from libvirt to vzsdk
one. Besides this domain object is not used. Second this is risky
game as lock is dropped on waiting for stat events from sdk deep
down on stack so callers throughout the stack should be written
very carefully.
This patch series makes stats cache self locking and thus making
code much more solid. This is done thru introducing extra lock for
stats cache. Statistics API functions first use domain cache then
drop domain lock, query stats cache and unreference domain object.
Patches 1-4 conform API functions to this structure. Patches 5-7
makes subsidiary improvments. Patch 8 finally introduce new lock.
Last patches are cleanup[9] and bugfix[10].
Nikolay Shirokovskiy (10):
vz: pass string instead of disk definition to block stat function
vz: prepare disks names before getting all disks stats
vz: move getting stats in vzDomainGetVcpus to the end
vz: move getting stats in vzDomainGetInfo to the end
vz: use consistent naming for different domain object in vz_driver.c
vz: simplify refcount on sdkdom in prlsdkLoadDomain
vz: hold stats cache in a pointer in vzDomObj
vz: introduce stats cache lock
vz: extract on stats cache update into a function
vz: fix many stat request issue
src/vz/vz_driver.c | 397 +++++++++++++++++++++++++++++++++++------------------
src/vz/vz_sdk.c | 230 +++++++++++++++++++++----------
src/vz/vz_sdk.h | 15 +-
src/vz/vz_utils.c | 9 --
src/vz/vz_utils.h | 6 +-
5 files changed, 438 insertions(+), 219 deletions(-)