Re: [PATCH v5 0/7] coroutines: generate wrapper code

2020-05-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200527203733.16129-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

Re: [PATCH v5 1/7] block: return error-code from bdrv_invalidate_cache

2020-05-27 Thread Eric Blake
On 5/27/20 3:37 PM, Vladimir Sementsov-Ogievskiy wrote: This is the only coroutine wrapper from block.c and block/io.c which doesn't return value, so let's convert it to the common behavior, to s/value/a value/ simplify moving to generated coroutine wrappers in further commit. s/in/in a/

Re: [PATCH v5 0/7] coroutines: generate wrapper code

2020-05-27 Thread Eric Blake
On 5/27/20 4:46 PM, no-re...@patchew.org wrote: Patchew URL: https://patchew.org/QEMU/20200527203733.16129-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can

Re: [PATCH v5 0/7] coroutines: generate wrapper code

2020-05-27 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200527203733.16129-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

[PULL v2 08/11] qcow2: Expose bitmaps' size during measure

2020-05-27 Thread Eric Blake
It's useful to know how much space can be occupied by qcow2 persistent bitmaps, even though such metadata is unrelated to the guest-visible data. Report this value as an additional QMP field, present when measuring an existing image and output format that both support bitmaps. Update iotest 178

Re: [PATCH v6 4/5] block: make size-related BlockConf properties accept size suffixes

2020-05-27 Thread Eric Blake
On 5/27/20 3:53 PM, Roman Kagan wrote: --- v5 -> v6: - add prop_size32 instead of going with 64bit Would it be worth adding prop_size32 as its own patch, before using it here? I've no strong opinion on this. Should I better split it out when respinning? Patch splitting is an art-form.

Re: [PATCH v6 4/5] block: make size-related BlockConf properties accept size suffixes

2020-05-27 Thread Roman Kagan
On Wed, May 27, 2020 at 09:50:39AM -0500, Eric Blake wrote: > On 5/27/20 7:45 AM, Roman Kagan wrote: > > Several BlockConf properties represent respective sizes in bytes so it > > makes sense to accept size suffixes for them. > > > > Turn them all into uint32_t and use size-suffix-capable

[PATCH v5 5/7] block: generate coroutine-wrapper code

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
Use code generation implemented in previous commit to generated coroutine wrappers in block.c and block/io.c Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/coroutines.h| 7 +- include/block/block.h | 17 ++- block.c | 73 block/io.c| 260

