Re: [Qemu-devel] [Qemu-trivial] [PATCH] keep the PID file locked for the lifetime of the process

2012-01-27 Thread Daniel P. Berrange
On Fri, Jan 27, 2012 at 06:36:39AM +, Stefan Hajnoczi wrote: > On Thu, Jan 26, 2012 at 10:36:41PM +0100, Laszlo Ersek wrote: > > The lockf() call in qemu_create_pidfile() aims at ensuring mutual > > exclusion. We shouldn't close the pidfile on success, because that drops > > the lock as well [1

Re: [Qemu-devel] [Qemu-trivial] [PATCH] keep the PID file locked for the lifetime of the process

2012-01-27 Thread Laszlo Ersek
On 01/27/12 07:36, Stefan Hajnoczi wrote: On Thu, Jan 26, 2012 at 10:36:41PM +0100, Laszlo Ersek wrote: The lockf() call in qemu_create_pidfile() aims at ensuring mutual exclusion. We shouldn't close the pidfile on success, because that drops the lock as well [1]: "File locks shall be rele

Re: [Qemu-devel] [Qemu-trivial] [PATCH] keep the PID file locked for the lifetime of the process

2012-01-26 Thread Stefan Hajnoczi
On Thu, Jan 26, 2012 at 10:36:41PM +0100, Laszlo Ersek wrote: > The lockf() call in qemu_create_pidfile() aims at ensuring mutual > exclusion. We shouldn't close the pidfile on success, because that drops > the lock as well [1]: > > "File locks shall be released on first close by the locking p