Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-16 Thread Richard W.M. Jones
On Mon, Jan 16, 2023 at 02:35:41PM -0600, Eric Blake wrote: > On Wed, Jan 04, 2023 at 10:51:50PM +, Richard W.M. Jones wrote: > > Here's an updated version which supports read, write, flush, > > write-zeroes, discard and FUA: > > > > https://gitlab.com/rwmjones/nbdkit/-/commits/2023-libblkio/

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-16 Thread Eric Blake
On Wed, Jan 04, 2023 at 10:51:50PM +, Richard W.M. Jones wrote: > Here's an updated version which supports read, write, flush, > write-zeroes, discard and FUA: > > https://gitlab.com/rwmjones/nbdkit/-/commits/2023-libblkio/ ... > PS: Eric: One thing we lack in the NBD space is a standards >

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-16 Thread Stefan Hajnoczi
On Mon, Jan 16, 2023 at 04:45:28PM +0100, Stefano Garzarella wrote: > On Mon, Jan 16, 2023 at 3:46 PM Stefano Garzarella > wrote: > > On Mon, Jan 16, 2023 at 03:39:29PM +0100, Stefano Garzarella wrote: > > >On Wed, Jan 11, 2023 at 04:49:14PM +, Richard W.M. Jones wrote: > > >>On Wed, Jan 11,

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-16 Thread Stefano Garzarella
On Mon, Jan 16, 2023 at 3:46 PM Stefano Garzarella wrote: > On Mon, Jan 16, 2023 at 03:39:29PM +0100, Stefano Garzarella wrote: > >On Wed, Jan 11, 2023 at 04:49:14PM +, Richard W.M. Jones wrote: > >>On Wed, Jan 11, 2023 at 11:34:50AM -0500, Stefan Hajnoczi wrote: > >>>On Sat, Jan 07, 2023 at

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-16 Thread Stefano Garzarella
On Mon, Jan 16, 2023 at 03:39:29PM +0100, Stefano Garzarella wrote: On Wed, Jan 11, 2023 at 04:49:14PM +, Richard W.M. Jones wrote: On Wed, Jan 11, 2023 at 11:34:50AM -0500, Stefan Hajnoczi wrote: On Sat, Jan 07, 2023 at 07:44:37PM +, Richard W.M. Jones wrote: This is upstream in

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-16 Thread Stefano Garzarella
On Wed, Jan 11, 2023 at 04:49:14PM +, Richard W.M. Jones wrote: On Wed, Jan 11, 2023 at 11:34:50AM -0500, Stefan Hajnoczi wrote: On Sat, Jan 07, 2023 at 07:44:37PM +, Richard W.M. Jones wrote: > > This is upstream in nbdkit now: >

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-11 Thread Richard W.M. Jones
On Wed, Jan 11, 2023 at 10:52:01AM -0500, Stefan Hajnoczi wrote: > On Wed, Jan 04, 2023 at 06:14:34PM +, Richard W.M. Jones wrote: > > (1) There is no way to know which properties are readable, writable, > > and those which need to be set before or after blkio_connect (see > >

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-11 Thread Richard W.M. Jones
On Wed, Jan 11, 2023 at 11:34:50AM -0500, Stefan Hajnoczi wrote: > On Sat, Jan 07, 2023 at 07:44:37PM +, Richard W.M. Jones wrote: > > > > This is upstream in nbdkit now: > > https://gitlab.com/nbdkit/nbdkit/-/tree/master/plugins/blkio > > > > Another question: > > > > (6) vhost-user +

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-11 Thread Stefan Hajnoczi
On Sat, Jan 07, 2023 at 07:44:37PM +, Richard W.M. Jones wrote: > > This is upstream in nbdkit now: > https://gitlab.com/nbdkit/nbdkit/-/tree/master/plugins/blkio > > Another question: > > (6) vhost-user + "read-only" property acts a bit strangely. After > opening virtio-blk-vhost-user it

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-11 Thread Stefan Hajnoczi
On Wed, Jan 04, 2023 at 09:43:57PM +, Richard W.M. Jones wrote: > On Wed, Jan 04, 2023 at 06:14:34PM +, Richard W.M. Jones wrote: > > (3) It seems like some drivers require pre-allocated memory regions, > > and since some do that means we might as well implement this. It > > also seems

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-11 Thread Stefan Hajnoczi
On Wed, Jan 04, 2023 at 07:01:24PM +, Richard W.M. Jones wrote: > (5) "The application is responsible for thread-safety. No thread > synchronization is necessary when a queue is only used from a single > thread. Proper synchronization is required when sharing a queue > between multiple

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-11 Thread Stefan Hajnoczi
On Wed, Jan 04, 2023 at 06:14:34PM +, Richard W.M. Jones wrote: > This is an incomplete outline implementation for a libblkio plugin for > nbdkit. At the moment it only supports reading the same ("capacity") > of the device, and not even reading or writing. I have some questions > about the

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-09 Thread Richard W.M. Jones
On Sun, Jan 08, 2023 at 08:35:35PM +, Alberto Faria wrote: > With qemu-storage-daemon, you must set writable=on on the > vhost-user-blk export for the device to be writable. Ah, this was the thing I was missing, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-09 Thread Alberto Faria
> On Wed, Jan 04, 2023 at 06:14:34PM +, Richard W.M. Jones wrote: > > (3) It seems like some drivers require pre-allocated memory regions, > > and since some do that means we might as well implement this. It > > also seems like some drivers require file-backed pre-allocated > > memory

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-09 Thread Alberto Faria
> This is an incomplete outline implementation for a libblkio plugin for > nbdkit. At the moment it only supports reading the same ("capacity") > of the device, and not even reading or writing. I have some questions > about the libblkio API before I can complete the plugin (see below). > > The

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-09 Thread Alberto Faria
> This is upstream in nbdkit now: > https://gitlab.com/nbdkit/nbdkit/-/tree/master/plugins/blkio > > Another question: > > (6) vhost-user + "read-only" property acts a bit strangely. After > opening virtio-blk-vhost-user it throws an EROFS error if you try to > "blkio_start" it. However if you

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-09 Thread Alberto Faria
> (5) "The application is responsible for thread-safety. No thread > synchronization is necessary when a queue is only used from a single > thread. Proper synchronization is required when sharing a queue > between multiple threads." > > Does this apply across multiple struct blkio handles? ie. Is

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-07 Thread Richard W.M. Jones
This is upstream in nbdkit now: https://gitlab.com/nbdkit/nbdkit/-/tree/master/plugins/blkio Another question: (6) vhost-user + "read-only" property acts a bit strangely. After opening virtio-blk-vhost-user it throws an EROFS error if you try to "blkio_start" it. However if you set the

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-04 Thread Richard W.M. Jones
Here's an updated version which supports read, write, flush, write-zeroes, discard and FUA: https://gitlab.com/rwmjones/nbdkit/-/commits/2023-libblkio/ I was able to access a local file using the io_uring driver using guestfish. You can try it like this: $ ./nbdkit -fv blkio io_uring

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-04 Thread Richard W.M. Jones
On Wed, Jan 04, 2023 at 06:14:34PM +, Richard W.M. Jones wrote: > (3) It seems like some drivers require pre-allocated memory regions, > and since some do that means we might as well implement this. It > also seems like some drivers require file-backed pre-allocated > memory regions, and so

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-04 Thread Richard W.M. Jones
(5) "The application is responsible for thread-safety. No thread synchronization is necessary when a queue is only used from a single thread. Proper synchronization is required when sharing a queue between multiple threads." Does this apply across multiple struct blkio handles? ie. Is there now,

Re: [Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-04 Thread Richard W.M. Jones
On Wed, Jan 04, 2023 at 06:14:34PM +, Richard W.M. Jones wrote: > This is an incomplete outline implementation for a libblkio plugin for > nbdkit. At the moment it only supports reading the same ("capacity") s/same/size/ -- Richard Jones, Virtualization Group, Red Hat

[Libguestfs] [PATCH nbdkit] New plugin: blkio [incomplete]

2023-01-04 Thread Richard W.M. Jones
This is an incomplete outline implementation for a libblkio plugin for nbdkit. At the moment it only supports reading the same ("capacity") of the device, and not even reading or writing. I have some questions about the libblkio API before I can complete the plugin (see below). The idea here is