[PATCH v5 7/7] block/io: refactor save/load vmstate

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
Like for read/write in a previous commit, drop extra indirection layer, generate directly bdrv_readv_vmstate() and bdrv_writev_vmstate(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/coroutines.h| 10 +++ include/block/block.h | 6 ++-- block/io.c

[PATCH v5 3/7] block: declare some coroutine functions in block/coroutines.h

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
We are going to keep coroutine-wrappers code (structure-packing parameters, BDRV_POLL wrapper functions) in separate auto-generated files. So, we'll need a header with declaration of original _co_ functions, for those which are static now. As well, we'll need declarations for wrapper functions. Do

[PATCH v5 6/7] block: drop bdrv_prwv

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
Now that we are not maintaining boilerplate code for coroutine wrappers, there is no more sense in keeping the extra indirection layer of bdrv_prwv(). Let's drop it and instead generate pure bdrv_preadv() and bdrv_pwritev(). Currently, bdrv_pwritev() and bdrv_preadv() are returning bytes on

[PATCH v5 2/7] block/io: refactor coroutine wrappers

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
Most of our coroutine wrappers already follow this convention: We have 'coroutine_fn bdrv_co_()' as the core function, and a wrapper 'bdrv_()' which does a polling loop. The only outsiders are the bdrv_prwv_co and bdrv_common_block_status_above wrappers. Let's refactor them to behave as the

[PATCH v5 4/7] scripts: add coroutine-wrapper.py

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
We have a very frequent pattern of creating coroutine from function with several arguments: - create structure to pack parameters - create _entry function to call original function taking parameters from struct - do different magic to handle completion: set ret to NOT_DONE or

[PATCH v5 1/7] block: return error-code from bdrv_invalidate_cache

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
This is the only coroutine wrapper from block.c and block/io.c which doesn't return value, so let's convert it to the common behavior, to simplify moving to generated coroutine wrappers in further commit. Also, bdrv_invalidate_cache is a void function, returning error only through **errp

[PATCH v5 0/7] coroutines: generate wrapper code

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
Hi all! The aim of the series is to reduce code-duplication and writing parameters structure-packing by hand around coroutine function wrappers. It's an alternative to "[PATCH v3] block: Factor out bdrv_run_co()" patch. Benefits: - no code duplication - less indirection v5: mostly by Eric's

Re: [PATCH v4 9/9] iotests: rename and move 169 and 199 tests

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
21.05.2020 21:32, John Snow wrote: On 5/19/20 7:41 AM, Kevin Wolf wrote: Am 19.05.2020 um 13:32 hat Vladimir Sementsov-Ogievskiy geschrieben: 19.05.2020 12:07, Kevin Wolf wrote: Am 18.05.2020 um 18:12 hat Thomas Huth geschrieben: On 15/05/2020 23.15, Vladimir Sementsov-Ogievskiy wrote:

Re: [PATCH v7 32/32] iotests: Add tests for qcow2 images with extended L2 entries

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: Signed-off-by: Alberto Garcia --- tests/qemu-iotests/271 | 705 + tests/qemu-iotests/271.out | 603 +++ tests/qemu-iotests/group | 1 + 3 files changed, 1309 insertions(+)

Re: [PATCH v7 30/32] qcow2: Add the 'extended_l2' option and the QCOW2_INCOMPAT_EXTL2 bit

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: Now that the implementation of subclusters is complete we can finally add the necessary options to create and read images with this feature, which we call "extended L2 entries". Signed-off-by: Alberto Garcia --- Reviewed-by: Eric Blake -- Eric

Re: [PATCH v7 28/32] qcow2: Add subcluster support to qcow2_co_pwrite_zeroes()

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: This works now at the subcluster level and pwrite_zeroes_alignment is updated accordingly. qcow2_cluster_zeroize() is turned into qcow2_subcluster_zeroize() with the following changes: - The request can now be subcluster-aligned. - The

Re: [PATCH v7 25/32] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2()

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: The L2 bitmap needs to be updated after each write to indicate what new subclusters are now allocated. This needs to happen even if the cluster was already allocated and the L2 entry was otherwise valid. In some cases however a write operation doesn't

Re: [PATCH v7 23/32] qcow2: Add subcluster support to discard_in_l2_slice()

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: Two things need to be taken into account here: 1) With full_discard == true the L2 entry must be cleared completely. This also includes the L2 bitmap if the image has extended L2 entries. 2) With full_discard == false we have to make the

Re: [PATCH v7 22/32] qcow2: Add subcluster support to zero_in_l2_slice()

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: The QCOW_OFLAG_ZERO bit that indicates that a cluster reads as zeroes is only used in standard L2 entries. Extended L2 entries use individual 'all zeroes' bits for each subcluster. This must be taken into account when updating the L2 entry and also when

Re: [PATCH v7 21/32] qcow2: Add subcluster support to qcow2_get_host_offset()

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: The logic of this function remains pretty much the same, except that it uses count_contiguous_subclusters(), which combines the logic of count_contiguous_clusters() / count_contiguous_clusters_unallocated() and checks individual subclusters.

Re: [PATCH v7 20/32] qcow2: Add subcluster support to calculate_l2_meta()

2020-05-27 Thread Eric Blake
On 5/25/20 1:08 PM, Alberto Garcia wrote: If an image has subclusters then there are more copy-on-write scenarios that we need to consider. Let's say we have a write request from the middle of subcluster #3 until the end of the cluster: 1) If we are writing to a newly allocated cluster then we

Re: [PATCH v6 5/5] block: lift blocksize property limit to 2 MiB

