qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: qemu-devel@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 0/2] Couple of qemu-pr-helper fixes
Date: Wed, 4 Apr 2018 10:00:40 +0800	[thread overview]
Message-ID: <20180404020040.GH6839@lemon.usersys.redhat.com> (raw)
In-Reply-To: <cover.1522760575.git.mprivozn@redhat.com>

On Tue, 04/03 15:12, Michal Privoznik wrote:
> 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

Reviewed-by: Fam Zheng <famz@redhat.com>

      parent reply	other threads:[~2018-04-04  2:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Fam Zheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180404020040.GH6839@lemon.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).