[libvirt] libvirt API/design questions

Ján Tomko jtomko at redhat.com
Thu Dec 12 14:57:11 UTC 2019


On Wed, Dec 11, 2019 at 09:45:07AM -0500, Cole Robinson wrote:
>* Splitting domain_conf up. There's 30k lines in domain_conf.c and 3500
>in domain_conf.h, it would be nice to unwind it a bit. Getting some sign
>off on this ahead of time is critical IMO so pieces can be posted and
>committed quickly because they will obviously go out of date fast.

Oh yes, so fast I did not even keep the branch for this failed attempt:
https://www.redhat.com/archives/libvir-list/2019-July/msg01257.html

Jano

>My thoughts:
>
>- domain_def.[ch]: DomainDefXXX and enum definitions.
>  - probably New and Free functions too
>- domain_parse.[ch]: XML parsing
>- domain_format.[ch]: XML formatting
>- domain_validate.[ch]: validate and postparse handling
>- domain_util.[ch]: everything else, or keep it in domain_conf?
>
>domain_def should be easy but no idea how intertwined the rest are. If
>the domain_validate naming is acceptable for both validate and postparse
>functions, we could use that naming for qemu_domain.c split too.
>
>Also maybe it's worth considering if there's some way to sensibly split
>the conf/ directory. We could add a top level domain/ directory, but
>that's kinda ambiguously named as we already have network/ + storage/ +
>secret/ etc that have different meanings. Maybe sub dirs like
>conf/domain/ ? I'm curious if anyone has strong feelings either way.
>There's not really a clear place to dump shared DomainDef code at the
>moment, like possible domain_cgroup for sharing cgroup handling across
>lxc + qemu
>
>Thanks,
>Cole
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- 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/20191212/bb5b9174/attachment-0001.sig>


More information about the libvir-list mailing list