Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Marc-André Lureau
Hi On Thu, Aug 11, 2022 at 10:52 AM Markus Armbruster wrote: > Marc-André Lureau writes: > > > Hi > > > > On Fri, Aug 5, 2022 at 12:12 PM Markus Armbruster > wrote: > > > >> marcandre.lur...@redhat.com writes: > >> > >> > From: Marc-André Lureau > >> > > >> > This is just moving qapi-gen.py a

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Thu, Aug 11, 2022 at 10:52 AM Markus Armbruster > wrote: > >> Marc-André Lureau writes: >> >> > Hi >> > >> > On Fri, Aug 5, 2022 at 12:12 PM Markus Armbruster >> wrote: >> > >> >> marcandre.lur...@redhat.com writes: >> >> >> >> > From: Marc-André Lureau >

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Marc-André Lureau
On Thu, Aug 11, 2022 at 1:05 PM Markus Armbruster wrote: > Marc-André Lureau writes: > > > Hi > > > > On Thu, Aug 11, 2022 at 10:52 AM Markus Armbruster > > wrote: > > > >> Marc-André Lureau writes: > >> > >> > Hi > >> > > >> > On Fri, Aug 5, 2022 at 12:12 PM Markus Armbruster > >> wrote: > >

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Peter Maydell
On Thu, 11 Aug 2022 at 11:09, Marc-André Lureau wrote: > On Thu, Aug 11, 2022 at 1:05 PM Markus Armbruster wrote: >> Your moves tear closely related code apart. This is going to be a drag >> for developers in general and maintainers in particular. >> >> Ergonomics suffer when related code is in

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Marc-André Lureau
Hi On Thu, Aug 11, 2022 at 2:22 PM Peter Maydell wrote: > On Thu, 11 Aug 2022 at 11:09, Marc-André Lureau > wrote: > > On Thu, Aug 11, 2022 at 1:05 PM Markus Armbruster > wrote: > >> Your moves tear closely related code apart. This is going to be a drag > >> for developers in general and main

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Markus Armbruster
Peter Maydell writes: > On Thu, 11 Aug 2022 at 11:09, Marc-André Lureau > wrote: >> On Thu, Aug 11, 2022 at 1:05 PM Markus Armbruster wrote: >>> Your moves tear closely related code apart. This is going to be a drag >>> for developers in general and maintainers in particular. >>> >>> Ergonomic

[PATCH v15 1/6] qmp: add QMP command x-query-virtio

