<div dir="ltr">Hi,<div><br></div><div style>I was initially working with libvirt, but all I was doing was calling out to lxc so I decided to ditch libvirt and work directly with LXC since the current libvirt is a bit buggy for me. To that end, I have been playing with and studying LXC, and I have a question. I was wondering why liblxc is designed to call a lot of command-line utilities using system(), instead of the other way around. AFAIK, it is more correct to put standard functionality in a standard library and then write code which uses the library-exposed APIs. IMHO, liblxc should directly hit the Linux kernel APIs, and the lxc-* command line utilities should dlopen() liblxc.so.</div>
<div style><br></div><div style>Not being able to statically link everything needed to run LXC containers into one binaryanlong with my program code is a real showstopper for me - I need to be able to boot Linux from flash, run my master process in place of init, and spawn hundreds if not thousands of threads, each with its own virtual networking setup. I am reluctant to dissect the lxc-* command line utility code and import it into my codebase for reasons of maintainability. Am I missing something somewhere? Has anyone else here ever used LXC containers in an embedded environment?</div>
<div style><br></div><div style>Jon</div><div style><br></div></div>