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

2008-08-27 Thread Richard W.M. Jones
On Tue, Aug 26, 2008 at 10:41:18AM +0100, Daniel P. Berrange wrote: On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange 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

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

2008-08-27 Thread Daniel P. Berrange
On Wed, Aug 27, 2008 at 10:21:44AM +0100, Richard W.M. Jones wrote: On Tue, Aug 26, 2008 at 10:41:18AM +0100, Daniel P. Berrange wrote: On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: With my recent patches to virExec(), all FDs except stdin/out/err are closed

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

2008-08-26 Thread Daniel P. Berrange
On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange 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

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

2008-08-22 Thread Richard W.M. Jones
On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: +#define VIR_EXEC_FDSET_SIZE() (sysconf(_SC_OPEN_MAX)/8) +#define VIR_EXEC_FDSET_CLEAR(set) memset((set), 0, VIR_EXEC_FDSET_SIZE()) +#define VIR_EXEC_FDSET_ON(set, fd) (set[(fd)/8] |= (1 ((fd)%8))) +#define

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

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 09:22:06AM +0100, Richard W.M. Jones wrote: On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: +#define VIR_EXEC_FDSET_SIZE() (sysconf(_SC_OPEN_MAX)/8) +#define VIR_EXEC_FDSET_CLEAR(set) memset((set), 0, VIR_EXEC_FDSET_SIZE()) +#define

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

2008-08-22 Thread Daniel P. Berrange
On Fri, Aug 22, 2008 at 10:51:54AM +0200, Jim Meyering wrote: Daniel P. Berrange [EMAIL PROTECTED] wrote: On Fri, Aug 22, 2008 at 09:22:06AM +0100, Richard W.M. Jones wrote: On Thu, Aug 21, 2008 at 02:58:30PM +0100, Daniel P. Berrange wrote: +#define VIR_EXEC_FDSET_SIZE()

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

2008-08-22 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] 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

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

2008-08-21 Thread Daniel P. Berrange
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