On 2/10/20 10:39 PM, Ján Tomko wrote:
> On Mon, Feb 10, 2020 at 07:05:07PM -0300, Daniel Henrique Barboza wrote:
>> This new util function puts the duplicated code from
>> qemu_cgroup.c:qemuSetupBlkioCgroup() and
>> lxc_cgroup.c:virLXCCgroupSetupBlkioTune() in a single
>> function to be used in both places.
>>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
>> ---
>> src/libvirt_private.syms | 1 +
>> src/lxc/lxc_cgroup.c | 49 +----------------------------------
>> src/qemu/qemu_cgroup.c | 47 +---------------------------------
>> src/util/vircgroup.c | 55 ++++++++++++++++++++++++++++++++++++++++
>> src/util/vircgroup.h | 3 +++
>> 5 files changed, 61 insertions(+), 94 deletions(-)
>>
>> diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
>> index 0680ff7c24..0d83e2094f 100644
>> --- a/src/util/vircgroup.c
>> +++ b/src/util/vircgroup.c
>> @@ -35,6 +35,7 @@
>> #define LIBVIRT_VIRCGROUPPRIV_H_ALLOW
>> #include "vircgrouppriv.h"
>>
>> +#include "conf/domain_conf.h"
>> #include "virutil.h"
>> #include "viralloc.h"
>> #include "vircgroupbackend.h"
>> diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
>> index 15263f534a..d2d7e7ab51 100644
>> --- a/src/util/vircgroup.h
>> +++ b/src/util/vircgroup.h
>> @@ -24,6 +24,7 @@
>> #include "virutil.h"
>> #include "virbitmap.h"
>> #include "virenum.h"
>> +#include "conf/virconftypes.h"
>>
>
> src/util should be below src/conf and not including stuff from it
> (even though we do have some debt there at the moment)
>
> The last time this came up:
>
https://www.redhat.com/archives/libvir-list/2018-June/msg00381.html
>
> And there should've been a syntax-check rule yelling about this,
> but I see the out-of-srcdir build broke it:
>
https://www.redhat.com/archives/libvir-list/2020-February/msg00442.html
Just saw that you fixed this check on newest master. syntax-check is not
pleased with these patches anymore.
I'll send a v2.
I asked about this case in December, danpb suggested creating a new
src/hypervisor/ directory for containing shared driver code like this: