All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Couple of qemu-pr-helper fixes
@ 2018-04-03 13:12 Michal Privoznik
  2018-04-03 13:12 ` [Qemu-devel] [PATCH 1/2] qemu-pr-helper: Daemonize before dropping privileges Michal Privoznik
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Privoznik @ 2018-04-03 13:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, famz

The first one is trivial.

The second is slightly trickier. Libvirt has this virCommand subsystem
(found under src/util/vircommand.c) which it uses to spawn commands. The
subsystem allows libvirt to both daemonize a process and learn its PID.
The latter of course does not work if command daemonizes itself (hence
libvirt will not use qemu-pr-helper --daemon). BUT, we still need
qemu-pr-helper to lock the pidfile (so that when libvirt tries to lock
it it is denied). NB, libvirt uses fnctl(cmd = F_SETLK) to lock
pidfiles. So leaking locked FD into qemu-pr-helper is not an option
because that doesn't survive fork().

Another, trivial reason might be that if I run:

  qemu-pr-helper --pidfile /tmp/pr.pid

(without --daemon), I'd still expect qemu-pr-helper to write pidfile
because I told it to.

Michal Privoznik (2):
  qemu-pr-helper: Daemonize before dropping privileges
  qemu-pr-helper: Write pidfile more often

 scsi/qemu-pr-helper.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

-- 
2.16.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-04  2:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-03 13:12 [Qemu-devel] [PATCH 0/2] Couple of qemu-pr-helper fixes Michal Privoznik
2018-04-03 13:12 ` [Qemu-devel] [PATCH 1/2] qemu-pr-helper: Daemonize before dropping privileges Michal Privoznik
2018-04-03 13:12 ` [Qemu-devel] [PATCH 2/2] qemu-pr-helper: Write pidfile more often Michal Privoznik
2018-04-04  2:00 ` [Qemu-devel] [PATCH 0/2] Couple of qemu-pr-helper fixes Fam Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.