[PATCH v2 1/1] module: Move local_err initialization to the loop in module_load_qom_all()

2024-08-12 Thread Alexander Ivanov
local_err variable is freed in error_report_err() so there is no any leak. Signed-off-by: Alexander Ivanov --- util/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/module.c b/util/module.c index 32e263163c..3eb0f06df1 100644 --- a/util/module.c +++ b/util

[PATCH v2 0/1] module: Move local_err initialization to the loop in module_load_qom_all()

2024-08-12 Thread Alexander Ivanov
odule: Prevent crash by resetting local_err in module_load_qom_all()" v2: Move local_err initialization inside the loop. Alexander Ivanov (1): module: Move local_err initialization to the loop in module_load_qom_all() util/module.c | 2 +- 1 file changed, 1 insertion(+),

Re: [PATCH 1/1] module: Prevent crash by resetting local_err in module_load_qom_all()

2024-08-12 Thread Alexander Ivanov
On 8/12/24 00:05, Richard Henderson wrote: On 8/9/24 22:13, Alexander Ivanov wrote: Set local_err to NULL after it has been freed in error_report_err(). This avoids triggering assert(*errp == NULL) failure in error_setv() when local_err is reused in the loop. Signed-off-by: Alexander Ivanov

[PATCH 0/1] module: Prevent crash by resetting local_err in module_load_qom_all()

2024-08-09 Thread Alexander Ivanov
After updating QEMU modules previously executed QEMU processes crash on module loading. It happens because error_setg() calls with a not NULL errp argument. There is a discussion - https://issues.redhat.com/browse/RHEL-29848 Alexander Ivanov (1): module: Prevent crash by resetting local_err in

[PATCH 1/1] module: Prevent crash by resetting local_err in module_load_qom_all()

2024-08-09 Thread Alexander Ivanov
Set local_err to NULL after it has been freed in error_report_err(). This avoids triggering assert(*errp == NULL) failure in error_setv() when local_err is reused in the loop. Signed-off-by: Alexander Ivanov --- util/module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/module.c b

Re: [PATCH v3] block: Use LVM tools for LV block device truncation

2024-06-28 Thread Alexander Ivanov
One more ping... On 3/15/24 09:58, Alexander Ivanov wrote: If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block device is DM and resize it executing lvresize. Signed-off

