qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
	qemu-devel@nongnu.org, "Yanan Wang" <wangyanan55@huawei.com>,
	sgarzare@redhat.com, "Richard W.M. Jones" <rjones@redhat.com>,
	"Fam Zheng" <fam@euphon.net>, "Hanna Reitz" <hreitz@redhat.com>,
	"David Hildenbrand" <david@redhat.com>,
	integration@gluster.org, qemu-block@nongnu.org,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	afaria@redhat.com,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Eric Blake" <eblake@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Xie Changlong" <xiechanglong.d@gmail.com>,
	"John Snow" <jsnow@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Jeff Cody" <codyprime@gmail.com>,
	"Denis V. Lunev" <den@openvz.org>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Peter Xu" <peterx@redhat.com>,
	"Raphael Norwitz" <raphael.norwitz@nutanix.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Wen Congyang" <wencongyang2@huawei.com>
Subject: Re: [PATCH v6 02/13] blkio: add libblkio block driver
Date: Fri, 7 Oct 2022 13:26:12 -0400	[thread overview]
Message-ID: <CAJSP0QU53OaaY9PwYiYYOL655Qx_3f04durtXh7uE9vgieeHvQ@mail.gmail.com> (raw)
In-Reply-To: <874jwfr875.fsf@pond.sub.org>

