mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-31 10:23:09 +00:00
f1704e61c3
There is duplicated code between virt drivers that needs to be moved to avoid code repetition. In the case of duplicated code between lxc_cgroup.c and qemu_cgroup.c a common place would be utils/vircgroup.c. The problem is that this would introduce /conf related definitions that shouldn't be imported to vircgroup.c, which is supposed to be a place for utilitary cgroups functions only. And syntax-check would forbid it anyway due to cross-directory includes being used. An alternative would be to overload domain_conf.c, which already contains all the definitions required. But that file is already crowded with XML handling code and we wouldn't do any favors to it by putting more utilitary, non-XML parsing/formatting code there. In [1], Cole suggested a 'domain_cgroup' file to host common code between lxc_cgroup and qemu_cgroup, and Daniel suggested a 'src/hypervisor' dir to host these type of files. This patch introduces src/hypervisor/domain_cgroup.c and, to get started, introduces a new virDomainCgroupSetupBlkio() function to host shared code between virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup(). [1] https://www.redhat.com/archives/libvir-list/2019-December/msg00817.html Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com> Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
15 lines
344 B
Makefile
15 lines
344 B
Makefile
# vim: filetype=automake
|
|
|
|
HYPERVISOR_SOURCES = \
|
|
hypervisor/domain_cgroup.h \
|
|
hypervisor/domain_cgroup.c \
|
|
$(NULL)
|
|
|
|
noinst_LTLIBRARIES += libvirt_hypervisor.la
|
|
libvirt_la_BUILT_LIBADD += libvirt_hypervisor.la
|
|
libvirt_hypervisor_la_CFLAGS = \
|
|
-I$(srcdir)/conf \
|
|
$(AM_CFLAGS) \
|
|
$(NULL)
|
|
libvirt_hypervisor_la_SOURCES = $(HYPERVISOR_SOURCES)
|