Re: [PATCH v3 6/6] throttle: use enum ThrottleType instead of bool is_write

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: enum ThrottleType is already there, use ThrottleType instead of 'bool is_write' for throttle API, also modify related codes from block, fsdev, cryptodev and tests. Signed-off-by: zhenwei pi --- backends/cryptodev.c| 9 + block/throttle-gr

Re: [PATCH v3 2/6] test-throttle: use enum ThrottleType

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Use enum ThrottleType instead in the throttle test codes. Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v3 4/6] test-throttle: test read only and write only

2023-07-21 Thread Hanna Czenczek
On 13.07.23 08:41, zhenwei pi wrote: Reviewed-by: Alberto Garcia Signed-off-by: zhenwei pi --- tests/unit/test-throttle.c | 66 ++ 1 file changed, 66 insertions(+) Reviewed-by: Hanna Czenczek

Re: [PATCH v3 3/6] throttle: support read-only and write-only

2023-07-21 Thread Hanna Czenczek
ould be shorter as `timer = tt->timers[is_write ? THROTTLE_WRITE : THROTTLE_READ];`. Anyway, I only have style suggestion to offer, so either way: Reviewed-by: Hanna Czenczek +assert(timer); + must_wait = throttle_compute_timer(ts, is_write, now,

Re: [PATCH v3 5/6] cryptodev: use NULL throttle timer cb for read direction

2023-07-21 Thread Hanna Czenczek
REALTIME, NULL, cryptodev_backend_throttle_timer_cb, backend); } With the typo in the commit message fixed: Reviewed-by: Hanna Czenczek

Re: [PATCH v3 1/6] throttle: introduce enum ThrottleType