On Fri, 7 Oct 2022 at 11:41, Markus Armbruster <armbru@redhat.com> wrote:
>
> Stefan Hajnoczi <stefanha@redhat.com> writes:
>
> > libblkio (https://gitlab.com/libblkio/libblkio/) is a library for
> > high-performance disk I/O. It currently supports io_uring,
> > virtio-blk-vhost-user, and virtio-blk-vhost-vdpa with additional drivers
> > under development.
> >
> > One of the reasons for developing libblkio is that other applications
> > besides QEMU can use it. This will be particularly useful for
> > virtio-blk-vhost-user which applications may wish to use for connecting
> > to qemu-storage-daemon.
> >
> > libblkio also gives us an opportunity to develop in Rust behind a C API
> > that is easy to consume from QEMU.
> >
> > This commit adds io_uring, virtio-blk-vhost-user, and
> > virtio-blk-vhost-vdpa BlockDrivers to QEMU using libblkio. It will be
> > easy to add other libblkio drivers since they will share the majority of
> > code.
> >
> > For now I/O buffers are copied through bounce buffers if the libblkio
> > driver requires it. Later commits add an optimization for
> > pre-registering guest RAM to avoid bounce buffers.
> >
> > The syntax is:
> >
> >   --blockdev io_uring,node-name=drive0,filename=test.img,readonly=on|off,cache.direct=on|off
> >
> > and:
> >
> >   --blockdev virtio-blk-vhost-vdpa,node-name=drive0,path=/dev/vdpa...,readonly=on|off
>
> The patch also adds nvme-io_uring.  Shouldn't the commit message mention
> it?

Yes, will fix in the next revision. Thanks!
>
> >
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Acked-by: Markus Armbruster <armbru@redhat.com>
> > ---
> >  MAINTAINERS                   |   6 +
> >  meson_options.txt             |   2 +
> >  qapi/block-core.json          |  75 ++-
> >  meson.build                   |   9 +
> >  block/blkio.c                 | 830 ++++++++++++++++++++++++++++++++++
> >  tests/qtest/modules-test.c    |   3 +
> >  block/meson.build             |   1 +
> >  scripts/meson-buildoptions.sh |   3 +
> >  8 files changed, 925 insertions(+), 4 deletions(-)
> >  create mode 100644 block/blkio.c
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index e1530b51a2..0dcae6168a 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -3403,6 +3403,12 @@ L: qemu-block@nongnu.org
> >  S: Maintained
> >  F: block/vdi.c
> >
> > +blkio
> > +M: Stefan Hajnoczi <stefanha@redhat.com>
> > +L: qemu-block@nongnu.org
> > +S: Maintained
> > +F: block/blkio.c
> > +
> >  iSCSI
> >  M: Ronnie Sahlberg <ronniesahlberg@gmail.com>
> >  M: Paolo Bonzini <pbonzini@redhat.com>
> > diff --git a/meson_options.txt b/meson_options.txt
> > index 79c6af18d5..66128178bf 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -117,6 +117,8 @@ option('bzip2', type : 'feature', value : 'auto',
> >         description: 'bzip2 support for DMG images')
> >  option('cap_ng', type : 'feature', value : 'auto',
> >         description: 'cap_ng support')
> > +option('blkio', type : 'feature', value : 'auto',
> > +       description: 'libblkio block device driver')
> >  option('bpf', type : 'feature', value : 'auto',
> >          description: 'eBPF support')
> >  option('cocoa', type : 'feature', value : 'auto',
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index f21fa235f2..6c6ae2885c 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -2951,11 +2951,18 @@
> >              'file', 'snapshot-access', 'ftp', 'ftps', 'gluster',
> >              {'name': 'host_cdrom', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
> >              {'name': 'host_device', 'if': 'HAVE_HOST_BLOCK_DEVICE' },
> > -            'http', 'https', 'iscsi',
> > -            'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
> > -            'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
> > +            'http', 'https',
> > +            { 'name': 'io_uring', 'if': 'CONFIG_BLKIO' },
> > +            'iscsi',
> > +            'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme',
> > +            { 'name': 'nvme-io_uring', 'if': 'CONFIG_BLKIO' },
>
> This enumeration value and ...
>
> > +            'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum',
> > +            'raw', 'rbd',
> >              { 'name': 'replication', 'if': 'CONFIG_REPLICATION' },
> > -            'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] }
> > +            'ssh', 'throttle', 'vdi', 'vhdx',
> > +            { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' },
> > +            { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' },
> > +            'vmdk', 'vpc', 'vvfat' ] }
> >
> >  ##
> >  # @BlockdevOptionsFile:
> > @@ -3678,6 +3685,58 @@
> >              '*debug': 'int',
> >              '*logfile': 'str' } }
> >
> > +##
> > +# @BlockdevOptionsIoUring:
> > +#
> > +# Driver specific block device options for the io_uring backend.
> > +#
> > +# @filename: path to the image file
> > +#
> > +# Since: 7.2
> > +##
> > +{ 'struct': 'BlockdevOptionsIoUring',
> > +  'data': { 'filename': 'str' },
> > +  'if': 'CONFIG_BLKIO' }
> > +
> > +##
> > +# @BlockdevOptionsNvmeIoUring:
> > +#
> > +# Driver specific block device options for the nvme-io_uring backend.
> > +#
> > +# @filename: path to the image file
> > +#
> > +# Since: 7.2
> > +##
> > +{ 'struct': 'BlockdevOptionsNvmeIoUring',
> > +  'data': { 'filename': 'str' },
> > +  'if': 'CONFIG_BLKIO' }
>
> ... this type aren't used in this patch.  Did you ...
>
> > +
> > +##
> > +# @BlockdevOptionsVirtioBlkVhostUser:
> > +#
> > +# Driver specific block device options for the virtio-blk-vhost-user backend.
> > +#
> > +# @path: path to the vhost-user UNIX domain socket.
> > +#
> > +# Since: 7.2
> > +##
> > +{ 'struct': 'BlockdevOptionsVirtioBlkVhostUser',
> > +  'data': { 'path': 'str' },
> > +  'if': 'CONFIG_BLKIO' }
> > +
> > +##
> > +# @BlockdevOptionsVirtioBlkVhostVdpa:
> > +#
> > +# Driver specific block device options for the virtio-blk-vhost-vdpa backend.
> > +#
> > +# @path: path to the vhost-vdpa character device.
> > +#
> > +# Since: 7.2
> > +##
> > +{ 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa',
> > +  'data': { 'path': 'str' },
> > +  'if': 'CONFIG_BLKIO' }
> > +
> >  ##
> >  # @IscsiTransport:
> >  #
> > @@ -4305,6 +4364,8 @@
> >                         'if': 'HAVE_HOST_BLOCK_DEVICE' },
> >        'http':       'BlockdevOptionsCurlHttp',
> >        'https':      'BlockdevOptionsCurlHttps',
> > +      'io_uring':   { 'type': 'BlockdevOptionsIoUring',
> > +                      'if': 'CONFIG_BLKIO' },
> >        'iscsi':      'BlockdevOptionsIscsi',
> >        'luks':       'BlockdevOptionsLUKS',
> >        'nbd':        'BlockdevOptionsNbd',
> > @@ -4327,6 +4388,12 @@
> >        'throttle':   'BlockdevOptionsThrottle',
> >        'vdi':        'BlockdevOptionsGenericFormat',
> >        'vhdx':       'BlockdevOptionsGenericFormat',
> > +      'virtio-blk-vhost-user':
> > +                    { 'type': 'BlockdevOptionsVirtioBlkVhostUser',
> > +                      'if': 'CONFIG_BLKIO' },
> > +      'virtio-blk-vhost-vdpa':
> > +                    { 'type': 'BlockdevOptionsVirtioBlkVhostVdpa',
> > +                      'if': 'CONFIG_BLKIO' },
> >        'vmdk':       'BlockdevOptionsGenericCOWFormat',
> >        'vpc':        'BlockdevOptionsGenericFormat',
> >        'vvfat':      'BlockdevOptionsVVFAT'
>
> ... forget to add a branch here?

