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

Richard W.M. Jones rjones at redhat.com
Fri Aug 22 08:22:06 UTC 2008


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 VIR_EXEC_FDSET_OFF(set, fd) (set[(fd)/8] &= ~(1 << ((fd)%8)))
> +#define VIR_EXEC_FDSET_ISON(set, fd) (set[(fd)/8] & (1 << ((fd)%8)))

+1 although I'm interested to know why you didn't just use ordinary
FD_SETs for this.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/




More information about the libvir-list mailing list