[libvirt] PATCH: Allow specific FDs to be kept open in virExec()

Jim Meyering jim at meyering.net
Fri Aug 22 17:34:41 UTC 2008


"Daniel P. Berrange" <berrange at redhat.com> wrote:

> With my recent patches to virExec(), all FDs except stdin/out/err are closed
> before the child is exec'd to prevent accidental leaks. Of course I forgot
> the one key place where we need to propagate FDs... The TAP devices passed
> to QEMU.
>
> This patch adds a 'keepfd' parameter to virExec() which allows the caller
> to specify a bitset of file descriptors to keep open, and updates the
> callers to use this as required. The QEMU driver specifies any TAP fds
> and the LXC driver specifies its PTY this way removing a previous hack.

This all looks fine, assuming you're adjusting it to use the
standard "fd_set" type.




More information about the libvir-list mailing list