2020-05-27 Thread Eric Blake
On 5/27/20 7:45 AM, Roman Kagan wrote: Logical and physical block sizes in QEMU are limited to 32 KiB. This appears unnecessary tight, and we've seen bigger block sizes handy unnecessarily at times. Lift the limitation up to 2 MiB which appears to be good enough for everybody, and matches

Re: [PATCH v6 4/5] block: make size-related BlockConf properties accept size suffixes

2020-05-27 Thread Eric Blake
On 5/27/20 7:45 AM, Roman Kagan wrote: Several BlockConf properties represent respective sizes in bytes so it makes sense to accept size suffixes for them. Turn them all into uint32_t and use size-suffix-capable setters/getters on them; introduce DEFINE_PROP_SIZE32 and adjust

Re: [PATCH v6 3/5] qdev-properties: blocksize: use same limits in code and description

2020-05-27 Thread Eric Blake
On 5/27/20 7:45 AM, Roman Kagan wrote: Make it easier (more visible) to maintain the limits on the blocksize properties in sync with the respective description, by using macros both in the code and in the description. Signed-off-by: Roman Kagan --- Reviewed-by: Eric Blake -- Eric Blake,

Re: [PATCH v6 2/5] block: consolidate blocksize properties consistency checks

2020-05-27 Thread Eric Blake
On 5/27/20 7:45 AM, Roman Kagan wrote: Several block device properties related to blocksize configuration must be in certain relationship WRT each other: physical block must be no smaller than logical block; min_io_size, opt_io_size, and discard_granularity must be a multiple of a logical block.

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module

2020-05-27 Thread Daniel P . Berrangé
On Wed, May 27, 2020 at 10:28:44AM -0400, John Snow wrote: > > > On 5/26/20 11:25 AM, Daniel P. Berrangé wrote: > > On Tue, May 26, 2020 at 05:23:42PM +0200, Philippe Mathieu-Daudé wrote: > >> On 5/26/20 5:22 PM, Daniel P. Berrangé wrote: > >>> On Mon, May 18, 2020 at 08:27:54PM -0400, John Snow

Re: [PATCH 2/5] vhost: involve device backends in feature negotiation

