[PULL 14/30] qapi job: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/job.json. Said commit explains the

[PULL 10/30] qapi block: Elide redundant has_FOO in generated C

2022-12-13 Thread Markus Armbruster
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/block*.json. Said commit explains the

Re: [PATCH v2 2/5] Support format or cache specific out file

2022-12-13 Thread Nir Soffer
On Tue, Dec 13, 2022 at 8:09 PM Hanna Reitz wrote: > > On 13.12.22 16:56, Nir Soffer wrote: > > On Mon, Dec 12, 2022 at 12:38 PM Hanna Reitz wrote: > >> On 28.11.22 15:15, Nir Soffer wrote: > >>> Extend the test finder to find tests with format (*.out.qcow2) or cache > >>> specific

Re: [PATCH v2 2/5] Support format or cache specific out file

2022-12-13 Thread Hanna Reitz
On 13.12.22 16:56, Nir Soffer wrote: On Mon, Dec 12, 2022 at 12:38 PM Hanna Reitz wrote: On 28.11.22 15:15, Nir Soffer wrote: Extend the test finder to find tests with format (*.out.qcow2) or cache specific (*.out.nocache) out file. This worked before only for the numbered tests. ---

Re: [PATCH v2 2/5] Support format or cache specific out file

2022-12-13 Thread Nir Soffer
On Mon, Dec 12, 2022 at 12:38 PM Hanna Reitz wrote: > > On 28.11.22 15:15, Nir Soffer wrote: > > Extend the test finder to find tests with format (*.out.qcow2) or cache > > specific (*.out.nocache) out file. This worked before only for the > > numbered tests. > > --- > >

Re: [RFC PATCH-for-8.0 06/10] hw/virtio: Cache access_is_big_endian value in VirtIODevice state

2022-12-13 Thread Richard Henderson
On 12/13/22 01:30, Philippe Mathieu-Daudé wrote: On 13/12/22 01:14, Richard Henderson wrote: On 12/12/22 17:05, Philippe Mathieu-Daudé wrote: The device endianness doesn't change during runtime. What are you talking about?  Of course it does. The host CPU certainly does, but the virtio

Re: [RFC PATCH-for-8.0 07/10] hw/virtio: Directly access cached VirtIODevice::access_is_big_endian

2022-12-13 Thread Greg Kurz
On Tue, 13 Dec 2022 00:05:14 +0100 Philippe Mathieu-Daudé wrote: > Since the device endianness doesn't change at runtime, > use the cached value instead of evaluating it on each call. > > Signed-off-by: Philippe Mathieu-Daudé > --- > include/hw/virtio/virtio-access.h | 44

[PATCH 05/14] block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito BlockDriver->bdrv_getlength is categorized as IO callback, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since the callback traverses the block nodes graph, which however is only possible in a coroutine. Therefore turn it into

[PATCH 10/14] block: Convert bdrv_is_inserted() to co_wrapper

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_is_inserted() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. Therefore turn it into a co_wrapper

[PATCH 12/14] block: convert bdrv_lock_medium in co_wrapper

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_lock_medium() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. The only caller of this function is

[PATCH 14/14] block: Rename newly converted BlockDriver IO coroutine functions

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Since these functions always run in coroutine context, adjust their name to include "_co_", just like all other BlockDriver callbacks. No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf ---

[PATCH 09/14] block: Convert bdrv_get_info() to co_wrapper_mixed

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_get_info() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. Therefore turn it into a co_wrapper to

[PATCH 08/14] block: Convert bdrv_get_allocated_file_size() to co_wrapper

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_get_allocated_file_size() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. Therefore turn it into a

[PATCH 04/14] block: Rename refresh_total_sectors to bdrv_refresh_total_sectors

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito The name is not good, not the least because we are going to convert this to a generated co_wrapper, which adds a _co infix after the first part of the name. No functional change intended. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf ---

[PATCH 02/14] block: Convert bdrv_io_plug() to co_wrapper

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito BlockDriver->bdrv_io_plug is categorized as IO callback, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since the callback traverses the block nodes graph, which however is only possible in a coroutine. The only caller of this

