[libvirt] [PATCH v2] conf: Split virDomainObjList into a separate file

Martin Kletzander mkletzan at redhat.com
Mon Nov 30 10:53:54 UTC 2015


On Fri, Nov 20, 2015 at 02:28:40PM +0100, Michal Privoznik wrote:
>Our domain_conf.* files are big enough. Not only they contain XML
>parsing code, but they served as a storage of all functions whose
>name is virDomain prefixed. This is just wrong as it gathers not
>related functions (and modules) into one big file which is then
>harder to maintain. Split virDomainObjList module into a separate
>file called virdomainobjlist.[ch].
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
>
[...]
>diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h
>index 84cf08f..b7a4c81 100644
>--- a/src/vz/vz_utils.h
>+++ b/src/vz/vz_utils.h
>@@ -27,6 +27,7 @@
>
> # include "driver.h"
> # include "conf/domain_conf.h"
>+# include "conf/virdomainobjlist.h"

I was checking other drivers and this probably needs to be used in most
of them.  Even though I tried checking all drivers, there's a huge mess
in includes, so I only found out that you missed bhyve driver and maybe
lxc, but that probably gets it transitively from some other includes.
The rest looks fine and adding it there would probably be enough, but
the messg got me thinking.  Why don't we have a conf.h that would have
all the conf/*.h files in and so on, when at the end this is all just an
internal stuff we're using.  Or most of harmless includes could be in
internal.h for the sake of simplicity and error-prone behaviour.  It
might be super-bad idea, but I can't think of a reason against that.
And it would clean up buch of files, I guess.  Check, for example,
src/lxc/lxc_driver.c.

Anyway, in the meantime, ACK with the bhyve fixed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151130/7e62d752/attachment-0001.sig>


More information about the libvir-list mailing list