[libvirt] [PATCH 3/4] util: consolidate QEMU and LXC block io related duplicate code

2019-10-29 Thread Mao Zhongyi
Both qemu and lxc drivers have some duplicate code when dealing with cgroups, such as virLXCCgroupSetupBlkioTune() and qemuSetupBlkioCgroup(), duplicate code over 80, so consolidate the same chunk into a separate routine. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src

[libvirt] [PATCH 0/4] consolidate cgroup code that is duplicated between

2019-10-29 Thread Mao Zhongyi
Both QEMU and LXC drivers have some duplicate code when dealing with cgroups, this serials mainly consolidate the same chunk of src/qemu/qemu_cgroup.c and src/lxc/lxc_cgroup.c into src/util/cgroup.c. Mao Zhongyi (4): lxc: remove duplicate header files qemu: remove duplicate header files

[libvirt] [PATCH 2/4] qemu: remove duplicate header files

2019-10-29 Thread Mao Zhongyi
"#include vircgroup.h" appears in both qemu_cgroup.h and qemu_cgroup.c, and qemu_cgroup.c contains qemu_cgroup.h, so remove the duplicate declarations. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/qemu/qemu_cgroup.c | 1 - 1 file changed, 1 deletion(-) diff --git

[libvirt] [PATCH 4/4] util: consolidate QEMU and LXC memory related duplicate code

2019-10-29 Thread Mao Zhongyi
Both qemu and lxc drivers have some duplicate code when dealing with cgroups, such as virLXCCgroupSetupMemTune() and qemuSetupMemoryCgroup(), duplicate code over 80, so consolidate the same chunk into a separate routine. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src

[libvirt] [PATCH 1/4] lxc: remove duplicate header files

2019-10-29 Thread Mao Zhongyi
"#include vircgroup.h" appears in both lxc_cgroup.h and lxc_cgroup.c, and lxc_cgroup.c contains lxc_cgroup.h, so remove the duplicate declarations. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/lxc/lxc_cgroup.c | 1 - 1 file changed, 1 deletion(-) diff --git

[libvirt] [PATCH v2 2/3] conf/network_conf: use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks. Signed-off-by:

[libvirt] [PATCH v2 1/3] conf/domain_conf: use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
alues are implicitly handled as 'false'. In this case, use virStringParseYesNo to handle the conversion and reserve the original logic of not raise an error, so ignore the return value of helper. Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/con

[libvirt] [PATCH v2 0/3] use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
- ignore the return value of virStringParseYesNo. - update the commit message. [Michal Privoznik] p2: - add the Acked-by tag. p3: - pass return value of helper to rc directly. [Michal Privoznik] Mao Zhongyi (3): conf/domain_conf: use virStringParseYesNo helpe

[libvirt] [PATCH v2 3/3] qemu/qemu_migration_params: use virStringParseYesNo helper

2019-10-16 Thread Mao Zhongyi
A function virStringParseYesNo was added to convert string 'yes' to true and 'no' to false, so use this helper to replace 'STREQ(.*, \"yes\")' and 'STREQ(.*, \"no\")' as it allows us to drop several repetitive if-then-else string->bool conversion blocks. Signed-off-by:

[libvirt] [PATCH 2/3] conf/network_conf: use virStringParseYesNo helper

2019-10-15 Thread Mao Zhongyi
Cc: crobi...@redhat.com Cc: berra...@redhat.com Cc: g.sho1...@gmail.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/conf/network_conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 75ec5c

[libvirt] [PATCH 0/3] use virStringParseYesNo helper

2019-10-15 Thread Mao Zhongyi
..@redhat.com Cc: berra...@redhat.com Cc: crobi...@redhat.com Cc: g...@czarc.net Cc: g.sho1...@gmail.com Cc: jdene...@redhat.com Cc: la...@laine.org Cc: mklet...@redhat.com Cc: phrd...@redhat.com Mao Zhongyi (3): conf/domain_conf: use virStringParseYesNo helper conf/network_conf: use virStringP

[libvirt] [PATCH 1/3] conf/domain_conf: use virStringParseYesNo helper

2019-10-15 Thread Mao Zhongyi
g.sho1...@gmail.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/conf/domain_conf.c | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 10d6bf0eea..7420658726 100644 --- a/sr

[libvirt] [PATCH 3/3] qemu/qemu_migration_params: use virStringParseYesNo helper

2019-10-15 Thread Mao Zhongyi
.@redhat.com Cc: g.sho1...@gmail.com Cc: crobi...@redhat.com Signed-off-by: Mao Zhongyi Signed-off-by: Zhang Shengju --- src/qemu/qemu_migration_params.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index