All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>,
	"open list:Block layer core" <qemu-block@nongnu.org>,
	Kevin Wolf <kwolf@redhat.com>, Hannes Reinecke <hare@suse.de>,
	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 09:18:38 -0500	[thread overview]
Message-ID: <20260128141838.GA111862@fedora> (raw)
In-Reply-To: <CABgObfZetG0O5oX+pHCAaPXwaPreWn2NSXuWpJUBdaqdL=a4-w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2106 bytes --]

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.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-01-28 14:19 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 [this message]
2026-01-28 15:30     ` Hannes Reinecke
2026-01-28 16:13       ` Stefan Hajnoczi
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=20260128141838.GA111862@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.