[PATCH v2 0/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

Stefano Garzarella posted 2 patches 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230504092843.62493-1-sgarzare@redhat.com
Maintainers: Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
qapi/block-core.json |  6 ++++-
block/blkio.c        | 53 +++++++++++++++++++++++++++++++++++++++++++-
stubs/monitor.c      |  6 +++++
3 files changed, 63 insertions(+), 2 deletions(-)
[PATCH v2 0/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver
Posted by Stefano Garzarella 12 months ago
v2:
- added patch 01 to use monitor_fd_param() in the blkio module
- use monitor_fd_param() to parse the fd like vhost devices [Stefan]

v1: https://lore.kernel.org/qemu-devel/20230502145050.224615-1-sgarzare@redhat.com/

The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the new
'fd' property. Let's expose this to the user, so the management layer
can pass the file descriptor of an already opened vhost-vdpa character
device. This is useful especially when the device can only be accessed
with certain privileges.

Stefano Garzarella (2):
  stubs/monitor: add monitor_fd_param()
  block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

 qapi/block-core.json |  6 ++++-
 block/blkio.c        | 53 +++++++++++++++++++++++++++++++++++++++++++-
 stubs/monitor.c      |  6 +++++
 3 files changed, 63 insertions(+), 2 deletions(-)

-- 
2.40.1
Re: [PATCH v2 0/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver
Posted by Jonathon Jongsma 11 months, 3 weeks ago
On 5/4/23 4:28 AM, Stefano Garzarella wrote:
> v2:
> - added patch 01 to use monitor_fd_param() in the blkio module
> - use monitor_fd_param() to parse the fd like vhost devices [Stefan]
> 
> v1: https://lore.kernel.org/qemu-devel/20230502145050.224615-1-sgarzare@redhat.com/
> 
> The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the new
> 'fd' property. Let's expose this to the user, so the management layer
> can pass the file descriptor of an already opened vhost-vdpa character
> device. This is useful especially when the device can only be accessed
> with certain privileges.
> 
> Stefano Garzarella (2):
>    stubs/monitor: add monitor_fd_param()
>    block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver
> 
>   qapi/block-core.json |  6 ++++-
>   block/blkio.c        | 53 +++++++++++++++++++++++++++++++++++++++++++-
>   stubs/monitor.c      |  6 +++++
>   3 files changed, 63 insertions(+), 2 deletions(-)
> 


I mentioned this briefly off-list, but I'm following up here just to 
provide a bit more visibility. From libvirt's point of view, it is 
actually much easier if we could pass the fd via the existing 'path' 
parameter (using /dev/fdset/N as the path, for example) due to how we 
construct the commandline for qemu. So if I get a vote, I would 
definitely vote for that approach over adding a new 'fd' property.

Thanks,
Jonathon
Re: [PATCH v2 0/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver
Posted by Stefano Garzarella 11 months, 3 weeks ago
On Wed, May 10, 2023 at 6:03 PM Jonathon Jongsma <jjongsma@redhat.com> wrote:
>
> On 5/4/23 4:28 AM, Stefano Garzarella wrote:
> > v2:
> > - added patch 01 to use monitor_fd_param() in the blkio module
> > - use monitor_fd_param() to parse the fd like vhost devices [Stefan]
> >
> > v1: https://lore.kernel.org/qemu-devel/20230502145050.224615-1-sgarzare@redhat.com/
> >
> > The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the new
> > 'fd' property. Let's expose this to the user, so the management layer
> > can pass the file descriptor of an already opened vhost-vdpa character
> > device. This is useful especially when the device can only be accessed
> > with certain privileges.
> >
> > Stefano Garzarella (2):
> >    stubs/monitor: add monitor_fd_param()
> >    block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver
> >
> >   qapi/block-core.json |  6 ++++-
> >   block/blkio.c        | 53 +++++++++++++++++++++++++++++++++++++++++++-
> >   stubs/monitor.c      |  6 +++++
> >   3 files changed, 63 insertions(+), 2 deletions(-)
> >
>
>
> I mentioned this briefly off-list, but I'm following up here just to
> provide a bit more visibility. From libvirt's point of view, it is
> actually much easier if we could pass the fd via the existing 'path'
> parameter (using /dev/fdset/N as the path, for example) due to how we
> construct the commandline for qemu. So if I get a vote, I would
> definitely vote for that approach over adding a new 'fd' property.

Thanks for pointing that out.
Since libvirt will be the main user of this feature, I think it is
fine to support fd passing via `path`, using qemu_open().

I'll send a v3 with that change.

Thanks,
Stefano