On Thu, Mar 01, 2018 at 04:42:36PM -0700, Jim Fehlig wrote:
Locks held by virtlockd are dropped on re-exec.
virtlockd 94306 POSIX 5.4G WRITE 0 0 0 /tmp/test.qcow2
virtlockd 94306 POSIX 5B WRITE 0 0 0 /run/virtlockd.pid
virtlockd 94306 POSIX 5B WRITE 0 0 0 /run/virtlockd.pid
Acquire locks in PostExecRestart code path.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
The CLOEXEC flag is set in virLockSpaceNewPostExecRestart(), so I assume
it is fine to call virFileLock() here as well.
I'm not that familiar with the internals of virtlockd, but I can't think
of what commands would the daemon run. So can't we just keep the fd's
without O_CLOEXEC? If not, then we could at least remove the flag
before re-exec (in PreExec) and then set it again back after (in
PostExec). But more opinions might be better.
Martin