[PATCH 07/14] block: use bdrv_co_refresh_total_sectors when possible

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito In some places we are sure we are always running in a coroutine, therefore it's useless to call the generated_co_wrapper, instead call directly the _co_ function. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- block/block-backend.c |

[PATCH 03/14] block: Convert bdrv_io_unplug() to co_wrapper

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito BlockDriver->bdrv_io_unplug is categorized as IO callback, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since the callback traverses the block nodes graph, which however is only possible in a coroutine. The only caller of

[PATCH 13/14] block: Convert bdrv_debug_event to co_wrapper_mixed

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_debug_event() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. Therefore turn it into a

[PATCH 00/14] block: Move more functions to coroutines

2022-12-13 Thread Kevin Wolf
This series converts some IO_CODE() functions to coroutine_fn because they access the graph and will need to hold the graph lock in the future. IO_CODE() functions can be called from iothreads, so taking the graph lock requires the function to run in coroutine context. Pretty much all of the

[PATCH 06/14] block-backend: use bdrv_getlength instead of blk_getlength

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito The only difference is that blk_ checks if the block is available, but this check is already performed above in blk_check_byte_request(). This is in preparation for the graph rdlock, which will be taken by both the callers of blk_check_byte_request() and

[PATCH 11/14] block: Convert bdrv_eject() to co_wrapper

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito bdrv_eject() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. The only caller of this function is

[PATCH 01/14] block-coroutine-wrapper: support void functions

2022-12-13 Thread Kevin Wolf
From: Emanuele Giuseppe Esposito Just omit the various 'return' when the return type is void. Signed-off-by: Emanuele Giuseppe Esposito Signed-off-by: Kevin Wolf --- scripts/block-coroutine-wrapper.py | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git

Re: [RFC PATCH-for-8.0 06/10] hw/virtio: Cache access_is_big_endian value in VirtIODevice state

2022-12-13 Thread Thomas Huth
On 13/12/2022 09.32, Philippe Mathieu-Daudé wrote: On 13/12/22 09:03, Thomas Huth wrote: On 13/12/2022 08.30, Philippe Mathieu-Daudé wrote: On 13/12/22 01:14, Richard Henderson wrote: On 12/12/22 17:05, Philippe Mathieu-Daudé wrote: The device endianness doesn't change during runtime. What

Re: [RFC PATCH-for-8.0 06/10] hw/virtio: Cache access_is_big_endian value in VirtIODevice state

2022-12-13 Thread Philippe Mathieu-Daudé
On 13/12/22 09:03, Thomas Huth wrote: On 13/12/2022 08.30, Philippe Mathieu-Daudé wrote: On 13/12/22 01:14, Richard Henderson wrote: On 12/12/22 17:05, Philippe Mathieu-Daudé wrote: The device endianness doesn't change during runtime. What are you talking about?  Of course it does. The

Re: [RFC PATCH-for-8.0 06/10] hw/virtio: Cache access_is_big_endian value in VirtIODevice state

2022-12-13 Thread Philippe Mathieu-Daudé
On 13/12/22 08:30, Philippe Mathieu-Daudé wrote: On 13/12/22 01:14, Richard Henderson wrote: On 12/12/22 17:05, Philippe Mathieu-Daudé wrote: The device endianness doesn't change during runtime. What are you talking about?  Of course it does. The host CPU certainly does, but the virtio

Re: [PATCH v4 0/2] Add OCP extended log to nvme QEMU

2022-12-13 Thread Klaus Jensen
On Nov 25 10:48, Joel Granados wrote: > The motivation and description are contained in the last patch in this set. > Will copy paste it here for convenience: > > In order to evaluate write amplification factor (WAF) within the storage > stack it is important to know the number of bytes

Re: [RFC PATCH-for-8.0 06/10] hw/virtio: Cache access_is_big_endian value in VirtIODevice state

2022-12-13 Thread Thomas Huth
On 13/12/2022 08.30, Philippe Mathieu-Daudé wrote: On 13/12/22 01:14, Richard Henderson wrote: On 12/12/22 17:05, Philippe Mathieu-Daudé wrote: The device endianness doesn't change during runtime. What are you talking about?  Of course it does. The host CPU certainly does, but the virtio