Re: [PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-06-28 Thread Alexander Ivanov
Ping? On 6/7/24 17:00, Alexander Ivanov wrote: static void nbd_blockdev_client_closed(NBDClient *client, bool ignored) { nbd_client_put(client); +if (nbd_server == NULL) { +return; +} assert(nbd_server->connections > 0); nbd_server->co

Re: [PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-06-18 Thread Alexander Ivanov
Hello Eric, Do you have any ideas about the bug? Thank you. On 6/10/24 14:33, Eric Blake wrote: On Sat, Jun 08, 2024 at 11:36:59AM GMT, Alexander Ivanov wrote: There is a bug reproducer in the attachment. Summarizing the reproducer, you are repeatedly calling QMP nbd-server-start/nbd-server

Re: [PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-06-10 Thread Alexander Ivanov
On 6/10/24 14:33, Eric Blake wrote: On Sat, Jun 08, 2024 at 11:36:59AM GMT, Alexander Ivanov wrote: There is a bug reproducer in the attachment. Summarizing the reproducer, you are repeatedly calling QMP nbd-server-start/nbd-server-stop on qemu as NBD server in one thread, and repeatedly

Re: [PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-06-08 Thread Alexander Ivanov
There is a bug reproducer in the attachment. On 6/7/24 17:00, Alexander Ivanov wrote: In some cases, the NBD server can be stopped before nbd_blockdev_client_closed() is called, causing the nbd_server variable to be nullified. This leads to a NULL pointer dereference when accessing nbd_server

[PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-06-07 Thread Alexander Ivanov
NULL pointer dereference. Signed-off-by: Alexander Ivanov --- blockdev-nbd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blockdev-nbd.c b/blockdev-nbd.c index 213012435f..fb1f30ae0d 100644 --- a/blockdev-nbd.c +++ b/blockdev-nbd.c @@ -52,6 +52,9 @@ int nbd_server_max_connections(void

Re: [PATCH v3] block: Use LVM tools for LV block device truncation

2024-06-04 Thread Alexander Ivanov
ping 2 On 3/15/24 09:58, Alexander Ivanov wrote: If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block device is DM and resize it executing lvresize. Signed-off-by

Re: [PATCH] qga: Add an interactive mode to guest-exec via VSOCK for Linux

2024-05-23 Thread Alexander Ivanov
On 5/22/24 18:10, Daniel P. Berrangé wrote: On Wed, May 22, 2024 at 05:06:57PM +0200, Alexander Ivanov wrote: Add an interactive mode to the guest-exec command in the QEMU Guest Agent using the VSOCK communication mechanism. It enables interactive sessions with the executed command in the

Test scripts

2024-05-22 Thread Alexander Ivanov
directory containing a copy of the script in VM. Execute the host script with net arguments: ./vsock_guest_exec_test.py srv -- Best regards, Alexander Ivanov #!/usr/bin/python3 import sys, os, struct, subprocess, json, socket TYPE_MASK = 0x8000 def parse_block_header(data): res

[PATCH] qga: Add an interactive mode to guest-exec via VSOCK for Linux

2024-05-22 Thread Alexander Ivanov
a transmitted to the server is redirected to stdin. Data from stdout and stderr is redirected to the client. All data blocks are preceded by 32-bit headers (network byte order): most significant bit contains a sign of stream (stdout - 0, stderr - 1), all the other bits contain the payload size. S

Re: [PATCH v2 11/11] iotests/271: add test cases for subcluster-based discard/unmap

2024-05-21 Thread Alexander Ivanov
ize=1048576 +write -q -P PATTERN 0 32k +L2 entry #0: 0x8005 +discard -q 32k 32k +file_do_fallocate fd=N mode=0x03 offset=360448 len=32768 +L2 entry #0: 0x8005 +write -q -P PATTERN 0 64k +L2 entry #0: 0x8005 +discard -q 0 8

Re: [PATCH v2 10/11] qcow2: zero_l2_subclusters: fall through to discard operation when requested

2024-05-21 Thread Alexander Ivanov
fset, nb_subclusters, &scri); if (ret < 0) { return ret; Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 09/11] qcow2: make subclusters discardable

2024-05-21 Thread Alexander Ivanov
# -# Test qcow2_cluster_discard() with full and normal discards +# Test qcow2_subcluster_discard() with full and normal discards for use_backing_file in yes no; do echo echo "### Discarding clusters with non-zero bitmaps (backing file: $use_backing_file) ###" Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 08/11] qcow2: zeroize the entire cluster when there're no non-zero subclusters

2024-05-21 Thread Alexander Ivanov
ubclusters(s, tail)); +ret = zero_l2_subclusters(bs, end_offset, + size_to_subclusters(s, tail), flags); if (ret < 0) { goto fail; } Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 07/11] qcow2: add get_sc_range_info() helper for working with subcluster ranges

2024-05-21 Thread Alexander Ivanov
->l2_table_cache, (void **) &l2_slice); - - return ret; +return 0; } int coroutine_fn qcow2_subcluster_zeroize(BlockDriverState *bs, uint64_t offset, Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 06/11] iotests/290: add test case to check 'discard-no-unref' option behavior

2024-05-21 Thread Alexander Ivanov
at images are still identical +Images are identical. +# Output of qemu-img map for the image with dropped reference +[{ "start": 0, "length": 65536, "depth": 0, "present": true, "zero": false, "data": true, "compressed": false, "offset": OFFSET}, +{ "start": 65536, "length": 65536, "depth": 0, "present": true, "zero": true, "data": false, "compressed": false}] +# Output of qemu-img map for the image with kept reference +[{ "start": 0, "length": 65536, "depth": 0, "present": true, "zero": false, "data": true, "compressed": false, "offset": OFFSET}, +{ "start": 65536, "length": 65536, "depth": 0, "present": true, "zero": true, "data": false, "compressed": false, "offset": OFFSET}] *** done Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 05/11] iotests/common.rc: add disk_usage function

2024-05-21 Thread Alexander Ivanov
1 "$1" | awk '{print $1}' +} + # Set the variables to the empty string to turn Valgrind off # for specific processes, e.g. # $ VALGRIND_QEMU_IO= ./check -qcow2 -valgrind 015 Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 04/11] block/file-posix: add trace event for fallocate() calls

2024-05-21 Thread Alexander Ivanov
t_off, int64_t bytes, int flags, int64_t ret) "bs %p src_fd %d offset %"PRIu64" dst_fd %d offset %"PRIu64" bytes %"PRIu64" flags %d ret %"PRId64 file_FindEjectableOpticalMedia(const char *media) "Matching using %s" file_setup_cdrom(const ch

Re: [PATCH v2 03/11] qcow2: put discard requests in the common queue when discard-no-unref enabled

2024-05-21 Thread Alexander Ivanov
, old_l2_entry & L2E_OFFSET_MASK, -s->cluster_size); +discard_no_unref_any_file(bs, old_l2_entry & L2E_OFFSET_MASK, + s->cluster_size, type, + QCOW2_DISCAR

Re: [PATCH v2 02/11] qcow2: simplify L2 entries accounting for discard-no-unref

2024-05-21 Thread Alexander Ivanov
} + if (old_l2_entry == new_l2_entry && old_l2_bitmap == new_l2_bitmap) { continue; } Reviewed-by: Alexander Ivanov -- Best regards, Alexander Ivanov