2022-08-11 Thread Jonah Palmer
From: Laurent Vivier This new command lists all the instances of VirtIODevices with their canonical QOM path and name. [Jonah: @virtio_list duplicates information that already exists in the QOM composition tree. However, extracting necessary information from this tree seems to be a bit convolu

[PATCH v15 0/6] hmp,qmp: Add commands to introspect virtio devices

2022-08-11 Thread Jonah Palmer
This series introduces new QMP/HMP commands to dump the status of a virtio device at different levels. [Jonah: Rebasing from previous patchset from Apr. 1 (v14). Original patches are by Laurent Vivier from May 2020. I sincerely apologize for the *massive* delay in getting this latest v15 serie

[PATCH v15 3/6] qmp: decode feature & status bits in virtio-status

2022-08-11 Thread Jonah Palmer
From: Laurent Vivier Display feature names instead of bitmaps for host, guest, and backend for VirtIODevices. Display status names instead of bitmaps for VirtIODevices. Display feature names instead of bitmaps for backend, protocol, acked, and features (hdev->features) for vhost devices. Decod

[PATCH v15 5/6] qmp: add QMP command x-query-virtio-queue-element

2022-08-11 Thread Jonah Palmer
From: Laurent Vivier This new command shows the information of a VirtQueue element. [Note: Up until v10 of this patch series, virtio.json had many (15+) enums defined (e.g. decoded device features, statuses, etc.). In v10 most of these enums were removed and replaced with string literals. By

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Daniel P . Berrangé
On Thu, Aug 11, 2022 at 02:50:01PM +0400, Marc-André Lureau wrote: > Hi > > On Thu, Aug 11, 2022 at 2:22 PM Peter Maydell > wrote: > > > On Thu, 11 Aug 2022 at 11:09, Marc-André Lureau > > wrote: > > > On Thu, Aug 11, 2022 at 1:05 PM Markus Armbruster > > wrote: > > >> Your moves tear closely

[PATCH v15 4/6] qmp: add QMP commands for virtio/vhost queue-status

2022-08-11 Thread Jonah Palmer
From: Laurent Vivier These new commands show the internal status of a VirtIODevice's VirtQueue and a vhost device's vhost_virtqueue (if active). Signed-off-by: Laurent Vivier Signed-off-by: Jonah Palmer --- hw/virtio/virtio-stub.c | 14 +++ hw/virtio/virtio.c | 103 qap

[PATCH v15 2/6] qmp: add QMP command x-query-virtio-status

2022-08-11 Thread Jonah Palmer
From: Laurent Vivier This new command shows the status of a VirtIODevice, including its corresponding vhost device's status (if active). Next patch will improve output by decoding feature bits, including vhost device's feature bits (backend, protocol, acked, and features). Also will decode statu

[PATCH v15 6/6] hmp: add virtio commands

2022-08-11 Thread Jonah Palmer
From: Laurent Vivier This patch implements the HMP versions of the virtio QMP commands. [Jonah: Adjusted hmp monitor output format for features / statuses with their descriptions.] Signed-off-by: Laurent Vivier Signed-off-by: Jonah Palmer --- hmp-commands-info.hx | 70 ++ i

Re: [PATCH v2 11/15] qemu-common: move scripts/qapi

2022-08-11 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Thu, Aug 11, 2022 at 02:50:01PM +0400, Marc-André Lureau wrote: >> Hi >> >> On Thu, Aug 11, 2022 at 2:22 PM Peter Maydell >> wrote: [...] >> > As Markus says, your branch ends up moving most of qobject into >> > qemu-common/. We are never going to let that out

[PATCH v2 3/8] parallels: Replace bdrv_co_pwrite_sync by bdrv_co_flush for BAT flushing

2022-08-11 Thread Alexander Ivanov
It's too costly to write all the BAT to the disk. Let the flush function write only dirty blocks. Use parallels_set_bat_entry for setting a BAT entry and marking a relevant block as dirty. Move bdrv_co_flush call outside the locked area. v2: Patch order was changed so the replacement is done in pa

[PATCH v2 0/8] parallels: Refactor the code of images checks and fix a bug

2022-08-11 Thread Alexander Ivanov
Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for more clean code. Alexander Ivanov (8): parallels: Out of image offset in BAT

[PATCH v2 1/8] parallels: Out of image offset in BAT leads to image inflation

2022-08-11 Thread Alexander Ivanov
When an image is opened, data_end field in BDRVParallelsState is setted as the biggest offset in the BAT plus cluster size. If there is a corrupted offset pointing outside the image, the image size increase accordingly. It potentially leads to attempts to create a file size of petabytes. Set the d

[PATCH v2 8/8] parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD

2022-08-11 Thread Alexander Ivanov
Replace the way we use mutex in parallels_co_check() for more clean code. v2: Fix an incorrect usage of WITH_QEMU_LOCK_GUARD. Signed-off-by: Alexander Ivanov --- block/parallels.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/block/parallels.c

[PATCH v2 7/8] parallels: Move statistic collection to a separate function

2022-08-11 Thread Alexander Ivanov
v2: Move fragmentation counting code to this function too. Signed-off-by: Alexander Ivanov --- block/parallels.c | 54 +++ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 8737eadfb4..d0364182b

[PATCH v2 4/8] parallels: Move check of unclean image to a separate function

2022-08-11 Thread Alexander Ivanov
v2: Revert the condition with s->header_unclean. Signed-off-by: Alexander Ivanov --- block/parallels.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 6879ea4597..c53b2810cf 100644 --- a/block/paral

[PATCH v2 5/8] parallels: Move check of cluster outside image to a separate function

2022-08-11 Thread Alexander Ivanov
v2: Move unrelated helper parallels_set_bat_entry creation to a separate patch. Signed-off-by: Alexander Ivanov --- block/parallels.c | 48 ++- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/block/parallels.c b/block/parallels.c in

[PATCH v2 2/8] parallels: Move BAT entry setting to a separate function

2022-08-11 Thread Alexander Ivanov
Will need to set BAT entry in multiple places. Move the code of settings entries and marking relevant blocks dirty to a separate helper parallels_set_bat_entry. v2: A new patch - a part of a splitted patch. Signed-off-by: Alexander Ivanov --- block/parallels.c | 12 +--- 1 file changed,

[PATCH v2 6/8] parallels: Move check of leaks to a separate function

2022-08-11 Thread Alexander Ivanov
v2: No changes. Signed-off-by: Alexander Ivanov --- block/parallels.c | 85 +-- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 12104ba5ad..8737eadfb4 100644 --- a/block/parallels.c +++ b/bloc

[PATCH 1/4] hw/nvme: avoid unnecessary call to irq (de)assertion functions

2022-08-11 Thread Jinhao Fan
nvme_irq_assert() only does useful work when cq->irq_enabled is true. nvme_irq_deassert() only works for pin-based interrupts. Avoid calls into these functions if we are sure they will not do useful work. This will be most useful when we use eventfd to send interrupts. We can avoid the unnecessary

[PATCH 2/4] hw/nvme: add option to (de)assert irq with eventfd

2022-08-11 Thread Jinhao Fan
When the new option 'irq-eventfd' is turned on, the IO emulation code signals an eventfd when it want to (de)assert an irq. The main loop eventfd handler does the actual irq (de)assertion. This paves the way for iothread support since QEMU's interrupt emulation is not thread safe. Asserting and d

[PATCH 4/4] hw/nvme: add MSI-x mask handlers for irqfd

2022-08-11 Thread Jinhao Fan
When irqfd is enabled, we bypass QEMU's irq emulation and let KVM to directly assert the irq. However, KVM is not aware of the device's MSI-x masking status. Add MSI-x mask bookkeeping in NVMe emulation and detach the corresponding irqfd when the certain vector is masked. Signed-off-by: Jinhao Fan

[PATCH 3/4] hw/nvme: use irqfd to send interrupts

2022-08-11 Thread Jinhao Fan
Use KVM's irqfd to send interrupts when possible. This approach is thread safe. Moreover, it does not have the inter-thread communication overhead of plain event notifiers since handler callback are called in the same system call as irqfd write. Signed-off-by: Jinhao Fan --- hw/nvme/ctrl.c | 50

Re: [RFC v3 1/8] blkio: add io_uring block driver using libblkio

2022-08-11 Thread Stefan Hajnoczi
On Tue, Jul 12, 2022 at 04:23:32PM +0200, Stefano Garzarella wrote: > On Fri, Jul 08, 2022 at 05:17:30AM +0100, Stefan Hajnoczi wrote: > > libblkio (https://gitlab.com/libblkio/libblkio/) is a library for > > high-performance disk I/O. It currently supports io_uring and > > virtio-blk-vhost-vdpa wi

[PATCH] gluster: stop using .bdrv_needs_filename

2022-08-11 Thread Stefan Hajnoczi
The gluster protocol driver used to parse URIs (filenames) but was extended with a richer JSON syntax in commit 6c7189bb29de ("block/gluster: add support for multiple gluster servers"). The gluster drivers that have JSON parsing set .bdrv_needs_filename to false. The gluster+unix and gluster+rdma

Re: [RFC v3 1/8] blkio: add io_uring block driver using libblkio

2022-08-11 Thread Stefan Hajnoczi
On Wed, Jul 13, 2022 at 02:05:18PM +0200, Hanna Reitz wrote: > On 08.07.22 06:17, Stefan Hajnoczi wrote: > > libblkio (https://gitlab.com/libblkio/libblkio/) is a library for > > high-performance disk I/O. It currently supports io_uring and > > virtio-blk-vhost-vdpa with additional drivers under de

Re: [RFC v3 1/8] blkio: add io_uring block driver using libblkio

2022-08-11 Thread Stefan Hajnoczi
On Wed, Jul 27, 2022 at 09:33:40PM +0200, Kevin Wolf wrote: > Am 08.07.2022 um 06:17 hat Stefan Hajnoczi geschrieben: > > libblkio (https://gitlab.com/libblkio/libblkio/) is a library for > > high-performance disk I/O. It currently supports io_uring and > > virtio-blk-vhost-vdpa with additional dri