Hi, This series is posted for early review. This series refactors virCgroup. The changes are: - virCgroupItem is associated with a cgroup directory. The directory is created only when needed, and removed if no one is using it. - Anyone using cgroups creates instances of virCgroupItem and maintains their lifetime. Please focus on patch #5, which brings the main change(virCgroupItem), and qemu part in patch #6, which shows the usage of virCgroupItem(I've not tested lxc part yet). Hu Tao (7): call virstateCleanup to do the cleanup before libvirtd exits include util.h in cgroup.h include virterror_internal.h in threads.h refactor virCgroupDetectMounts and virCgroupDetectPlacement cgroup: refactor virCgroup deploy the newly introduced virCgroupItem. tests for virCgroup. daemon/libvirtd.c | 6 + src/conf/domain_audit.c | 16 +- src/conf/domain_audit.h | 6 +- src/conf/domain_conf.h | 5 + src/libvirt_private.syms | 17 +- src/lxc/lxc_cgroup.c | 91 ++- src/lxc/lxc_conf.h | 2 +- src/lxc/lxc_driver.c | 268 +++----- src/lxc/lxc_process.c | 56 +- src/qemu/qemu_cgroup.c | 287 +++------ src/qemu/qemu_cgroup.h | 17 +- src/qemu/qemu_conf.h | 2 +- src/qemu/qemu_driver.c | 478 +++++--------- src/qemu/qemu_hotplug.c | 44 +- src/qemu/qemu_migration.c | 36 +- src/qemu/qemu_process.c | 29 +- src/util/vircgroup.c | 1570 ++++++++++++++++++++------------------------- src/util/vircgroup.h | 108 ++-- src/util/virthread.h | 1 + tests/Makefile.am | 5 + tests/vircgrouptest.c | 103 +++ 21 files changed, 1338 insertions(+), 1809 deletions(-) create mode 100644 tests/vircgrouptest.c -- 1.8.0.1.240.ge8a1f5a -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list