Yes! Alberto tried to run it earlier today and hit this problem. Will
fix in the next revision:

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 6c6ae2885c..d752e8550d 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -4373,6 +4373,8 @@
       'null-aio':   'BlockdevOptionsNull',
       'null-co':    'BlockdevOptionsNull',
       'nvme':       'BlockdevOptionsNVMe',
+      'nvme-io_uring': { 'type': 'BlockdevOptionsNvmeIoUring',
+                         'if': 'CONFIG_BLKIO' },
       'parallels':  'BlockdevOptionsGenericFormat',
       'preallocate':'BlockdevOptionsPreallocate',
       'qcow2':      'BlockdevOptionsQcow2',


  reply	other threads:[~2022-10-07 17:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 21:34 [PATCH v6 00/13] blkio: add libblkio BlockDriver Stefan Hajnoczi
2022-10-06 21:34 ` [PATCH v6 01/13] coroutine: add flag to re-queue at front of CoQueue Stefan Hajnoczi
2022-10-06 21:34 ` [PATCH v6 02/13] blkio: add libblkio block driver Stefan Hajnoczi
2022-10-07 10:39   ` Stefano Garzarella
2022-10-13 18:07     ` Stefan Hajnoczi
2022-10-07 14:59   ` Markus Armbruster
2022-10-07 17:26     ` Stefan Hajnoczi [this message]
2022-10-06 21:34 ` [PATCH v6 03/13] numa: call ->ram_block_removed() in ram_block_notifer_remove() Stefan Hajnoczi
2022-10-06 21:34 ` [PATCH v6 04/13] block: pass size to bdrv_unregister_buf() Stefan Hajnoczi
2022-10-07 10:41   ` Stefano Garzarella
2022-10-06 21:34 ` [PATCH v6 05/13] block: use BdrvRequestFlags type for supported flag fields Stefan Hajnoczi
2022-10-07 10:42   ` Stefano Garzarella
2022-10-06 21:35 ` [PATCH v6 06/13] block: add BDRV_REQ_REGISTERED_BUF request flag Stefan Hajnoczi
2022-10-06 21:35 ` [PATCH v6 07/13] block: return errors from bdrv_register_buf() Stefan Hajnoczi
2022-10-06 21:35 ` [PATCH v6 08/13] numa: use QLIST_FOREACH_SAFE() for RAM block notifiers Stefan Hajnoczi
2022-10-10 11:49   ` David Hildenbrand
2022-10-06 21:35 ` [PATCH v6 09/13] block: add BlockRAMRegistrar Stefan Hajnoczi
2022-10-07 10:51   ` Stefano Garzarella
2022-10-13 18:05     ` Stefan Hajnoczi
2022-10-13 18:07       ` David Hildenbrand
2022-10-06 21:35 ` [PATCH v6 10/13] exec/cpu-common: add qemu_ram_get_fd() Stefan Hajnoczi
2022-10-06 21:35 ` [PATCH v6 11/13] stubs: add qemu_ram_block_from_host() and qemu_ram_get_fd() Stefan Hajnoczi
2022-10-06 21:35 ` [PATCH v6 12/13] blkio: implement BDRV_REQ_REGISTERED_BUF optimization Stefan Hajnoczi
2022-10-10 13:57   ` Alberto Faria
2022-10-13 18:42     ` Stefan Hajnoczi
2022-10-06 21:35 ` [PATCH v6 13/13] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint Stefan Hajnoczi
2022-10-10  9:46 ` [PATCH v6 00/13] blkio: add libblkio BlockDriver Alberto Faria
2022-10-13 18:40   ` 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=CAJSP0QU53OaaY9PwYiYYOL655Qx_3f04durtXh7uE9vgieeHvQ@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=afaria@redhat.com \
    --cc=armbru@redhat.com \
    --cc=codyprime@gmail.com \
    --cc=david@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=hreitz@redhat.com \
    --cc=integration@gluster.org \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=raphael.norwitz@nutanix.com \
    --cc=richard.henderson@linaro.org \
    --cc=rjones@redhat.com \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    --cc=wangyanan55@huawei.com \
    --cc=wencongyang2@huawei.com \
    --cc=xiechanglong.d@gmail.com \
    /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).