Avi Kivity wrote: > On 11/05/2009 07:16 PM, Scott Tsai wrote: > >On Fri, Nov 6, 2009 at 12:50 AM, Anthony Liguori<aligu...@us.ibm.com> > >wrote: > > > >>It's just a bit annoying to create an entire new > >>project for a few hundred line helper. > >> > >This new project would also be a better place for 'tunctl' and other > >projects such as user mode linux might want to use your new helper > >program. > > > > Seems like a library implemented as executables instead of a shared object.
Yes. It's an executable because it needs setuid to do privileged things... It could be provided as a shared object (which calls an executable if it needs setuiding), but then for some things you'd have to provide an option like -net helper=/path/to/my/helper.so, and you might not want the implied fixed ABI, and it'd be harder to use scripts. After all we don't have -net script=/path/to/my/upscript.so,downscript=/path/to/my/downscript.so do we? ;-) Spawning an executable is really fast in Linux. For something which is only called a few times at most when the program starts or is rarely reconfigured, I don't see any reason not to call an executable. -- Jamie