Based on the feedback from version 1 [1], we can't put cross
directory dependencies in the utils files, but ATM we have no
good spot to put common driver code as well.
The solution then was to add a new directory structure, as proposed in
[2], to put the common cgroup and driver code between LXC and QEMU
into.
changes from v1:
- introduced src/hypervisor/domain_cgroup.c/h. Cgroup duplicated
code that depends on /conf includes now goes to this file
- introduced src/hypervisor/domain_driver.c/h. Common driver
code now goes to this file instead of putting more stuff in
domain_conf.c
[1]
https://www.redhat.com/archives/libvir-list/2020-February/msg00425.html
[2]
https://www.redhat.com/archives/libvir-list/2019-December/msg00817.html
Daniel Henrique Barboza (14):
vircgroup.c: adding virCgroupSetupBlkioDevice* helpers
lxc,qemu: use virCgroupSetupBlkioDevice* helpers
vircgroup.c: turn virCgroup{Get/Set}BlkioDevice* into static
src: introducing hypervisor/domain_cgroup.c
domain_cgroup.c: add virDomainCgroupSetupMemtune()
vircgroup.c: add virCgroupSetupCpusetCpus()
vircgroup.c: add virCgroupSetupCpuShares()
vircgroup.c: add virCgroupSetupCpuPeriodQuota()
src/hypervisor: introduce domain_driver.c
domain_driver.c: add virDomainDriverParseBlkioDeviceStr()
domain_cgroup.c: add virDomainCgroupSetupDomainBlkioParameters()
domain_driver.c: add virDomainDriverSetupPersistentDefBlkioParams()
domain_cgroup.c: add virDomainCgroupSetMemoryLimitParameters()
vircgroup: add virCgroupGetCpuPeriodQuota()
po/POTFILES.in | 2 +
src/Makefile.am | 1 +
src/hypervisor/Makefile.inc.am | 16 ++
src/hypervisor/domain_cgroup.c | 268 ++++++++++++++++++++
src/hypervisor/domain_cgroup.h | 38 +++
src/hypervisor/domain_driver.c | 252 +++++++++++++++++++
src/hypervisor/domain_driver.h | 36 +++
src/libvirt_private.syms | 32 ++-
src/lxc/Makefile.inc.am | 2 +
src/lxc/lxc_cgroup.c | 91 +------
src/lxc/lxc_driver.c | 430 ++-------------------------------
src/qemu/Makefile.inc.am | 1 +
src/qemu/qemu_cgroup.c | 112 +--------
src/qemu/qemu_driver.c | 401 +-----------------------------
src/util/vircgroup.c | 212 ++++++++++++++--
src/util/vircgroup.h | 53 ++--
16 files changed, 894 insertions(+), 1053 deletions(-)
create mode 100644 src/hypervisor/Makefile.inc.am
create mode 100644 src/hypervisor/domain_cgroup.c
create mode 100644 src/hypervisor/domain_cgroup.h
create mode 100644 src/hypervisor/domain_driver.c
create mode 100644 src/hypervisor/domain_driver.h
--
2.24.1