Skip to content

Couple of qemu-pr-helper fixes

Michal Privoznik qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2qemu-pr-helper: Daemonize before dropping privilegesscsi/qemu-pr-helper.c+7 -70 replies
2/2qemu-pr-helper: Write pidfile more oftenscsi/qemu-pr-helper.c+5 -10 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFam Zheng
SeriesR-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] Couple of qemu-pr-helper fixes

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(-)
Signature · 1 line
2.16.1