Re: [PATCH v5 3/3] hw/nvme: add nvme management interface model

2023-09-13 Thread Klaus Jensen
On Sep 12 13:50, Andrew Jeffery wrote: > Hi Klaus, > > On Tue, 2023-09-05 at 10:38 +0200, Klaus Jensen wrote: > > > > > > +static void nmi_handle_mi_config_get(NMIDevice *nmi, NMIRequest > > > *request) > > > +{ > > > +    uint32_t dw0 = le32_to_cpu(request->dw0); > > > +    uint8_t identifier =

Re: [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context()

2023-09-13 Thread Klaus Jensen
On Sep 12 19:10, Stefan Hajnoczi wrote: > The synchronous bdrv_aio_cancel() function needs the acb's AioContext so > it can call aio_poll() to wait for cancellation. > > It turns out that all users run under the BQL in the main AioContext, so > this callback is not needed. > > Remove the callback

Re: [PATCH v3 3/4] qcow2: add zoned emulation capability

2023-09-13 Thread Stefan Hajnoczi
On Mon, Aug 28, 2023 at 11:09:54PM +0800, Sam Li wrote: > By adding zone operations and zoned metadata, the zoned emulation > capability enables full emulation support of zoned device using > a qcow2 file. The zoned device metadata includes zone type, > zoned device state and write pointer of each

Re: [PATCH v3 0/4] virtio-blk: use blk_io_plug_call() instead of notification BH

2023-09-13 Thread Michael S. Tsirkin
On Wed, Sep 13, 2023 at 04:00:41PM -0400, Stefan Hajnoczi wrote: > v3: > - Add comment pointing to API documentation in .c file [Philippe] > - Add virtio_notify_irqfd_deferred_fn trace event [Ilya] > - Remove outdated #include [Ilya] > v2: > - Rename blk_io_plug() to defer_call() and move it to uti

Re: [PATCH v3 2/4] qcow2: add configurations for zoned format extension

2023-09-13 Thread Stefan Hajnoczi
On Mon, Aug 28, 2023 at 11:09:53PM +0800, Sam Li wrote: > To configure the zoned format feature on the qcow2 driver, it > requires following arguments: the device size, zoned profile, > zone model, zone size, zone capacity, number of conventional > zones, limits on zone resources (max append sector

[PATCH v3 4/4] virtio-blk: remove batch notification BH

2023-09-13 Thread Stefan Hajnoczi
There is a batching mechanism for virtio-blk Used Buffer Notifications that is no longer needed because the previous commit added batching to virtio_notify_irqfd(). Note that this mechanism was rarely used in practice because it is only enabled when EVENT_IDX is not negotiated by the driver. Moder

[PATCH v3 0/4] virtio-blk: use blk_io_plug_call() instead of notification BH

2023-09-13 Thread Stefan Hajnoczi
v3: - Add comment pointing to API documentation in .c file [Philippe] - Add virtio_notify_irqfd_deferred_fn trace event [Ilya] - Remove outdated #include [Ilya] v2: - Rename blk_io_plug() to defer_call() and move it to util/ so the net subsystem can use it [Ilya] - Add defer_call_begin()/end() to

[PATCH v3 2/4] util/defer-call: move defer_call() to util/

2023-09-13 Thread Stefan Hajnoczi
The networking subsystem may wish to use defer_call(), so move the code to util/ where it can be reused. As a reminder of what defer_call() does: This API defers a function call within a defer_call_begin()/defer_call_end() section, allowing multiple calls to batch up. This is a performance optimi

[PATCH v3 1/4] block: rename blk_io_plug_call() API to defer_call()

2023-09-13 Thread Stefan Hajnoczi
Prepare to move the blk_io_plug_call() API out of the block layer so that other subsystems call use this deferred call mechanism. Rename it to defer_call() but leave the code in block/plug.c. The next commit will move the code out of the block layer. Suggested-by: Ilya Maximets Reviewed-by: Phil

[PATCH v3 3/4] virtio: use defer_call() in virtio_irqfd_notify()

2023-09-13 Thread Stefan Hajnoczi
virtio-blk and virtio-scsi invoke virtio_irqfd_notify() to send Used Buffer Notifications from an IOThread. This involves an eventfd write(2) syscall. Calling this repeatedly when completing multiple I/O requests in a row is wasteful. Use the defer_call() API to batch together virtio_irqfd_notify(

Re: [PATCH v2 2/4] util/defer-call: move defer_call() to util/

2023-09-13 Thread Stefan Hajnoczi
On Fri, Aug 18, 2023 at 10:31:40AM +0200, Philippe Mathieu-Daudé wrote: > Hi Stefan, > > On 17/8/23 17:58, Stefan Hajnoczi wrote: > > The networking subsystem may wish to use defer_call(), so move the code > > to util/ where it can be reused. > > > > As a reminder of what defer_call() does: > >

Re: [PULL 0/2] hw/nvme: updates

2023-09-13 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/8.2 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH 3/3] iotests: distinguish 'skipped' and 'not run' states

2023-09-13 Thread Eric Blake
On Wed, Sep 13, 2023 at 04:47:54PM +0100, Daniel P. Berrangé wrote: > On Wed, Sep 06, 2023 at 04:09:17PM +0200, Denis V. Lunev wrote: > > Each particular testcase could skipped intentionally and accidentally. > > For example the test is not designed for a particular image format or > > is not run d

Re: [PATCH v3 5/5] block-coroutine-wrapper: use qemu_get_current_aio_context()

2023-09-13 Thread Eric Blake
On Tue, Sep 12, 2023 at 07:10:37PM -0400, Stefan Hajnoczi wrote: > Use qemu_get_current_aio_context() in mixed wrappers and coroutine > wrappers so that code runs in the caller's AioContext instead of moving > to the BlockDriverState's AioContext. This change is necessary for the > multi-queue bloc

Re: [PATCH v3 4/5] block-backend: process zoned requests in the current AioContext

2023-09-13 Thread Eric Blake
On Tue, Sep 12, 2023 at 07:10:36PM -0400, Stefan Hajnoczi wrote: > Process zoned requests in the current thread's AioContext instead of in > the BlockBackend's AioContext. > > There is no need to use the BlockBackend's AioContext thanks to CoMutex > bs->wps->colock, which protects zone metadata. >

Re: [PATCH v3 3/5] block-backend: process I/O in the current AioContext

2023-09-13 Thread Eric Blake
On Tue, Sep 12, 2023 at 07:10:35PM -0400, Stefan Hajnoczi wrote: > Switch blk_aio_*() APIs over to multi-queue by using > qemu_get_current_aio_context() instead of blk_get_aio_context(). This > change will allow devices to process I/O in multiple IOThreads in the > future. > > I audited existing b

Re: [PATCH v3 2/5] test-bdrv-drain: avoid race with BH in IOThread drain test

2023-09-13 Thread Eric Blake
On Tue, Sep 12, 2023 at 07:10:34PM -0400, Stefan Hajnoczi wrote: > This patch fixes a race condition in test-bdrv-drain that is difficult > to reproduce. test-bdrv-drain sometimes fails without an error message > on the block pull request sent by Kevin Wolf on Sep 4, 2023. I was able > to reproduce

Re: [PATCH v3 1/5] block: remove AIOCBInfo->get_aio_context()

2023-09-13 Thread Eric Blake
On Tue, Sep 12, 2023 at 07:10:33PM -0400, Stefan Hajnoczi wrote: > The synchronous bdrv_aio_cancel() function needs the acb's AioContext so > it can call aio_poll() to wait for cancellation. > > It turns out that all users run under the BQL in the main AioContext, so > this callback is not needed.

Re: [PATCH 3/3] iotests: distinguish 'skipped' and 'not run' states

2023-09-13 Thread Daniel P . Berrangé
On Wed, Sep 06, 2023 at 04:09:17PM +0200, Denis V. Lunev wrote: > Each particular testcase could skipped intentionally and accidentally. > For example the test is not designed for a particular image format or > is not run due to the missed library. > > The latter case is unwanted in reality. Thoug

Re: [PATCH 3/3] iotests: distinguish 'skipped' and 'not run' states

2023-09-13 Thread Eric Blake
On Wed, Sep 06, 2023 at 04:09:17PM +0200, Denis V. Lunev wrote: > Each particular testcase could skipped intentionally and accidentally. > For example the test is not designed for a particular image format or > is not run due to the missed library. > > The latter case is unwanted in reality. Thoug

Re: [PATCH 2/3] iotests: improve 'not run' message for nbd-multiconn test

2023-09-13 Thread Eric Blake
On Wed, Sep 06, 2023 at 04:09:16PM +0200, Denis V. Lunev wrote: > The test actually requires Python bindings to libnbd rather than libnbd > itself. Clarify that inside the message. Makes sense; distros have the freedom to break the upstream monolithic libnbd project into smaller distribution packa

Re: [PATCH 1/3] iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_large_file

2023-09-13 Thread Eric Blake
On Wed, Sep 06, 2023 at 04:09:15PM +0200, Denis V. Lunev wrote: > We need to check that we are able to create large enough file which is > used as an export base rather than connection URL. Unfortunately, there > are cases when the TEST_IMG_FILE is not defined. We should fallback to > TEST_IMG in t