From: Stefan Hajnoczi <stefanha@redhat.com>
To: Hannes Reinecke <hare@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Benjamin Marzinski <bmarzins@redhat.com>,
"open list:Block layer core" <qemu-block@nongnu.org>,
Kevin Wolf <kwolf@redhat.com>, Alberto Faria <afaria@redhat.com>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: Moving from qemu-pr-helper and libmpathpersist to <linux/pr.h>
Date: Wed, 28 Jan 2026 11:13:04 -0500 [thread overview]
Message-ID: <20260128161304.GA120658@fedora> (raw)
In-Reply-To: <2fff54ca-00c4-4483-ac1d-2c47b0f8c683@suse.de>
[-- Attachment #1: Type: text/plain, Size: 2850 bytes --]
On Wed, Jan 28, 2026 at 04:30:51PM +0100, Hannes Reinecke wrote:
> On 1/28/26 15:18, Stefan Hajnoczi wrote:
> > On Tue, Jan 27, 2026 at 08:45:39PM +0100, Paolo Bonzini wrote:
> > > Il mar 27 gen 2026, 19:47 Stefan Hajnoczi <stefanha@redhat.com> ha scritto:
> > >
> > > > Several of us have pondered a different approach that I will summarize
> > > > here. The <linux/pr.h> ioctl interface provides an alternative to
> > > > ioctl(SG_IO) without the CAP_SYS_RAWIO requirement. It supports both
> > > > SCSI and NVMe. Since privileges are not required, there would be no need
> > > > for the qemu-pr-helper daemon anymore.
> > > >
> > >
> > > Yes, no problem with that. It's easy to extend QEMU with a new pr-manager
> > > subclass that converts SCSI commands to PR ioctls.
> >
> > Yes. It will be possible to go further than that in the future:
> >
> > Alberto has been working on QEMU block layer API support for persistent
> > reservations. When that becomes available, SCSI command parsing can
> > happen entirely within hw/scsi/scsi-disk.c for scsi-block and scsi-disk.
> > file-posix.c will then implement the new BlockDriver PR APIs via
> > <linux/pr.h> ioctls and other block drivers can implement them in
> > protocol-specific ways (e.g. iSCSI).
> >
> > > My suggestion is to implement <linux/pr.h> via upcalls from DM-Multipath
> > > > to multipathd. That way applications like QEMU can consistently use
> > > > <linux/pr.h> across block device types and no longer have to go through
> > > > the privileged libmpathpersist interface.
> > > >
> > >
> > > What do you have in mind for the upcall protocol? Does it need to be done
> > > with multipathd or can it be a separate daemon for privilege separation? I
> > > am not sure if there is any channel between dm-mpath and multipathd that
> > > can be extended (I think it only uses uevent?); maybe it would make sense
> > > to reuse qemu-pr-helper's protocol even.
> >
> > I don't have a strong opinion on the protocol. My thought was to do a
> > traditional upcall with call_usermodehelper() with an execve argv/envp
> > protocol. That way there is no need to register a file descriptor. The
> > downside is that this approach is less efficient and more likely to fail
> > when the host is under memory pressure, but PR operations are not that
> > frequent.
> >
> gnaa. call_usermodehelper() is _evil_. It might be executed with any
> arbitrary fs context, and you better hope the executable is present
> there ...
>
> Maybe look at the handshake daemon. That's solving a very similar issue
> which we had for TLS.
Netlink is the most complex approach. I had a hard to understanding what
was going from looking at drivers/nvme/host/ and net/handshake/. But if
netlink is the way to do this, I'm sure it can be done.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2026-01-28 19:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 18:47 Moving from qemu-pr-helper and libmpathpersist to <linux/pr.h> Stefan Hajnoczi
2026-01-27 19:45 ` Paolo Bonzini
2026-01-28 14:18 ` Stefan Hajnoczi
2026-01-28 15:30 ` Hannes Reinecke
2026-01-28 16:13 ` Stefan Hajnoczi [this message]
2026-01-27 21:06 ` Benjamin Marzinski
2026-02-03 15:09 ` Stefan Hajnoczi
2026-02-03 17:53 ` Benjamin Marzinski
2026-02-03 18:04 ` Stefan Hajnoczi
2026-02-04 13:19 ` Martin Wilck
2026-02-04 18:32 ` Stefan Hajnoczi
2026-02-04 23:57 ` Hannes Reinecke
2026-02-05 1:03 ` Benjamin Marzinski
2026-02-05 10:20 ` Martin Wilck
2026-02-05 11:52 ` Martin Wilck
2026-02-05 12:01 ` Daniel P. Berrangé
2026-02-05 13:39 ` Stefan Hajnoczi
2026-02-06 0:03 ` Hannes Reinecke
2026-02-06 14:08 ` Stefan Hajnoczi
2026-02-09 12:50 ` Hannes Reinecke
2026-02-09 14:23 ` Stefan Hajnoczi
2026-02-10 10:23 ` Martin Wilck
2026-02-10 13:59 ` Stefan Hajnoczi
2026-02-10 14:29 ` Martin Wilck
2026-02-05 14:28 ` Stefan Hajnoczi
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=20260128161304.GA120658@fedora \
--to=stefanha@redhat.com \
--cc=afaria@redhat.com \
--cc=bmarzins@redhat.com \
--cc=hare@suse.de \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--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 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.