2023-07-21 Thread Hanna Czenczek
after patch 3.  Still, optional, of course, so either way: Reviewed-by: Hanna Czenczek Of note is that we still have instances in util/throttle.c and block/throttle-groups.c that don’t use these enums to access the tt->timers[] array, and that’s a bit unfortunate now (i.e. `tt->timers[is_

Re: [PATCH 6/6] vhost-user: Have reset_status fall back to reset

2023-07-21 Thread Hanna Czenczek
On 20.07.23 18:03, Stefan Hajnoczi wrote: On Wed, Jul 19, 2023 at 04:27:58PM +0200, Hanna Czenczek wrote: On 19.07.23 16:11, Hanna Czenczek wrote: On 18.07.23 17:10, Stefan Hajnoczi wrote: On Tue, Jul 11, 2023 at 05:52:28PM +0200, Hanna Czenczek wrote: The only user of

[PATCH] virtio: Fix packed virtqueue used_idx mask

2023-07-21 Thread Hanna Czenczek
index outside of virtio_queue_packed_get_last_avail_idx(), where we reconstruct the 32-bit value from avail and used indices and their wrap counters again. There, it does not matter whether the highest bit of the used_idx is the used index wrap counter, because we put the wrap counter exactly in that position anyway. Signed-off-by

Re: [Virtio-fs] [PATCH v2 2/4] vhost-user: Interface for migration state transfer

2023-07-21 Thread Hanna Czenczek
On 20.07.23 17:05, Hao Xu wrote: On 7/20/23 21:20, Hanna Czenczek wrote: On 20.07.23 14:13, Hao Xu wrote: On 7/12/23 19:17, Hanna Czenczek wrote: Add the interface for transferring the back-end's state during migration as defined previously in vhost-user.rst. Signed-off-by: Hanna Cze

[PATCH] block: Be more verbose in create fallback

2023-07-20 Thread Hanna Czenczek
ink: https://bugzilla.redhat.com/show_bug.cgi?id=2217204 Signed-off-by: Hanna Czenczek --- block.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index a307c151a8..f530dd9c02 100644 --- a/block.c +++ b/block.c @@ -661,8 +661,10 @@ int coroutine_fn bdrv_co_create_o

Re: [Virtio-fs] [PATCH v2 2/4] vhost-user: Interface for migration state transfer

2023-07-20 Thread Hanna Czenczek
On 20.07.23 14:13, Hao Xu wrote: On 7/12/23 19:17, Hanna Czenczek wrote: Add the interface for transferring the back-end's state during migration as defined previously in vhost-user.rst. Signed-off-by: Hanna Czenczek ---   include/hw/virtio/vhost-backend.h |  24 +   include/hw/v

Re: [PATCH v2 3/4] vhost: Add high-level state save/load functions

2023-07-20 Thread Hanna Czenczek
On 18.07.23 20:42, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 01:17:01PM +0200, Hanna Czenczek wrote: vhost_save_backend_state() and vhost_load_backend_state() can be used by vhost front-ends to easily save and load the back-end's state to/from the migration stream. Because we do not

Re: [Virtio-fs] [PATCH v2 1/4] vhost-user.rst: Migrating back-end-internal state

2023-07-20 Thread Hanna Czenczek
On 18.07.23 18:12, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 01:16:59PM +0200, Hanna Czenczek wrote: @@ -1471,6 +1511,53 @@ Front-end message types before. The back-end must again begin processing rings that are not stopped, and it may resume background operations

Re: [PATCH v2 1/4] vhost-user.rst: Migrating back-end-internal state

2023-07-19 Thread Hanna Czenczek
On 18.07.23 17:57, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 01:16:59PM +0200, Hanna Czenczek wrote: For vhost-user devices, qemu can migrate the virtio state, but not the back-end's internal state. To do so, we need to be able to transfer this internal state between front-end (qemu

Re: [PATCH 6/6] vhost-user: Have reset_status fall back to reset

2023-07-19 Thread Hanna Czenczek
On 19.07.23 16:11, Hanna Czenczek wrote: On 18.07.23 17:10, Stefan Hajnoczi wrote: On Tue, Jul 11, 2023 at 05:52:28PM +0200, Hanna Czenczek wrote: The only user of vhost_user_reset_status() is vhost_dev_stop(), which only uses it as a fall-back to stop the back-end if it does not support

Re: [PATCH 6/6] vhost-user: Have reset_status fall back to reset

2023-07-19 Thread Hanna Czenczek
On 18.07.23 17:10, Stefan Hajnoczi wrote: On Tue, Jul 11, 2023 at 05:52:28PM +0200, Hanna Czenczek wrote: The only user of vhost_user_reset_status() is vhost_dev_stop(), which only uses it as a fall-back to stop the back-end if it does not support SUSPEND. However, vhost-user's implement

Re: [PATCH 5/6] vhost-vdpa: Match vhost-user's status reset

2023-07-19 Thread Hanna Czenczek
On 18.07.23 16:50, Stefan Hajnoczi wrote: On Tue, Jul 11, 2023 at 05:52:27PM +0200, Hanna Czenczek wrote: vhost-vdpa and vhost-user differ in how they reset the status in their respective vhost_reset_status implementations: vhost-vdpa zeroes it, then re-adds the S_ACKNOWLEDGE and S_DRIVER

Re: [PATCH 1/6] vhost-user.rst: Add suspend/resume

2023-07-19 Thread Hanna Czenczek
On 18.07.23 16:25, Stefan Hajnoczi wrote: On Tue, Jul 11, 2023 at 05:52:23PM +0200, Hanna Czenczek wrote: When stopping the VM, qemu wants all devices to fully cease any operation, too. Currently, we can only have vhost-user back-ends stop processing vrings, but not background operations. Add

Re: [PATCH] vhost-user.rst: Clarify enabling/disabling vrings

2023-07-19 Thread Hanna Czenczek
On 18.07.23 17:26, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 11:17:04AM +0200, Hanna Czenczek wrote: Currently, the vhost-user documentation says that rings are to be initialized in a disabled state when VHOST_USER_F_PROTOCOL_FEATURES is negotiated. However, by the time of feature

[PATCH v2] block: Fix pad_request's request restriction

2023-07-14 Thread Hanna Czenczek
er Maydell Fixes: 18743311b829cafc1737a5f20bc3248d5f91ee2a ("block: Collapse padded I/O vecs exceeding IOV_MAX") Signed-off-by: Hanna Czenczek --- v2: - Added paragraph to the commit message to express explicitly that this patch will not change guest-visible behavior - (No code c

Re: [PATCH] block: Fix pad_request's request restriction

2023-07-12 Thread Hanna Czenczek
On 12.07.23 16:15, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 09:41:05AM +0200, Hanna Czenczek wrote: On 11.07.23 22:23, Stefan Hajnoczi wrote: On Fri, Jun 09, 2023 at 10:33:16AM +0200, Hanna Czenczek wrote: bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX,

Re: [PATCH] vhost-user.rst: Clarify enabling/disabling vrings

2023-07-12 Thread Hanna Czenczek
On 12.07.23 13:17, Michael S. Tsirkin wrote: On Wed, Jul 12, 2023 at 11:17:04AM +0200, Hanna Czenczek wrote: Currently, the vhost-user documentation says that rings are to be initialized in a disabled state when VHOST_USER_F_PROTOCOL_FEATURES is negotiated. However, by the time of feature

[PATCH v2 2/4] vhost-user: Interface for migration state transfer

2023-07-12 Thread Hanna Czenczek
Add the interface for transferring the back-end's state during migration as defined previously in vhost-user.rst. Signed-off-by: Hanna Czenczek --- include/hw/virtio/vhost-backend.h | 24 + include/hw/virtio/vhost.h | 79 hw/virtio/vhost-user.c

[PATCH v2 3/4] vhost: Add high-level state save/load functions

2023-07-12 Thread Hanna Czenczek
, and writes each chunk consecutively into the migration stream, prefixed by its length. EOF is indicated by a 0-length chunk. Signed-off-by: Hanna Czenczek --- include/hw/virtio/vhost.h | 35 +++ hw/virtio/vhost.c | 204 ++ 2 files changed, 239 inser

[PATCH v2 1/4] vhost-user.rst: Migrating back-end-internal state

2023-07-12 Thread Hanna Czenczek
VICE_STATE, which on the destination side includes checking for integrity (i.e. errors during deserialization). Suggested-by: Stefan Hajnoczi Signed-off-by: Hanna Czenczek --- docs/interop/vhost-user.rst | 87 + 1 file changed, 87 insertions(+) diff --git a/do

[PATCH v2 4/4] vhost-user-fs: Implement internal migration

2023-07-12 Thread Hanna Czenczek
ernal migration, it can be disabled. Signed-off-by: Hanna Czenczek --- hw/virtio/vhost-user-fs.c | 101 +- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c index 49d699ffc2..2b30f3d442 100644

[PATCH v2 0/4] vhost-user: Back-end state migration

2023-07-12 Thread Hanna Czenczek
old patch 1, which I dropped.) Hanna Czenczek (4): vhost-user.rst: Migrating back-end-internal state vhost-user: Interface for migration state transfer vhost: Add high-level state save/load functions vhost-user-fs: Implement internal migration docs/interop/vhost-user.rst

[PATCH] vhost-user.rst: Clarify enabling/disabling vrings

2023-07-12 Thread Hanna Czenczek
n the documentation. Signed-off-by: Hanna Czenczek --- docs/interop/vhost-user.rst | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 5a070adbc1..ca0e899765 100644 --- a/docs/interop/vhost-user.rst +++ b

Re: [PATCH] block: Fix pad_request's request restriction

2023-07-12 Thread Hanna Czenczek
On 11.07.23 22:23, Stefan Hajnoczi wrote: On Fri, Jun 09, 2023 at 10:33:16AM +0200, Hanna Czenczek wrote: bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX, which bdrv_check_qiov_request() does not guarantee. bdrv_check_request32() however will guarantee this, and bo

[PATCH 2/6] vhost-vdpa: Move vhost_vdpa_reset_status() up

2023-07-11 Thread Hanna Czenczek
The next commit is going to have vhost_vdpa_dev_start() call this, so move it up to have the declaration where we are going to need it. Signed-off-by: Hanna Czenczek --- hw/virtio/vhost-vdpa.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw

[PATCH 6/6] vhost-user: Have reset_status fall back to reset

2023-07-11 Thread Hanna Czenczek
ESET_DEVICE and RESET_OWNER should remain valid as fall-backs. Therefore, have vhost_user_reset_status() fall back to vhost_user_reset_device() if the back-end has no STATUS support. Signed-off-by: Hanna Czenczek --- hw/virtio/vhost-user.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/virt

[PATCH 5/6] vhost-vdpa: Match vhost-user's status reset

2023-07-11 Thread Hanna Czenczek
therefore it makes more sense to keep the status field fully cleared until the back-end is re-started, which is how vhost-user does it. Make vhost-vdpa do the same -- if nothing else it's confusing to have both vhost implementations handle this differently. Signed-off-by: Hanna Czenczek --

[PATCH 4/6] vhost-user: Implement suspend/resume

2023-07-11 Thread Hanna Czenczek
Implement SUSPEND/RESUME like vDPA does, by automatically using it in vhost_user_dev_start(). (Though our vDPA code does not implement RESUME yet, so there, the device is reset when it is to be resumed.) Signed-off-by: Hanna Czenczek --- hw/virtio/vhost-user.c | 99

[PATCH 0/6] vhost-user: Add suspend/resume

2023-07-11 Thread Hanna Czenczek
-vdpa code currently does not make use of RESUME, it is actually always used for vhost-vdpa (to take the device out of a suspended state). Hanna Czenczek (6): vhost-user.rst: Add suspend/resume vhost-vdpa: Move vhost_vdpa_reset_status() up vhost: Do not reset suspended devices on stop

[PATCH 1/6] vhost-user.rst: Add suspend/resume

2023-07-11 Thread Hanna Czenczek
l the device is resumed, which is why this patch specifies handling of kicks as it does. Signed-off-by: Hanna Czenczek --- docs/interop/vhost-user.rst | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/docs/interop/vhost-user.rst b/docs/in

[PATCH 3/6] vhost: Do not reset suspended devices on stop

2023-07-11 Thread Hanna Czenczek
for back-ends that do not support suspend. Unfortunately, for vDPA specifically, RESUME is not yet implemented, so when the device is re-started, we still have to do the reset to have it un-suspend. Signed-off-by: Hanna Czenczek --- include/hw/virtio/vhost-vdpa.h | 2 -- include/hw/virtio/vhos

Re: [PATCH] block: Fix pad_request's request restriction

2023-07-10 Thread Hanna Czenczek
On 09.06.23 10:33, Hanna Czenczek wrote: bdrv_pad_request() relies on requests' lengths not to exceed SIZE_MAX, which bdrv_check_qiov_request() does not guarantee. bdrv_check_request32() however will guarantee this, and both of bdrv_pad_request()'s callers (bdrv_co_preadv_

Re: [PATCH v5 5/5] parallels: Image repairing in parallels_open()

2023-06-09 Thread Hanna Czenczek
On 09.06.23 15:21, Alexander Ivanov wrote: On 6/2/23 16:59, Hanna Czenczek wrote: On 29.05.23 17:15, Alexander Ivanov wrote: Repair an image at opening if the image is unclean or out-of-image corruption was detected. Signed-off-by: Alexander Ivanov ---   block/parallels.c | 65

[PATCH] block: Fix pad_request's request restriction

2023-06-09 Thread Hanna Czenczek
Peter Maydell Fixes: 18743311b829cafc1737a5f20bc3248d5f91ee2a ("block: Collapse padded I/O vecs exceeding IOV_MAX") Signed-off-by: Hanna Czenczek --- block/io.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/block/io.c b/block/io.c index 30748f0b59.

Re: [PULL 02/17] block: Collapse padded I/O vecs exceeding IOV_MAX

2023-06-09 Thread Hanna Czenczek
On 08.06.23 11:52, Peter Maydell wrote: On Mon, 5 Jun 2023 at 16:48, Hanna Czenczek wrote: When processing vectored guest requests that are not aligned to the storage request alignment, we pad them by adding head and/or tail buffers for a read-modify-write cycle. Hi; Coverity complains (CID

Re: [PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-07 Thread Hanna Czenczek
On 07.06.23 08:51, Michael Tokarev wrote: 05.06.2023 18:45, Hanna Czenczek wrote: From: Alexander Ivanov data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or

Release of RSD (Rust QSD) 0.1

2023-06-07 Thread Hanna Czenczek
Hi everyone! I’ve just released the first version (0.1) of RSD, which is a proof-of-concept to rewrite the qemu-storage-daemon (QSD) and thus the qemu block layer in Rust: https://gitlab.com/hreitz/rsd https://gitlab.com/hreitz/rsd/-/releases/v0.1 We’ve been talking for quite a long time abo

Re: [PULL 02/17] block: Collapse padded I/O vecs exceeding IOV_MAX

2023-06-06 Thread Hanna Czenczek
On 06.06.23 10:00, Michael Tokarev wrote: 05.06.2023 18:45, Hanna Czenczek wrote: When processing vectored guest requests that are not aligned to the storage request alignment, we pad them by adding head and/or tail buffers for a read-modify-write cycle. The guest can submit I/O vectors up to

[PULL 00/17] Block patches

2023-06-05 Thread Hanna Czenczek
parate function parallels: Fix statistics calculation parallels: Move check of leaks to a separate function parallels: Move statistic collection to a separate function parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD parallels: Incorrect condition in out-of-image check Hanna Czenczek

[PULL 10/17] parallels: Move check of unclean image to a separate function

2023-06-05 Thread Hanna Czenczek
: <20230424093147.197643-7-alexander.iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index fa8a

[PULL 05/17] parallels: Out of image offset in BAT leads to image inflation

2023-06-05 Thread Hanna Czenczek
iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 17 + 1 file changed, 17 insertions(+) diff --git a/block/parallels.c b/block/parallels.c index d8a3f13e24..7b6d770f8e 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -733,6

[PULL 17/17] qcow2: add discard-no-unref option

2023-06-05 Thread Hanna Czenczek
u/-/issues/1621 Signed-off-by: Jean-Louis Dupond Message-Id: <20230605084523.34134-2-jean-lo...@dupond.be> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- qapi/block-core.json | 12 block/qcow2.h | 3 +++ block/qcow2-cluster.c | 32 +++

[PULL 14/17] parallels: Move statistic collection to a separate function

2023-06-05 Thread Hanna Czenczek
: <20230424093147.197643-11-alexander.iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 52 +++ 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/block/parallels.c b/block/paral

[PULL 16/17] parallels: Incorrect condition in out-of-image check

2023-06-05 Thread Hanna Czenczek
From: Alexander Ivanov All the offsets in the BAT must be lower than the file size. Fix the check condition for correct check. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Message-Id: <20230424093147.197643-13-alexander.iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek

[PULL 07/17] parallels: Fix image_end_offset and data_end after out-of-image check

2023-06-05 Thread Hanna Czenczek
ed-by: Denis V. Lunev Message-Id: <20230424093147.197643-4-alexander.iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index

[PULL 03/17] util/iov: Remove qemu_iovec_init_extended()

2023-06-05 Thread Hanna Czenczek
(), which might also benefit its pre-existing users. Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Czenczek Message-Id: <20230411173418.19549-4-hre...@redhat.com> --- include/qemu/iov.h | 5 --- util/iov.c

[PULL 09/17] parallels: Use generic infrastructure for BAT writing in parallels_co_check()

2023-06-05 Thread Hanna Czenczek
iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index db6426e5f9..fa8a56a948 100644 --- a/block/parallels.c +++ b

[PULL 13/17] parallels: Move check of leaks to a separate function

2023-06-05 Thread Hanna Czenczek
wed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 74 --- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index fd1e2860d0..ba766e5e86 100644 --- a/block/parallels.c +++ b

[PULL 01/17] util/iov: Make qiov_slice() public

2023-06-05 Thread Hanna Czenczek
qiov_slice() itself, thus get the number of elements, and also create an iovec array with the superfluous prefixing elements stripped, so the following processing functions no longer need to skip them.) Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Czenczek

[PULL 08/17] parallels: create parallels_set_bat_entry_helper() to assign BAT value

2023-06-05 Thread Hanna Czenczek
com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index ea382e8382..db6426e5f9 100644 --- a/block/parallels.c +++ b/block/parallels.c @@

[PULL 12/17] parallels: Fix statistics calculation

2023-06-05 Thread Hanna Czenczek
From: Alexander Ivanov Exclude out-of-image clusters from allocated and fragmented clusters calculation. Signed-off-by: Alexander Ivanov Message-Id: <20230424093147.197643-9-alexander.iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels

[PULL 06/17] parallels: Fix high_off calculation in parallels_co_check()

2023-06-05 Thread Hanna Czenczek
viewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 7b6d770f8e..204d20685b 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -462,12 +462,12 @@ pa

[PULL 15/17] parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD

2023-06-05 Thread Hanna Czenczek
From: Alexander Ivanov Replace the way we use mutex in parallels_co_check() for simplier and less error prone code. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev Message-Id: <20230424093147.197643-12-alexander.iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-

[PULL 11/17] parallels: Move check of cluster outside image to a separate function

2023-06-05 Thread Hanna Czenczek
iva...@virtuozzo.com> Reviewed-by: Hanna Czenczek Signed-off-by: Hanna Czenczek --- block/parallels.c | 75 +++ 1 file changed, 49 insertions(+), 26 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 94b7408b6b..7f0f72e879 100644

[PULL 02/17] block: Collapse padded I/O vecs exceeding IOV_MAX

2023-06-05 Thread Hanna Czenczek
gzilla.redhat.com/show_bug.cgi?id=2141964 Signed-off-by: Hanna Czenczek Message-Id: <20230411173418.19549-3-hre...@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 166 - 1 file changed, 151 insertions(+), 15 deletions

[PULL 04/17] iotests/iov-padding: New test

2023-06-05 Thread Hanna Czenczek
Test that even vectored IO requests with 1024 vector elements that are not aligned to the device's request alignment will succeed. Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Hanna Czenczek Message-Id: <20230411173418.19549-5-hre...@redhat.com>

Re: [PATCH v3] qcow2: add discard-no-unref option

2023-06-05 Thread Hanna Czenczek
files changed, 73 insertions(+), 4 deletions(-) Thanks! Reviewed-by: Hanna Czenczek

Re: [PATCH v2] qcow2: add discard-no-unref option

2023-06-02 Thread Hanna Czenczek
On 02.06.23 14:47, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Especially on VM's that do a lot of writes/deletes. This causes the qcow2 image to grow even over 110% of its

Re: [PATCH v5 5/5] parallels: Image repairing in parallels_open()

2023-06-02 Thread Hanna Czenczek
d even reuse that where migrate_add_blocker() fails. Anyway, not wrong as-is, just suggestion, so: Reviewed-by: Hanna Czenczek +error_setg_errno(errp, -ret, "Could not repair corrupted image"); +goto fail; +} +} + return 0; fail_format:

Re: [PATCH v5 4/5] parallels: Replace fprintf by qemu_log in check

2023-06-02 Thread Hanna Czenczek
On 29.05.23 17:15, Alexander Ivanov wrote: If the check is called during normal work, tracking of the check must be present in VM logs to have some clues if something going wrong with user's data. I understand stderr counts as part of the VM log, doesn’t it?  I thought stderr is generally logg

Re: [PATCH v5 1/5] parallels: Incorrect data end calculation in parallels_open()

2023-06-02 Thread Hanna Czenczek
le changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v5 3/5] parallels: Add checking and repairing duplicate offsets in BAT

2023-06-02 Thread Hanna Czenczek
On 29.05.23 17:15, Alexander Ivanov wrote: Cluster offsets must be unique among all the BAT entries. Find duplicate offsets in the BAT and fix it by copying the content of the relevant cluster to a newly allocated cluster and set the new cluster offset to the duplicated entry. Add host_cluster_i

Re: [PATCH v5 2/5] parallels: Split image leak handling to separate check and fix helpers

2023-06-02 Thread Hanna Czenczek
On 29.05.23 17:15, Alexander Ivanov wrote: We need to fix leak after deduplication in the next patch. Move leak fixing to a separate helper parallels_fix_leak() and add parallels_get_leak_size() helper wich used in parallels_fix_leak() and parallels_check_leak(). Signed-off-by: Alexander Ivanov

Re: [PATCH] qcow2: add discard-no-unref option

2023-06-02 Thread Hanna Czenczek
On 01.06.23 14:56, Jean-Louis Dupond wrote: On 31/05/2023 17:05, Hanna Czenczek wrote: On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM'

Re: Using json: in common.rc's TEST_IMG

2023-06-01 Thread Hanna Czenczek
On 31.05.23 21:09, Stefan Hajnoczi wrote: Another issue is that 145 uses $TEST_IMG as follows: SYSEMU_DRIVE_ARG=if=none,file="$TEST_IMG",driver=$IMGFMT That doesn't work when json: contains a comma, since commas need to be doubled up to escape them. This fails: $ qemu-system-x86_64 -driv

Re: [PATCH] qcow2: add discard-no-unref option

2023-05-31 Thread Hanna Czenczek
On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's that do a lot of writes/deletes. This causes the qcow2 image to grow even over 110% of its virt

Re: [PATCH] qcow2: add discard-no-unref option

2023-05-31 Thread Hanna Czenczek
On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's s/. Surely/, especially/ that do a lot of writes/deletes. This causes the qcow2 image to gr

Re: [PATCH] qcow2: add discard-no-unref option

2023-05-31 Thread Hanna Czenczek
On 26.05.23 16:30, Jean-Louis Dupond wrote: On 26/05/2023 15:31, Hanna Czenczek wrote: [...] I don’t follow how this patch is cleaner than the “block: Add zeroes discard option” patch.  That patch’s diff stat is +14/-5, this one’s is 120+/57-. Multiple reasons :) - It's made for thi

Re: [PATCH] qcow2: add discard-no-unref option

2023-05-26 Thread Hanna Czenczek
On 15.05.23 09:36, Jean-Louis Dupond wrote: When we for example have a sparse qcow2 image and discard: unmap is enabled, there can be a lot of fragmentation in the image after some time. Surely on VM's that do a lot of writes/deletes. This causes the qcow2 image to grow even over 110% of its virt

Re: [PATCH v3 05/19] cutils: Fix wraparound parsing in qemu_strtoui

2023-05-23 Thread Hanna Czenczek
gh to be low priority, R-b dropped --- tests/unit/test-cutils.c | 20 +--- util/cutils.c| 25 +++-- 2 files changed, 28 insertions(+), 17 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v3 04/19] test-cutils: Test more integer corner cases

2023-05-23 Thread Hanna Czenczek
int err; +/* 1 less than -ULONG_MAX */ +str = ULONG_MAX == UINT_MAX ? "-4294967296" : "-18446744073709551616"; +endptr = "somewhere"; +res = 999; err = qemu_strtoul(str, &endptr, 0, &res); +g_assert_cmpint(err, ==, -ERANGE); +g_assert_cmpint(res, ==, ULONG_MAX); Should be g_assert_cmpuint(). Reviewed-by: Hanna Czenczek

Re: [PATCH v2 09/19] test-cutils: Add coverage of qemu_strtod

2023-05-22 Thread Hanna Czenczek
On 19.05.23 19:52, Eric Blake wrote: On Fri, May 19, 2023 at 05:05:20PM +0200, Hanna Czenczek wrote: On 12.05.23 04:10, Eric Blake wrote: It's hard to tweak code for consistency if I can't prove what will or won't break from those tweaks. Time to add unit tests for qe

Re: [PATCH v2 19/19] cutils: Improve qemu_strtosz handling of fractions

2023-05-19 Thread Hanna Czenczek
anna] --- tests/unit/test-cutils.c | 50 +----- util/cutils.c| 89 ++-- 2 files changed, 86 insertions(+), 53 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v2 17/19] cutils: Use parse_uint in qemu_strtosz for negative rejection

2023-05-19 Thread Hanna Czenczek
cified. Must be between 0 and 9223372036854775807. qemu-img: Unknown file format 'foo' == Size calculation for a new file (human) == With that squashed in: Reviewed-by: Hanna Czenczek

Re: [PATCH v2 15/19] cutils: Set value in all qemu_strtosz* error paths

2023-05-19 Thread Hanna Czenczek
is significant enough that I doropped Hanna's R-b --- tests/unit/test-cutils.c | 106 +++ util/cutils.c| 17 +-- 2 files changed, 63 insertions(+), 60 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v2 14/19] test-cutils: Add more coverage to qemu_strtosz11;rgb:1e1e/1e1e/1e1e

2023-05-19 Thread Hanna Czenczek
ll do_strtosz*() with a NULL str – did you intent for this to go into patch 12? Regardless (with the subject fixed, though): Reviewed-by: Hanna Czenczek

Re: [PATCH v2 12/19] cutils: Allow NULL str in qemu_strtosz

2023-05-19 Thread Hanna Czenczek
| 3 +++ util/cutils.c| 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v2 11/19] test-cutils: Refactor qemu_strtosz tests for less boilerplate

2023-05-19 Thread Hanna Czenczek
27;m not too worried about it. Signed-off-by: Eric Blake --- tests/unit/test-cutils.c | 503 --- 1 file changed, 100 insertions(+), 403 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v2 09/19] test-cutils: Add coverage of qemu_strtod

2023-05-19 Thread Hanna Czenczek
tually expect EINVAL, but understand that’s a personal preference.  (Same for the _finite_ variant) Reviewed-by: Hanna Czenczek +str = "1e-999junk"; +endptr = "somewhere"; +res = 999; +err = qemu_strtod(str, &endptr, &res); +g_assert_cmpint(err

Re: [PATCH v2 07/19] cutils: Adjust signature of parse_uint[_full]

2023-05-19 Thread Hanna Czenczek
'; -char *endptr; +uint64_t i; +const char *endptr = "somewhere"; The initialization here is technically not necessary because it’s reset above the parse_uint() call below. Anyway: Reviewed-by: Hanna Czenczek const char *str; int r; i = 999; -en

Re: [PATCH v2 08/19] cutils: Allow NULL endptr in parse_uint()

2023-05-19 Thread Hanna Czenczek
ls.c| 34 -- 2 files changed, 28 insertions(+), 24 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v2 06/19] cutils: Document differences between parse_uint and qemu_strtou64

2023-05-19 Thread Hanna Czenczek
1 file changed, 12 insertions(+), 8 deletions(-) Reviewed-by: Hanna Czenczek

Re: [PATCH v2 05/19] cutils: Fix wraparound parsing in qemu_strtoui

2023-05-19 Thread Hanna Czenczek
-cutils.c | 11 +-- util/cutils.c| 14 ++ 2 files changed, 15 insertions(+), 10 deletions(-) Reviewed-by: Hanna Czenczek diff --git a/util/cutils.c b/util/cutils.c index 5887e744140..997ddcd09e5 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -466,10 +466,16 @@ int qemu

Re: [PATCH v2 04/19] test-cutils: Test more integer corner cases

2023-05-19 Thread Hanna Czenczek
On 12.05.23 04:10, Eric Blake wrote: We have quite a few undertested and underdocumented integer parsing corner cases. To ensure that any changes we make in the code are intentional rather than accidental semantic changes, it is time to add more unit tests of existing behavior. In particular, t

Re: [RFC PATCH] QCOW2: Add zeroes discard option

2023-05-10 Thread Hanna Czenczek
Thanks for the patch! As a note for hopefully many future patches ( :) ), you should run scripts/checkpatch.pl on them to check for coding style issues. Here, it reports two lines that are longer than 80 characters. Second, ideally, patches are not just sent to the qemu-devel list, but also

Re: [PATCH 11/11] cutils: Improve qemu_strtosz handling of fractions

2023-05-10 Thread Hanna Czenczek
On 10.05.23 09:46, Hanna Czenczek wrote: On 09.05.23 23:28, Eric Blake wrote: [...] But I think the solution to that is not to treat underflow as valf = 0, but rather to alter this snippet: -    valf = (uint64_t)(fraction * 0x1p64); +    /* + * If fraction was

Re: [PATCH 11/11] cutils: Improve qemu_strtosz handling of fractions

2023-05-10 Thread Hanna Czenczek
On 09.05.23 23:28, Eric Blake wrote: On Tue, May 09, 2023 at 07:54:30PM +0200, Hanna Czenczek wrote: On 08.05.23 22:03, Eric Blake wrote: We have several limitations and bugs worth fixing; they are inter-related enough that it is not worth splitting this patch into smaller pieces: * &quo

Re: [PATCH 00/11] Fix qemu_strtosz() read-out-of-bounds

2023-05-09 Thread Hanna Czenczek
unit/test-cutils.c | 1213 ++ util/cutils.c| 180 -- 3 files changed, 1090 insertions(+), 314 deletions(-) Patches 1 – 5, 7 – 10: Reviewed-by: Hanna Czenczek

Re: [PATCH 11/11] cutils: Improve qemu_strtosz handling of fractions

2023-05-09 Thread Hanna Czenczek
On 08.05.23 22:03, Eric Blake wrote: We have several limitations and bugs worth fixing; they are inter-related enough that it is not worth splitting this patch into smaller pieces: * ".5k" should work to specify 512, just as "0.5k" does * "1.k" and "1." + "9"*50 + "k" should both produce the

Re: [PATCH 06/11] test-cutils: Add more coverage to qemu_strtosz

2023-05-09 Thread Hanna Czenczek
On 08.05.23 22:03, Eric Blake wrote: Add some more strings that the user might send our way. In particular, some of these additions include FIXME comments showing where our parser doesn't quite behave the way we want. Signed-off-by: Eric Blake --- tests/unit/test-cutils.c | 226 +

Re: [PATCH 06/11] test-cutils: Add more coverage to qemu_strtosz

2023-05-09 Thread Hanna Czenczek
On 09.05.23 14:31, Hanna Czenczek wrote: On 08.05.23 22:03, Eric Blake wrote: Add some more strings that the user might send our way.  In particular, some of these additions include FIXME comments showing where our parser doesn't quite behave the way we want. Signed-off-by: Eric

Re: [PATCH 06/11] test-cutils: Add more coverage to qemu_strtosz

2023-05-09 Thread Hanna Czenczek
On 08.05.23 22:03, Eric Blake wrote: Add some more strings that the user might send our way. In particular, some of these additions include FIXME comments showing where our parser doesn't quite behave the way we want. Signed-off-by: Eric Blake --- tests/unit/test-cutils.c | 226 +

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-05-09 Thread Hanna Czenczek
On 09.05.23 08:31, Eugenio Perez Martin wrote: On Mon, May 8, 2023 at 9:12 PM Stefan Hajnoczi wrote: [...] VHOST_USER_GET_VRING_BASE itself isn't really enough because it stops a specific virtqueue but not the whole device. Unfortunately stopping all virtqueues is not the same as SUSPEND sin

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-05-09 Thread Hanna Czenczek
On 08.05.23 21:31, Eugenio Perez Martin wrote: On Mon, May 8, 2023 at 7:51 PM Eugenio Perez Martin wrote: On Mon, May 8, 2023 at 7:00 PM Hanna Czenczek wrote: On 05.05.23 16:37, Hanna Czenczek wrote: On 05.05.23 16:26, Eugenio Perez Martin wrote: On Fri, May 5, 2023 at 11:51 AM Hanna

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-05-09 Thread Hanna Czenczek
On 08.05.23 23:10, Stefan Hajnoczi wrote: On Fri, May 05, 2023 at 02:51:55PM +0200, Hanna Czenczek wrote: On 05.05.23 11:53, Eugenio Perez Martin wrote: On Fri, May 5, 2023 at 11:03 AM Hanna Czenczek wrote: On 04.05.23 23:14, Stefan Hajnoczi wrote: On Thu, 4 May 2023 at 13:39, Hanna

<    1   2   3   4   >