[PATCH v2 09/14] src/hypervisor: introduce domain_driver.c

Ján Tomko jtomko at redhat.com
Sun Feb 23 12:43:38 UTC 2020


On Mon, Feb 17, 2020 at 04:29:16PM -0500, Daniel Henrique Barboza wrote:
>lxcDomainMergeBlkioDevice() and qemuDomainMergeBlkioDevice()
>are the same functions. This duplicated code can't be put in
>the existing domain_cgroup.c since it's not cgroup related.
>
>This patch introduces a new src/hypervisor/domain_driver.c to
>host this more generic code that can be shared between virt
>drivers. This new file is then used to create a new helper
>called virDomainDeivceMergeBlkioDevice() to eliminate the code
>repetition mentioned above. Callers in LXC and QEMU files
>were updated.
>
>This change is a preliminary step for more code reduction of
>cgroup related code inside lxcDomainSetBlkioParameters() and
>qemuDomainSetBlkioParameters().
>
>Signed-off-by: Daniel Henrique Barboza <danielhb413 at gmail.com>
>---
> src/hypervisor/Makefile.inc.am |  2 +
> src/hypervisor/domain_driver.c | 96 ++++++++++++++++++++++++++++++++++
> src/hypervisor/domain_driver.h | 29 ++++++++++
> src/libvirt_private.syms       |  4 ++
> src/lxc/lxc_driver.c           | 84 ++++-------------------------
> src/qemu/qemu_driver.c         | 83 ++++-------------------------
> 6 files changed, 149 insertions(+), 149 deletions(-)
> create mode 100644 src/hypervisor/domain_driver.c
> create mode 100644 src/hypervisor/domain_driver.h
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200223/a507c268/attachment-0001.sig>


More information about the libvir-list mailing list