Re: [PATCH v2 01/11] qcow2: make function update_refcount_discard() global

2024-05-21 Thread Alexander Ivanov
x); void GRAPH_RDLOCK qcow2_process_discards(BlockDriverState *bs, int ret); +void qcow2_queue_discard(BlockDriverState *bs, uint64_t offset, + uint64_t length); int GRAPH_RDLOCK qcow2_check_metadata_overlap(BlockDriverState *bs, int ign, int64_t offset, Reviewed-by:

Re: [PATCH v3] block: Use LVM tools for LV block device truncation

2024-05-10 Thread Alexander Ivanov
ping Is there any update of the patch status? Thank you. On 3/15/24 09:58, Alexander Ivanov wrote: If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block device is DM and

[PATCH v5] blockcommit: Reopen base image as RO after abort

2024-04-04 Thread Alexander Ivanov
image is in RW mode at the end of blockcommit and was in RO mode before blockcommit, reopen the base BDS in RO. Signed-off-by: Alexander Ivanov Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/mirro

[PATCH v4] blockcommit: Reopen base image as RO after abort

2024-03-28 Thread Alexander Ivanov
image is in RW mode at the end of blockcommit and was in RO mode before blockcommit, reopen the base BDS in RO. Signed-off-by: Alexander Ivanov --- block/mirror.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 1bdce3b657.

Re: [PATCH v3] blockcommit: Reopen base image as RO after abort

2024-03-15 Thread Alexander Ivanov
On 2/28/24 17:48, Vladimir Sementsov-Ogievskiy wrote: On 09.02.24 15:29, Alexander Ivanov wrote: Could you please review the patch? Sorry for long delay. Honestly, I don't like refcnt in block-driver. It violate incapsulation, refcnt is interal thing of common block layer. And act

[PATCH v3] block: Use LVM tools for LV block device truncation

2024-03-15 Thread Alexander Ivanov
If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block device is DM and resize it executing lvresize. Signed-off-by: Alexander Ivanov --- block/file-posix.c | 61

Re: [PATCH v2] block: Use LVM tools for LV block device truncation

2024-03-14 Thread Alexander Ivanov
On 3/14/24 13:44, Daniel P. Berrangé wrote: On Wed, Mar 13, 2024 at 11:43:27AM +0100, Alexander Ivanov wrote: If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block

[PATCH v2] block: Use LVM tools for LV block device truncation

2024-03-13 Thread Alexander Ivanov
If a block device is an LVM logical volume we can resize it using standard LVM tools. Add a helper to detect if a device is a DM device. In raw_co_truncate() check if the block device is DM and resize it executing lvresize. Signed-off-by: Alexander Ivanov --- block/file-posix.c | 61

Re: [PATCH] block: Use LVM tools for LV block device truncation

2024-03-12 Thread Alexander Ivanov
Thank you for the review. On 3/11/24 19:24, Daniel P. Berrangé wrote: On Mon, Mar 11, 2024 at 06:40:44PM +0100, Alexander Ivanov wrote: If a block device is an LVM logical volume we can resize it using standard LVM tools. In raw_co_truncate() check if the block device is a LV using lvdisplay

[PATCH v5 09/22] parallels: Add a note about used bitmap in parallels_check_duplicate()

2024-03-11 Thread Alexander Ivanov
In parallels_check_duplicate() We use a bitmap for duplication detection. This bitmap is not related to used_bmap field in BDRVParallelsState. Add a comment about it to avoid confusion. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 5 - 1 file changed

[PATCH v5 17/22] parallels: Reverse a conditional in parallels_check_leak() to reduce indents

2024-03-11 Thread Alexander Ivanov
Let the function return a success code if a file size is not bigger than image_end_offset. Thus we can decrease indents in the next code block. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 72 +++ 1 file changed

[PATCH v5 22/22] tests: Add parallels format support to image-fleecing

2024-03-11 Thread Alexander Ivanov
Use a different bitmap name for parallels images because their has own ID format, and can't contain an arbitrary string. Replace hardcoded 'qcow2' format to iotests.imgfmt. Add 'parallels' to supported formats. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/

[PATCH v5 21/22] tests: Turned on 256, 299, 304 and block-status-cache for parallels format

2024-03-11 Thread Alexander Ivanov
These tests pass with parallels format. Add parallels to supporting formats for these tests. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/256 | 2 +- tests/qemu-iotests/299 | 2 +- tests/qemu-iotests/304 | 2 +- tests/qemu

[PATCH v5 20/22] tests: Add parallels images support to test 165

2024-03-11 Thread Alexander Ivanov
Use a different bitmap name for parallels images because their has own ID format, and can't contain an arbitrary string. Replace image reopen by shutdown/launch VM because parallels images doesn't support reopen. Signed-off-by: Alexander Ivanov --- tests/qemu-iotest

[PATCH v5 08/22] parallels: Recreate used bitmap in parallels_check_leak()

2024-03-11 Thread Alexander Ivanov
In parallels_check_leak() file can be truncated. In this case the used bitmap would not comply to the file. Recreate the bitmap after file truncation. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 8 1 file changed, 8 insertions(+) diff --git a

[PATCH v5 16/22] parallels: Make a loaded dirty bitmap persistent

2024-03-11 Thread Alexander Ivanov
After bitmap loading the bitmap is not persistent and is removed on image saving. Set bitmap persistence to true. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels-ext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels-ext.c b/block/parallels

[PATCH v5 15/22] parallels: Handle L1 entries equal to one

2024-03-11 Thread Alexander Ivanov
If all the bits in a dirty bitmap cluster are ones, the cluster shouldn't be written. Instead the corresponding L1 entry should be set to 1. Check if all bits in a memory region are ones and set 1 to L1 entries corresponding clusters filled with ones. Signed-off-by: Alexander Ivanov ---

[PATCH v5 04/22] parallels: Limit search in parallels_mark_used to the last marked claster

2024-03-11 Thread Alexander Ivanov
There is no necessity to search to the end of the bitmap. Limit the search area as cluster_index + count. Add cluster_end variable to avoid its calculation in a few places. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 9 + 1 file changed, 5

[PATCH v5 02/22] parallels: Move inactivation code to a separate function

2024-03-11 Thread Alexander Ivanov
We are going to add parallels image extensions storage and need a separate function for inactivation code. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/block

[PATCH v5 19/22] parallels: Remove unnecessary data_end field

2024-03-11 Thread Alexander Ivanov
ready called for all such clusters. Signed-off-by: Alexander Ivanov --- block/parallels.c | 45 + block/parallels.h | 1 - 2 files changed, 13 insertions(+), 33 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index fd80179642..11b6f

[PATCH v5 07/22] parallels: Set data_end value in parallels_check_leak()

2024-03-11 Thread Alexander Ivanov
In parallels_check_leak() we change file size but don't correct data_end field of BDRVParallelsState structure. Fix it. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parall

[PATCH v5 13/22] parallels: Let image extensions work in RW mode

2024-03-11 Thread Alexander Ivanov
Now we support extensions saving and can let to work with them in read-write mode. Place dirty bitmap loading after used bitmap initialization - in the next patch we will work with used bitmap during dirty bitmap loading. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 4

[PATCH v5 11/22] parallels: Add dirty bitmaps saving

2024-03-11 Thread Alexander Ivanov
Now dirty bitmaps can be loaded but there is no their saving. Add code for dirty bitmap storage. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 187 ++ block/parallels.c | 16 +++- block/parallels.h | 5 ++ 3 files changed, 206

[PATCH v5 03/22] parallels: Make mark_used() a global function

2024-03-11 Thread Alexander Ivanov
We will need this function and a function for marking unused clusters (will be added in the next patch) in parallels-ext.c too. Let it be a global function parallels_mark_used(). Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 14 -- block

[PATCH v5 10/22] parallels: Create used bitmap even if checks needed

2024-03-11 Thread Alexander Ivanov
All the checks were fixed to work with used bitmap. Create used bitmap in parallels_open() even if need_check is true. In some checks (like duplication check) we need to work with used bitmap so it have to be created before checks are running. Signed-off-by: Alexander Ivanov --- block

[PATCH v5 01/22] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap()

2024-03-11 Thread Alexander Ivanov
After used bitmap freeng s->used_bmap points to the freed memory. If we try to free used bitmap one more time it leads to double free error. Set s->used_bmap to NULL to exclude double free error. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 1 +

[PATCH v5 18/22] parallels: Check unused clusters in parallels_check_leak()

2024-03-11 Thread Alexander Ivanov
because it will be used during work. At image inactivation we can skip it. Signed-off-by: Alexander Ivanov --- block/parallels.c | 106 +- 1 file changed, 68 insertions(+), 38 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 5155b8ac48

[PATCH v5 06/22] parallels: Move host clusters allocation to a separate function

2024-03-11 Thread Alexander Ivanov
. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 123 +- block/parallels.h | 3 ++ 2 files changed, 71 insertions(+), 55 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 13726fb3d5..c6d82961c9

[PATCH v5 12/22] parallels: drop dirty bitmap data if the image was not properly closed

2024-03-11 Thread Alexander Ivanov
From: "Denis V. Lunev" This data is obsolete. The approach is exactly the same like we use with QCOW2. Signed-off-by: Denis V. Lunev --- block/parallels-ext.c | 8 1 file changed, 8 insertions(+) diff --git a/block/parallels-ext.c b/block/parallels-ext.c index 9cb8e65c0d..7fa14b057d

[PATCH v5 05/22] parallels: Add parallels_mark_unused() helper

2024-03-11 Thread Alexander Ivanov
Add a helper to set unused areas in the used bitmap. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 18 ++ block/parallels.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/block/parallels.c b/block/parallels.c index 4470519656

[PATCH v5 00/22] parallels: Add full dirty bitmap support

2024-03-11 Thread Alexander Ivanov
ixed clusters leaks. 15: Fixed (end_off != s->used_bmap_size) handling in parallels_truncate_unused_clusters(). 16,17: Changed the sequence of the patches - in this way we have correct leaks check. Alexander Ivanov (21): parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap()

[PATCH v5 14/22] parallels: Preserve extensions cluster for non-transient extensions

2024-03-11 Thread Alexander Ivanov
There could be non-transient extensions that require presence of the extensions cluster during work. Mark extensions cluster as used at extensions loading end nullify l1 tables of dirty bitmaps. Use this cluster at dirty bitmap saving if it exists. Signed-off-by: Alexander Ivanov --- block

[PATCH] block: Use LVM tools for LV block device truncation

2024-03-11 Thread Alexander Ivanov
If a block device is an LVM logical volume we can resize it using standard LVM tools. In raw_co_truncate() check if the block device is a LV using lvdisplay and resize it executing lvresize. Signed-off-by: Alexander Ivanov --- block/file-posix.c | 27 +++ 1 file changed

Re: [PATCH v4 13/21] parallels: Handle L1 entries equal to one

2024-02-29 Thread Alexander Ivanov
On 1/18/24 14:37, Denis V. Lunev wrote: On 12/28/23 11:12, Alexander Ivanov wrote: If all the bits in a dirty bitmap cluster are ones, the cluster shouldn't be written. Instead the corresponding L1 entry should be set to 1. Check if all bits in a memory region are ones and set 1

Re: [PATCH v4 12/21] parallels: Let image extensions work in RW mode

2024-02-28 Thread Alexander Ivanov
On 1/18/24 14:31, Denis V. Lunev wrote: On 1/16/24 15:45, Denis V. Lunev wrote: On 12/28/23 11:12, Alexander Ivanov wrote: Now we support extensions saving and can let to work with them in read-write mode. Signed-off-by: Alexander Ivanov ---   block/parallels-ext.c |  4   block

Re: [PATCH v3] blockcommit: Reopen base image as RO after abort

2024-02-09 Thread Alexander Ivanov
Could you please review the patch? On 1/30/24 10:14, Alexander Ivanov wrote: If a blockcommit is aborted the base image remains in RW mode, that leads to a fail of subsequent live migration. How to reproduce: $ virsh snapshot-create-as vm snp1 --disk-only *** write something to the disk

Re: [PATCH v4 11/21] parallels: Add dirty bitmaps saving

2024-02-07 Thread Alexander Ivanov
On 1/18/24 14:27, Denis V. Lunev wrote: On 12/28/23 11:12, Alexander Ivanov wrote: Now dirty bitmaps can be loaded but there is no their saving. Add code for dirty bitmap storage. Signed-off-by: Alexander Ivanov ---   block/parallels-ext.c | 168

[PATCH v3] blockcommit: Reopen base image as RO after abort

2024-01-30 Thread Alexander Ivanov
in RO in this case. Signed-off-by: Alexander Ivanov --- block/mirror.c | 38 -- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 5145eb53e1..52a7fee75e 100644 --- a/block/mirror.c +++ b/block/mirror.c

[PATCH v2] blockcommit: Reopen base image as RO after abort

2024-01-09 Thread Alexander Ivanov
se image in RO mode in mirror_exit_common() if the blockjob is aborted and the base image was opened in RO mode before the blockcommit. Signed-off-by: Alexander Ivanov --- block/mirror.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/mirror.c b/block/mir

[PATCH v4 13/21] parallels: Handle L1 entries equal to one

2023-12-28 Thread Alexander Ivanov
If all the bits in a dirty bitmap cluster are ones, the cluster shouldn't be written. Instead the corresponding L1 entry should be set to 1. Check if all bits in a memory region are ones and set 1 to L1 entries corresponding clusters filled with ones. Signed-off-by: Alexander Ivanov ---

[PATCH v4 10/21] parallels: Create used bitmap even if checks needed

2023-12-28 Thread Alexander Ivanov
All the checks were fixed to work with used bitmap. Create used bitmap in parallels_open() even if need_check is true. Signed-off-by: Alexander Ivanov --- block/parallels.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index

[PATCH v4 20/21] tests: Turned on 256, 299, 304 and block-status-cache for parallels format

2023-12-28 Thread Alexander Ivanov
These tests pass with parallels format. Add parallels to supporting formats for these tests. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/256 | 2 +- tests/qemu-iotests/299 | 2 +- tests/qemu-iotests/304 | 2 +- tests/qemu

[PATCH v4 12/21] parallels: Let image extensions work in RW mode

2023-12-28 Thread Alexander Ivanov
Now we support extensions saving and can let to work with them in read-write mode. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 4 block/parallels.c | 17 - 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/block/parallels-ext.c b/block

[PATCH v4 14/21] parallels: Make a loaded dirty bitmap persistent

2023-12-28 Thread Alexander Ivanov
After bitmap loading the bitmap is not persistent and is removed on image saving. Set bitmap persistence to true. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels-ext.c b/block/parallels-ext.c index 033ca3ec3a

[PATCH v4 17/21] parallels: Check unused clusters in parallels_check_leak()

2023-12-28 Thread Alexander Ivanov
Since we have used bitmap, leak check is useless. Transform parallels_truncate_unused_clusters() to parallels_check_unused_clusters() helper and use it in leak check. Signed-off-by: Alexander Ivanov --- block/parallels.c | 121 +- 1 file changed, 67

[PATCH v4 05/21] parallels: Add parallels_mark_unused() helper

2023-12-28 Thread Alexander Ivanov
Add a helper to set unused areas in the used bitmap. Signed-off-by: Alexander Ivanov --- block/parallels.c | 18 ++ block/parallels.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/block/parallels.c b/block/parallels.c index 4470519656..13726fb3d5 100644 --- a/block

[PATCH v4 04/21] parallels: Limit search in parallels_mark_used to the last marked claster

2023-12-28 Thread Alexander Ivanov
There is no necessity to search to the end of the bitmap. Limit the search area as cluster_index + count. Add cluster_end variable to avoid its calculation in a few places. Signed-off-by: Alexander Ivanov --- block/parallels.c | 9 + 1 file changed, 5 insertions(+), 4 deletions

[PATCH v4 21/21] tests: Add parallels format support to image-fleecing

2023-12-28 Thread Alexander Ivanov
Use a different bitmap name for parallels images because their has own ID format, and can't contain an arbitrary string. Replace hardcoded 'qcow2' format to iotests.imgfmt. Add 'parallels' to supported formats. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/

[PATCH v4 19/21] tests: Add parallels images support to test 165

2023-12-28 Thread Alexander Ivanov
Use a different bitmap name for parallels images because their has own ID format, and can't contain an arbitrary string. Replace image reopen by shutdown/launch VM because parallels images doesn't support reopen. Signed-off-by: Alexander Ivanov --- tests/qemu-iotest

[PATCH v4 11/21] parallels: Add dirty bitmaps saving

2023-12-28 Thread Alexander Ivanov
Now dirty bitmaps can be loaded but there is no their saving. Add code for dirty bitmap storage. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 168 ++ block/parallels.c | 16 +++- block/parallels.h | 5 ++ 3 files changed, 187

[PATCH v4 09/21] parallels: Add a note about used bitmap in parallels_check_duplicate()

2023-12-28 Thread Alexander Ivanov
In parallels_check_duplicate() We use a bitmap for duplication detection. This bitmap is not related to used_bmap field in BDRVParallelsState. Add a comment about it to avoid confusion. Signed-off-by: Alexander Ivanov --- block/parallels.c | 5 - 1 file changed, 4 insertions(+), 1 deletion

[PATCH v4 02/21] parallels: Move inactivation code to a separate function

2023-12-28 Thread Alexander Ivanov
We are going to add parallels image extensions storage and need a separate function for inactivation code. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/block

[PATCH v4 08/21] parallels: Recreate used bitmap in parallels_check_leak()

2023-12-28 Thread Alexander Ivanov
In parallels_check_leak() file can be truncated. In this case the used bitmap would not comply to the file. Recreate the bitmap after file truncation. Signed-off-by: Alexander Ivanov --- block/parallels.c | 8 1 file changed, 8 insertions(+) diff --git a/block/parallels.c b/block

[PATCH v4 18/21] parallels: Remove unnecessary data_end field

2023-12-28 Thread Alexander Ivanov
Since we have used bitmap, field data_end in BDRVParallelsState is redundant and can be removed. Add parallels_data_end() helper and remove data_end handling. Signed-off-by: Alexander Ivanov --- block/parallels.c | 33 + block/parallels.h | 1 - 2 files changed

[PATCH v4 15/21] parallels: Reverse a conditional in parallels_check_leak() to reduce indents

2023-12-28 Thread Alexander Ivanov
Let the function return a success code if a file size is not bigger than image_end_offset. Thus we can decrease indents in the next code block. Signed-off-by: Alexander Ivanov --- block/parallels.c | 72 +++ 1 file changed, 36 insertions(+), 36

[PATCH v4 06/21] parallels: Move host clusters allocation to a separate function

2023-12-28 Thread Alexander Ivanov
. Signed-off-by: Alexander Ivanov --- block/parallels.c | 128 -- block/parallels.h | 3 ++ 2 files changed, 71 insertions(+), 60 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 13726fb3d5..658902ae51 100644 --- a/block/parallels.c

[PATCH v4 16/21] parallels: Truncate images on the last used cluster

2023-12-28 Thread Alexander Ivanov
On an image closing there can be unused clusters in the end of the image. Truncate these clusters and update data_end field. Signed-off-by: Alexander Ivanov --- block/parallels.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block

[PATCH v4 03/21] parallels: Make mark_used() a global function

2023-12-28 Thread Alexander Ivanov
We will need this function and a function for marking unused clusters (will be added in the next patch) in parallels-ext.c too. Let it be a global function parallels_mark_used(). Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 14 -- block

[PATCH v4 00/21] parallels: Add full dirty bitmap support

2023-12-28 Thread Alexander Ivanov
orrect leaks check. Alexander Ivanov (21): parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap() parallels: Move inactivation code to a separate function parallels: Make mark_used() a global function parallels: Limit search in parallels_mark_used to the last marked

[PATCH v4 07/21] parallels: Set data_end value in parallels_check_leak()

2023-12-28 Thread Alexander Ivanov
In parallels_check_leak() we change file size but don't correct data_end field of BDRVParallelsState structure. Fix it. Signed-off-by: Alexander Ivanov --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index 658902ae51..8a6e2

[PATCH v4 01/21] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap()

2023-12-28 Thread Alexander Ivanov
After used bitmap freeng s->used_bmap points to the freed memory. If we try to free used bitmap one more time it leads to double free error. Set s->used_bmap to NULL to exclude double free error. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 1 +

Re: [PATCH 01/21] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap()

2023-12-28 Thread Alexander Ivanov
Sorry, incorrect patch set, please ignore. On 12/28/23 10:41, Alexander Ivanov wrote: After used bitmap freeng s->used_bmap points to the freed memory. If we try to free used bitmap one more time it leads to double free error. Set s->used_bmap to NULL to exclude double free error. Sign

[PATCH 16/21] parallels: Truncate images on the last used cluster

2023-12-28 Thread Alexander Ivanov
On an image closing there can be unused clusters in the end of the image. Truncate these clusters and update data_end field. Signed-off-by: Alexander Ivanov --- block/parallels.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/block/parallels.c b/block

[PATCH 03/21] parallels: Make mark_used() a global function

2023-12-28 Thread Alexander Ivanov
We will need this function and a function for marking unused clusters (will be added in the next patch) in parallels-ext.c too. Let it be a global function parallels_mark_used(). Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 14 -- block

[PATCH 12/21] parallels: Let image extensions work in RW mode

2023-12-28 Thread Alexander Ivanov
Now we support extensions saving and can let to work with them in read-write mode. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 4 block/parallels.c | 17 - 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/block/parallels-ext.c b/block

[PATCH 08/21] parallels: Recreate used bitmap in parallels_check_leak()

2023-12-28 Thread Alexander Ivanov
In parallels_check_leak() file can be truncated. In this case the used bitmap would not comply to the file. Recreate the bitmap after file truncation. Signed-off-by: Alexander Ivanov --- block/parallels.c | 8 1 file changed, 8 insertions(+) diff --git a/block/parallels.c b/block

[PATCH 07/21] parallels: Set data_end value in parallels_check_leak()

2023-12-28 Thread Alexander Ivanov
In parallels_check_leak() we change file size but don't correct data_end field of BDRVParallelsState structure. Fix it. Signed-off-by: Alexander Ivanov --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index 658902ae51..8a6e2

[PATCH 02/21] parallels: Move inactivation code to a separate function

2023-12-28 Thread Alexander Ivanov
We are going to add parallels image extensions storage and need a separate function for inactivation code. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/block

[PATCH 21/21] tests: Add parallels format support to image-fleecing

2023-12-28 Thread Alexander Ivanov
Use a different bitmap name for parallels images because their has own ID format, and can't contain an arbitrary string. Replace hardcoded 'qcow2' format to iotests.imgfmt. Add 'parallels' to supported formats. Signed-off-by: Alexander Ivanov --- tests/qemu-iotests/

[PATCH 19/21] tests: Add parallels images support to test 165

2023-12-28 Thread Alexander Ivanov
Use a different bitmap name for parallels images because their has own ID format, and can't contain an arbitrary string. Replace image reopen by shutdown/launch VM because parallels images doesn't support reopen. Signed-off-by: Alexander Ivanov --- tests/qemu-iotest

[PATCH 01/21] parallels: Set s->used_bmap to NULL in parallels_free_used_bitmap()

2023-12-28 Thread Alexander Ivanov
After used bitmap freeng s->used_bmap points to the freed memory. If we try to free used bitmap one more time it leads to double free error. Set s->used_bmap to NULL to exclude double free error. Signed-off-by: Alexander Ivanov Reviewed-by: Denis V. Lunev --- block/parallels.c | 1 +

[PATCH 17/21] parallels: Check unused clusters in parallels_check_leak()

2023-12-28 Thread Alexander Ivanov
Since we have used bitmap, leak check is useless. Transform parallels_truncate_unused_clusters() to parallels_check_unused_clusters() helper and use it in leak check. Signed-off-by: Alexander Ivanov --- block/parallels.c | 121 +- 1 file changed, 67

[PATCH 11/21] parallels: Add dirty bitmaps saving

2023-12-28 Thread Alexander Ivanov
Now dirty bitmaps can be loaded but there is no their saving. Add code for dirty bitmap storage. Signed-off-by: Alexander Ivanov --- block/parallels-ext.c | 168 ++ block/parallels.c | 16 +++- block/parallels.h | 5 ++ 3 files changed, 187

[PATCH 10/21] parallels: Create used bitmap even if checks needed

2023-12-28 Thread Alexander Ivanov
All the checks were fixed to work with used bitmap. Create used bitmap in parallels_open() even if need_check is true. Signed-off-by: Alexander Ivanov --- block/parallels.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index

[PATCH 18/21] parallels: Remove unnecessary data_end field

2023-12-28 Thread Alexander Ivanov
Since we have used bitmap, field data_end in BDRVParallelsState is redundant and can be removed. Add parallels_data_end() helper and remove data_end handling. Signed-off-by: Alexander Ivanov --- block/parallels.c | 33 + block/parallels.h | 1 - 2 files changed

  1   2   3   4   5   6   >