2020-05-27 Thread Marc-André Lureau
Hi Stefan On Fri, May 22, 2020 at 7:18 PM Stefan Hajnoczi wrote: > > Many vhost devices in QEMU currently do not involve the device backend > in feature negotiation. This seems fine at first glance for device types > without their own feature bits (virtio-net has many but other device > types

Re: [PATCH RFC 01/32] python/qemu: create qemu.lib module

2020-05-27 Thread John Snow
On 5/26/20 11:25 AM, Daniel P. Berrangé wrote: > On Tue, May 26, 2020 at 05:23:42PM +0200, Philippe Mathieu-Daudé wrote: >> On 5/26/20 5:22 PM, Daniel P. Berrangé wrote: >>> On Mon, May 18, 2020 at 08:27:54PM -0400, John Snow wrote: On 5/18/20 3:33 PM, Vladimir

Re: [PATCH v7 14/32] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-05-27 Thread Eric Blake
On 5/27/20 4:51 AM, Alberto Garcia wrote: On Tue 26 May 2020 10:32:08 PM CEST, Eric Blake wrote: +/* The subcluster X [0..31] is allocated */ +#define QCOW_OFLAG_SUB_ALLOC(X) (1ULL << (X)) +/* The subcluster X [0..31] reads as zeroes */ +#define QCOW_OFLAG_SUB_ZERO(X)

Re: [PATCH 0/4] memory: Add memory_region_msync() & make NVMe emulated device generic

2020-05-27 Thread Stefan Hajnoczi
On Fri, May 08, 2020 at 08:24:52AM +0200, Philippe Mathieu-Daudé wrote: > Let the NVMe emulated device be target-agnostic. > > It is not clear if dccvap_writefn() really needs > memory_region_writeback() or could use memory_region_msync(). > > Philippe Mathieu-Daudé (4): > memory: Rename

[PATCH v6 5/5] block: lift blocksize property limit to 2 MiB

2020-05-27 Thread Roman Kagan
Logical and physical block sizes in QEMU are limited to 32 KiB. This appears unnecessary tight, and we've seen bigger block sizes handy at times. Lift the limitation up to 2 MiB which appears to be good enough for everybody, and matches the qcow2 cluster size limit. Signed-off-by: Roman Kagan

[PATCH v6 4/5] block: make size-related BlockConf properties accept size suffixes

2020-05-27 Thread Roman Kagan
Several BlockConf properties represent respective sizes in bytes so it makes sense to accept size suffixes for them. Turn them all into uint32_t and use size-suffix-capable setters/getters on them; introduce DEFINE_PROP_SIZE32 and adjust DEFINE_PROP_BLOCKSIZE for that. (Making them uint64_t and

[PATCH v6 3/5] qdev-properties: blocksize: use same limits in code and description

2020-05-27 Thread Roman Kagan
Make it easier (more visible) to maintain the limits on the blocksize properties in sync with the respective description, by using macros both in the code and in the description. Signed-off-by: Roman Kagan --- v4 -> v5: - split out into separate patch [Philippe] hw/core/qdev-properties.c | 21

[PATCH v6 2/5] block: consolidate blocksize properties consistency checks

2020-05-27 Thread Roman Kagan
Several block device properties related to blocksize configuration must be in certain relationship WRT each other: physical block must be no smaller than logical block; min_io_size, opt_io_size, and discard_granularity must be a multiple of a logical block. To ensure these requirements are met,

[PATCH v6 1/5] virtio-blk: store opt_io_size with correct size

2020-05-27 Thread Roman Kagan
The width of opt_io_size in virtio_blk_config is 32bit. However, it's written with virtio_stw_p; this may result in value truncation, and on big-endian systems with legacy virtio in completely bogus readings in the guest. Use the appropriate accessor to store it. Signed-off-by: Roman Kagan

[PATCH v6 0/5] block: enhance handling of size-related BlockConf properties

2020-05-27 Thread Roman Kagan
BlockConf includes several properties counted in bytes. Enhance their handling in a some aspects, specifically - accept common size suffixes (k, m) - perform consistency checks on the values - lift the upper limit on physical_block_size and logical_block_size Also fix the accessor for

Re: [PATCH v2] iotests: Dump QCOW2 dirty bitmaps metadata

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
26.05.2020 23:26, Andrey Shinkevich wrote: Add dirty bitmap information to QCOW2 metadata dump in qcow2.py script. The sample output: Header extension: Bitmaps magic 0x23852875 length24 nb_bitmaps2 reserved320

Re: [PATCH v4 4/5] block: drop bdrv_prwv

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
27.05.2020 00:34, Eric Blake wrote: On 5/25/20 5:08 AM, Vladimir Sementsov-Ogievskiy wrote: Now, when we are not more paying extra code for coroutine wrappers, there no more sence in extra indirection layer: bdrv_prwv(). Let's drop it and instead genereate pure bdrv_preadv() and bdrv_pwritev().

Re: [PATCH v4 3/5] block: generate coroutine-wrapper code

2020-05-27 Thread Vladimir Sementsov-Ogievskiy
27.05.2020 00:30, Eric Blake wrote: On 5/25/20 5:07 AM, Vladimir Sementsov-Ogievskiy wrote: We have a very frequent pattern of creating coroutine from function with several arguments:    - create structure to pack parameters    - create _entry function to call original function taking

Re: [PATCH v4 3/5] virtio-scsi: default num_queues to -smp N

2020-05-27 Thread Daniel P . Berrangé
On Wed, May 27, 2020 at 11:29:23AM +0100, Stefan Hajnoczi wrote: > Automatically size the number of virtio-scsi-pci, vhost-scsi-pci, and > vhost-user-scsi-pci request virtqueues to match the number of vCPUs. > Other transports continue to default to 1 request virtqueue. IIRC this was raised on

[PATCH v4 4/5] virtio-blk: default num_queues to -smp N

2020-05-27 Thread Stefan Hajnoczi
Automatically size the number of virtio-blk-pci request virtqueues to match the number of vCPUs. Other transports continue to default to 1 request virtqueue. A 1:1 virtqueue:vCPU mapping ensures that completion interrupts are handled on the same vCPU that submitted the request. No IPI is

[PATCH v4 5/5] vhost-user-blk: default num_queues to -smp N

2020-05-27 Thread Stefan Hajnoczi
Automatically size the number of request virtqueues to match the number of vCPUs. This ensures that completion interrupts are handled on the same vCPU that submitted the request. No IPI is necessary to complete an I/O request and performance is improved. Signed-off-by: Stefan Hajnoczi

[PATCH v4 2/5] virtio-scsi: introduce a constant for fixed virtqueues

2020-05-27 Thread Stefan Hajnoczi
The event and control virtqueues are always present, regardless of the multi-queue configuration. Define a constant so that virtqueue number calculations are easier to read. Signed-off-by: Stefan Hajnoczi Reviewed-by: Cornelia Huck --- include/hw/virtio/virtio-scsi.h | 3 +++

[PATCH v4 3/5] virtio-scsi: default num_queues to -smp N

2020-05-27 Thread Stefan Hajnoczi
Automatically size the number of virtio-scsi-pci, vhost-scsi-pci, and vhost-user-scsi-pci request virtqueues to match the number of vCPUs. Other transports continue to default to 1 request virtqueue. A 1:1 virtqueue:vCPU mapping ensures that completion interrupts are handled on the same vCPU that

[PATCH v4 1/5] virtio-pci: add virtio_pci_optimal_num_queues() helper

2020-05-27 Thread Stefan Hajnoczi
Multi-queue devices achieve the best performance when each vCPU has a dedicated queue. This ensures that virtqueue used notifications are handled on the same vCPU that submitted virtqueue buffers. When another vCPU handles the the notification an IPI will be necessary to wake the submission vCPU

[PATCH v4 0/5] virtio-pci: enable blk and scsi multi-queue by default

2020-05-27 Thread Stefan Hajnoczi
v3: * Introduce virtio_pci_optimal_num_queues() helper to enforce VIRTIO_QUEUE_MAX in one place * Use VIRTIO_SCSI_VQ_NUM_FIXED constant in all cases [Cornelia] * Update hw/core/machine.c compat properties for QEMU 5.0 [Michael] v3: * Add new performance results that demonstrate the

Re: [PATCH v7 14/32] qcow2: Add QCow2SubclusterType and qcow2_get_subcluster_type()

2020-05-27 Thread Alberto Garcia
On Tue 26 May 2020 10:32:08 PM CEST, Eric Blake wrote: >> +/* The subcluster X [0..31] is allocated */ >> +#define QCOW_OFLAG_SUB_ALLOC(X) (1ULL << (X)) >> +/* The subcluster X [0..31] reads as zeroes */ >> +#define QCOW_OFLAG_SUB_ZERO(X)(QCOW_OFLAG_SUB_ALLOC(X) << 32) >> +/* Subclusters [X,

Re: [RFC PATCH 2/3] block: Allow bdrv_run_co() from different AioContext

2020-05-27 Thread Stefan Reiter
On 5/26/20 6:42 PM, Kevin Wolf wrote: Am 25.05.2020 um 18:41 hat Kevin Wolf geschrieben: Am 25.05.2020 um 16:18 hat Stefan Reiter geschrieben: On 5/12/20 4:43 PM, Kevin Wolf wrote: Coroutine functions that are entered through bdrv_run_co() are already safe to call from synchronous code in a

Re: [PATCH v3 4/9] qapi/misc: Restrict balloon-related commands to machine code

2020-05-27 Thread Philippe Mathieu-Daudé
On 5/27/20 6:49 AM, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > >> On 5/26/20 11:31 AM, Philippe Mathieu-Daudé wrote: >>> +Laurent >>> >>> On 5/26/20 11:04 AM, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: > On 5/26/20 9:38 AM, Markus Armbruster wrote: