Re: [libvirt] [PATCHv2] command: avoid fd leak on failure

2011-07-15 Thread Eric Blake
On 07/14/2011 11:04 AM, Eric Blake wrote: virCommandTransferFD promises that the fd is no longer owned by the caller. Normally, we want the fd to remain open until the child runs, but in error situations, we must close it earlier. To avoid any risks of double-close due to misunderstanding about

Re: [libvirt] [PATCHv2] command: avoid fd leak on failure

2011-07-15 Thread Eric Blake
On 07/14/2011 11:04 AM, Eric Blake wrote: virCommandTransferFD promises that the fd is no longer owned by the caller. Normally, we want the fd to remain open until the child runs, but in error situations, we must close it earlier. To avoid any risks of double-close due to misunderstanding about

[libvirt] [PATCHv2] command: avoid fd leak on failure

2011-07-14 Thread Eric Blake
virCommandTransferFD promises that the fd is no longer owned by the caller. Normally, we want the fd to remain open until the child runs, but in error situations, we must close it earlier. To avoid any risks of double-close due to misunderstanding about this interface, change it to take a pointer