[PATCH 6/5] qemu-nbd: make verbose bool and local variable in main()

2023-07-17 Thread Denis V. Lunev
Pass 'verbose' to nbd_client_thread() inside NbdClientOpts which looks a little bit cleaner and make it bool as it is used as bool actually. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy --- qemu-nbd.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions

Re: [PATCH v7 8/8] parallels: Add data_off check

2023-07-17 Thread Denis V. Lunev
On 7/1/23 12:07, Alexander Ivanov wrote: data_off field of the parallels image header can be corrupted. Check if this field greater than the header + BAT size and less than file size. Change checking code in parallels_open() accordingly. Signed-off-by: Alexander Ivanov This patch requires a

Re: [PATCH v7 7/8] parallels: Use bdrv_co_getlength() in parallels_check_outside_image()

2023-07-17 Thread Denis V. Lunev
>bs); +size = bdrv_co_getlength(bs->file->bs); if (size < 0) { res->check_errors++; return size; Reviewed-by: Denis V. Lunev

Re: [PATCH v7 6/8] parallels: Image repairing in parallels_open()

2023-07-17 Thread Denis V. Lunev
: +/* + * "s" object was allocated by g_malloc0 so we can safely + * try to free its fields even they were not allocated. + */ +error_free(s->migration_blocker); +g_free(s->bat_dirty_bmap); qemu_vfree(s->header); return ret; } Reviewed-by: Denis V. Lunev

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

2023-07-17 Thread Denis V. Lunev
BdrvCheckMode fix) @@ -580,6 +719,11 @@ parallels_co_check(BlockDriverState *bs, BdrvCheckResult *res, return ret; } +ret = parallels_check_duplicate(bs, res, fix); +if (ret < 0) { + return ret; +} + parallels_collect_statistics(bs, res, fix); } with old_repare_bat replaced with old_repair_bat: Reviewed-by: Denis V. Lunev

Re: [PATCH v7 4/8] parallels: Add data_start field to BDRVParallelsState

2023-07-17 Thread Denis V. Lunev
alloc_size; ParallelsPreallocMode prealloc_mode; Reviewed-by: Denis V. Lunev

Re: [PATCH v7 3/8] parallels: Add "explicit" argument to parallels_check_leak()

2023-07-17 Thread Denis V. Lunev
count; +if (explicit) { +res->leaks_fixed += count; +} } } @@ -570,7 +575,7 @@ parallels_co_check(BlockDriverState *bs, BdrvCheckResult *res, return ret; } -ret = parallels_check_leak(bs, res, fix); + ret = parallels_check_leak(bs, res, fix, true); if (ret < 0) { return ret; } Reviewed-by: Denis V. Lunev

Re: [PATCH v7 2/8] parallels: Check if data_end greater than the file size

2023-07-17 Thread Denis V. Lunev
if (ret < 0) { With comment line truncated to 74 chars: Reviewed-by: Denis V. Lunev

[PATCH 1/5] qemu-nbd: pass structure into nbd_client_thread instead of plain char*

2023-07-17 Thread Denis V. Lunev
We are going to pass additional flag inside next patch. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: --- qemu-nbd.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 4276163564

[PATCH 5/5] qemu-nbd: handle dup2() error when qemu-nbd finished setup process

2023-07-17 Thread Denis V. Lunev
Fail on error, we are in trouble. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy --- qemu-nbd.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index f27613cb57..cd0e965705 100644 --- a/qemu-nbd.c +++ b

[PATCH 3/5] qemu-nbd: properly report error on error in dup2() after qemu_daemon()

2023-07-17 Thread Denis V. Lunev
We are trying to temporary redirect stderr of daemonized process to a pipe to report a error and get failed. In that case we could not use error_report() helper, but should write the message directly into the problematic pipe. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov

[PATCH v2 0/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-17 Thread Denis V. Lunev
Patches 3-5 are not necessary for stable, I believe. Changes from v1: * added patch 1, necessary to pass fork_process into nbd_client_thread * tweaked comment in patch 2 a bit * added patches 3-5 with error handling improvements Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir

[PATCH 2/5] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-17 Thread Denis V. Lunev
. This also leads to proper 'ssh' connection closing which fixes my original problem. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: Hanna Reitz CC: --- qemu-nbd.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/qemu-nbd.c b/qemu

[PATCH 4/5] qemu-nbd: properly report error if qemu_daemon() is failed

2023-07-17 Thread Denis V. Lunev
errno has been overwritten by dup2() just below qemu_daemon() and thus improperly returned to the caller. Fix accordingly. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy --- qemu-nbd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu

Re: [PATCH 1/1] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-17 Thread Denis V. Lunev
On 7/14/23 17:35, Eric Blake wrote: On Thu, Jul 06, 2023 at 09:15:45PM +0200, Denis V. Lunev wrote: Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d Author: Hanna Reitz Date: Wed May 8 23:18:18 2019 +0200 qemu-nbd: Do not close stderr has introduced an interesting regression

Re: [PATCH 1/1] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-14 Thread Denis V. Lunev
On 7/14/23 17:35, Eric Blake wrote: On Thu, Jul 06, 2023 at 09:15:45PM +0200, Denis V. Lunev wrote: Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d Author: Hanna Reitz Date: Wed May 8 23:18:18 2019 +0200 qemu-nbd: Do not close stderr has introduced an interesting regression

Re: [ping] [PATCH 1/1] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-14 Thread Denis V. Lunev
On 7/6/23 21:15, Denis V. Lunev wrote: Commit e6df58a5578fee7a50bbf36f4a50a2781cff855d Author: Hanna Reitz Date: Wed May 8 23:18:18 2019 +0200 qemu-nbd: Do not close stderr has introduced an interesting regression. Original behavior of ssh somehost qemu-nbd /home/den/tmp

Re: [PATCH v2 3/3] qemu-iotests: update expected tests output to contain "compressed" field

2023-07-12 Thread Denis V. Lunev
On 7/6/23 18:30, Andrey Drobyshev wrote: The previous commit adds "compressed" boolean field to JSON output of "qemu-img map" command. Let's tweak expected tests output accordingly. Signed-off-by: Andrey Drobyshev --- tests/qemu-iotests/122.out| 84

Re: [PATCH v2 2/3] qemu-img: map: report compressed data blocks

2023-07-12 Thread Denis V. Lunev
if (ret < 0) { goto out; } @@ -3338,7 +3348,7 @@ static int img_map(int argc, char **argv) curr = next; } -ret = dump_map_entry(output_format, , NULL); +ret = dump_map_entry(output_format, , NULL, can_compress); if (output_format == OFORMAT_JSON) { puts("]"); } Reviewed-by: Denis V. Lunev

Re: [PATCH v2 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()

2023-07-12 Thread Denis V. Lunev
0x20 #define BDRV_BLOCK_RECURSE 0x40 +#define BDRV_BLOCK_COMPRESSED 0x80 typedef QTAILQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue; Reviewed-by: Denis V. Lunev

Re: [PATCH 3/3] tests/qemu-iotests/197: add testcase for CoR with subclusters

2023-07-11 Thread Denis V. Lunev
TEST_DIR/t.IMGFMT +read 4096/4096 bytes at offset 30720 +4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Offset Length File +0 0x7000 TEST_DIR/t.IMGFMT +0x7000 0x2000 TEST_DIR/t.wrap.IMGFMT +0x9000 0x7000 TEST_DIR/t.IMGFMT +No errors were found on the image. *** done Reviewed-by: Denis V. Lunev

Re: [PATCH 2/3] block/io: align requests to subcluster_size

2023-07-11 Thread Denis V. Lunev
_clusters(BlockDriverState *bs, +void bdrv_round_to_subclusters(BlockDriverState *bs, int64_t offset, int64_t bytes, int64_t *cluster_offset, int64_t *cluster_bytes); Reviewed-by: Denis V. Lunev

Re: [PATCH 1/3] block: add subcluster_size field to BlockDriverInfo

2023-07-11 Thread Denis V. Lunev
* A fraction of cluster_size, if supported (currently QCOW2 only); if + * disabled or unsupported, set equal to cluster_size. + */ +int subcluster_size; /* offset at which the VM state can be saved (0 if not possible) */ int64_t vm_state_offset; bool is_dirty; Reviewed-by: Denis V. Lunev

[PATCH 1/1] qemu-nbd: fix regression with qemu-nbd --fork run over ssh

2023-07-06 Thread Denis V. Lunev
fixes my original problem. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy CC: Hanna Reitz --- qemu-nbd.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 4276163564..e9e118dfdb 100644 --- a/qemu-nbd.c +++ b

Re: [PATCH 2/3] qemu-img: map: report compressed data blocks

2023-07-06 Thread Denis V. Lunev
On 7/6/23 15:10, Andrey Drobyshev wrote: On 6/21/23 21:12, Denis V. Lunev wrote: On 6/7/23 17:26, Andrey Drobyshev wrote: Right now "qemu-img map" reports compressed blocks as containing data but having no host offset.  This is not very informative.  Instead, let's add another boo

Re: [PATCH 0/6] qemu-img: rebase: add compression support

2023-06-30 Thread Denis V. Lunev
On 6/1/23 21:28, Andrey Drobyshev wrote: This series is adding [-c | --compress] option to "qemu-img rebase" command, which might prove useful for saving some disk space when, for instance, manipulating chains of backup images. Along the way I had to make a couple of minor improvements. The

Re: [PATCH 6/6] iotests: add test 314 for "qemu-img rebase" with compression

2023-06-21 Thread Denis V. Lunev
sec) +read 16777216/16777216 bytes at offset 16777216 +16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 16777216/16777216 bytes at offset 33554432 +16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +No errors were found on the image. +512/768 = 66.67% allocated, 100.00% fragmented, 100.00% compressed clusters +Image end offset: 458752 + +=== Testing compressed rebase with unaligned unmerged data === + +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=65536 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=65536 backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT +wrote 32767/32767 bytes at offset 0 +31.999 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 32767/32767 bytes at offset 0 +31.999 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 32769/32769 bytes at offset 32767 +32.001 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +No errors were found on the image. +1/1 = 100.00% allocated, 100.00% fragmented, 100.00% compressed clusters +Image end offset: 393216 + +*** done Reviewed-by: Denis V. Lunev

Re: [PATCH 4/6] qemu-img: rebase: avoid unnecessary COW operations

2023-06-21 Thread Denis V. Lunev
written += pnum; +if (offset + written >= old_backing_size) { +old_backing_eof = true; + } } qemu_progress_print(local_progress, 100); } With or without minors: Reviewed-by: Denis V. Lunev

Re: [PATCH 2/6] qemu-iotests: 024: add rebasing test case for overlay_size > backing_size

2023-06-21 Thread Denis V. Lunev
in the same chain + +Verify that data is read the same before and after rebase + +read 262144/262144 bytes at offset 0 +256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 262144 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + *** done For the clarity: Reviewed-by: Denis V. Lunev

Re: [PATCH 1/6] qemu-img: rebase: stop when reaching EOF of old backing file

2023-06-21 Thread Denis V. Lunev
* Now we will need to explicitly zero the cluster in + * order to preserve that state after the rebase. + */ +n = bytes; +} } /* for the clarity: Reviewed-by: Denis V. Lunev

Re: [PATCH 5/6] qemu-img: add compression option to rebase subcommand

2023-06-21 Thread Denis V. Lunev
t, end - start, - buf_old + (start - offset), 0); + buf_old + (start - offset), + write_flags); pnum = end - (offset + written); } if (ret < 0) { Anyway, for both variants, Reviewed-by: Denis V. Lunev

Re: [PATCH 3/6] qemu-img: rebase: use backing files' BlockBackend for buffer alignment

2023-06-21 Thread Denis V. Lunev
ld_backing, IO_BUF_SIZE); +buf_new = blk_blockalign(blk_new_backing, IO_BUF_SIZE); size = blk_getlength(blk); if (size < 0) { Reviewed-by: Denis V. Lunev

Re: [PATCH 2/3] qemu-img: map: report compressed data blocks

2023-06-21 Thread Denis V. Lunev
On 6/7/23 17:26, Andrey Drobyshev wrote: Right now "qemu-img map" reports compressed blocks as containing data but having no host offset. This is not very informative. Instead, let's add another boolean field named "compressed" in case JSON output mode is specified. This is achieved by

Re: [PATCH 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()

2023-06-21 Thread Denis V. Lunev
On 6/21/23 19:08, Denis V. Lunev wrote: On 6/7/23 17:26, Andrey Drobyshev wrote: Functions qcow2_get_host_offset(), get_cluster_offset() explicitly report compressed cluster types when data is compressed. However, this information is never passed further.  Let's make use of it by adding new

Re: [PATCH 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()

2023-06-21 Thread Denis V. Lunev
-317,6 +319,7 @@ typedef enum { #define BDRV_BLOCK_ALLOCATED0x10 #define BDRV_BLOCK_EOF 0x20 #define BDRV_BLOCK_RECURSE 0x40 +#define BDRV_BLOCK_COMPRESSED 0x80 typedef QTAILQ_HEAD(BlockReopenQueue, BlockReopenQueueEntry) BlockReopenQueue; Reviewed-by: Denis V. Lunev

Re: [PATCH v6 0/5] parallels: Add duplication check, repair at open, fix bugs

2023-06-21 Thread Denis V. Lunev
On 6/21/23 10:20, Alexander Ivanov wrote: Fix incorrect data end calculation in parallels_open(). Check if data_end greater than the file size. Add change_info argument to parallels_check_leak(). Add checking and repairing duplicate offsets in BAT Image repairing in parallels_open(). v6: 2:

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

2023-06-21 Thread Denis V. Lunev
urn 0; fail_format: @@ -1124,6 +1129,12 @@ fail_format: fail_options: ret = -EINVAL; fail: +/* + * "s" object was allocated by g_malloc0 so we can safely + * try to free its fields even they were not allocated. + */ +error_free(s->migration_blocker); +g_free(s->bat_dirty_bmap); qemu_vfree(s->header); return ret; } Reviewed-by: Denis V. Lunev

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

2023-06-21 Thread Denis V. Lunev
On 6/21/23 10:20, 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

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

2023-06-21 Thread Denis V. Lunev
On 6/21/23 10:20, 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

Re: [PATCH v6 2/5] parallels: Check if data_end greater than the file size

2023-06-21 Thread Denis V. Lunev
On 6/21/23 10:20, Alexander Ivanov wrote: Initially data_end is set to the data_off image header field and must not be greater than the file size. Signed-off-by: Alexander Ivanov --- block/parallels.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/parallels.c

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

2023-06-09 Thread Denis V. Lunev
On 6/7/23 17:14, Hanna Czenczek wrote: 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

Re: [PATCH v2 2/2] qemu-iotests: 024: add rebasing test case for overlay_size > backing_size

2023-05-26 Thread Denis V. Lunev
in the same chain + +Verify that data is read the same before and after rebase + +read 262144/262144 bytes at offset 0 +256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 262144 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + *** done Reviewed-by: Denis V. Lunev

Re: [PATCH v2 1/2] qemu-img: rebase: stop when reaching EOF of old backing file

2023-05-26 Thread Denis V. Lunev
* Now we will need to explicitly zero the cluster in + * order to preserve that state after the rebase. + */ +n = bytes; +} } /* Revieved-by: Denis V. Lunev

Re: [PATCH 1/2] qemu-img: rebase: stop when reaching EOF of old backing file

2023-05-24 Thread Denis V. Lunev
On 5/23/23 18:24, Andrey Drobyshev wrote: In case when we're rebasing within one backing chain, and when target image is larger than old backing file, bdrv_is_allocated_above() ends up setting *pnum = 0. As a result, target offset isn't getting incremented, and we get stuck in an infinite for

Re: [PATCH v9 0/6] block: refactor blockdev transactions

2023-05-10 Thread Denis V. Lunev
On 5/10/23 17:21, Vladimir Sementsov-Ogievskiy wrote: Interesting, I see two 5/6 letters, equal body, but a bit different headers (the second has empty "Sender").. for me all is OK

Re: [PATCH v11 00/12] parallels: Refactor the code of images checks and fix a bug

2023-04-26 Thread Denis V. Lunev
On 4/24/23 11:31, Alexander Ivanov wrote: Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for simplier code. Fix incorrect

Re: [PATCH v10 00/12] parallels: Refactor the code of images checks and fix a bug

2023-03-13 Thread Denis V. Lunev
On 3/7/23 13:20, Hanna Czenczek wrote: On 03.02.23 10:18, Alexander Ivanov wrote: Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use

Re: [PATCH v10 01/12] parallels: Out of image offset in BAT leads to image inflation

2023-02-15 Thread Denis V. Lunev
-by: Alexander Ivanov Reviewed-by: Denis V. Lunev ---   block/parallels.c | 17 +   1 file changed, 17 insertions(+) diff --git a/block/parallels.c b/block/parallels.c index bbea2f2221..4af68adc61 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -732,6 +732,7 @@ static int

[PATCH 1/1] block: improve error logging in bdrv_reopen_prepare()

2023-02-13 Thread Denis V. Lunev
The error generated when the option could not be changed inside bdrv_reopen_prepare() does not give a clue about problematic BlockDriverState as we could get very long tree of devices. The patch adds node name to the error report in the same way as done above. Signed-off-by: Denis V. Lunev CC

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-02-02 Thread Denis V. Lunev
On 2/2/23 14:27, Fiona Ebner wrote: Am 02.02.23 um 12:34 schrieb Kevin Wolf: Am 02.02.2023 um 11:19 hat Fiona Ebner geschrieben: Am 31.01.23 um 19:18 schrieb Denis V. Lunev: Frankly speaking I would say that this switch could be considered NOT QEMU job and we should just send a notification

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-02-02 Thread Denis V. Lunev
On 2/2/23 11:19, Fiona Ebner wrote: Am 31.01.23 um 19:18 schrieb Denis V. Lunev: On 1/31/23 18:44, Vladimir Sementsov-Ogievskiy wrote: + Den Den, I remember we thought about that, and probably had a solution? Another possible approach to get benefits from both modes is to switch to blocking

Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-01-31 Thread Denis V. Lunev
On 1/31/23 18:44, Vladimir Sementsov-Ogievskiy wrote: + Den Den, I remember we thought about that, and probably had a solution? Another possible approach to get benefits from both modes is to switch to blocking mode after first loop of copying. [*] Hmm. Thinking about proposed solution it

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

2023-01-31 Thread Denis V. Lunev
On 1/12/23 16:01, 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 | 67 +-- 1 file changed, 36 insertions(+), 31 deletions(-)

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

2023-01-31 Thread Denis V. Lunev
On 1/12/23 16:01, 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 | 67 +-- 1 file changed, 36 insertions(+), 31 deletions(-)

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

2023-01-31 Thread Denis V. Lunev
if (test_bit(cluster_index, bitmap)) { /* this cluster duplicates another one */ -fprintf(stderr, - "%s duplicate offset in BAT entry %u\n", -*fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR", i); +qemu_log("%s duplicate offset in BAT entry %u\n", + *fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR", i); res->corruptions++; Reviewed-by: Denis V. Lunev

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

2023-01-31 Thread Denis V. Lunev
On 1/12/23 16:01, 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

Re: [PATCH v9 12/12] parallels: Incorrect condition in out-of-image check

2023-01-31 Thread Denis V. Lunev
_SECTOR_BITS; -if (off > size) { +if (off + s->cluster_size > size) { fprintf(stderr, "%s cluster %u is outside image\n", fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR", i); res->corruptions++; Reviewed-by: Denis V. Lunev

Re: [PATCH v9 09/12] parallels: Move check of leaks to a separate function

2023-01-31 Thread Denis V. Lunev
On 1/31/23 11:27, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 85

Re: [PATCH v9 08/12] parallels: Fix statistics calculation

2023-01-31 Thread Denis V. Lunev
On 1/31/23 11:27, Alexander Ivanov wrote: Exclude out-of-image clusters from allocated and fragmented clusters calculation. Signed-off-by: Alexander Ivanov --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/parallels.c b/block/parallels.c index

Re: [PATCH v9 07/12] parallels: Move check of cluster outside image to a separate function

2023-01-31 Thread Denis V. Lunev
} + +res->bfi.allocated_clusters++; + +if (prev_off != 0 && (prev_off + s->cluster_size) != off) { +res->bfi.fragmented_clusters++; +} +prev_off = off; + } + if (size > res->image_end_offset) { int64_t count; count = DIV_ROUND_UP(size - res->image_end_offset, s->cluster_size); Reviewed-by: Denis V. Lunev

Re: [PATCH v9 03/12] parallels: Fix image_end_offset and data_end after out-of-image check

2023-01-31 Thread Denis V. Lunev
s->data_end = res->image_end_offset >> BDRV_SECTOR_BITS; +} + if (size > res->image_end_offset) { int64_t count; count = DIV_ROUND_UP(size - res->image_end_offset, s->cluster_size); Reviewed-by: Denis V. Lunev

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

2023-01-31 Thread Denis V. Lunev
On 1/12/23 16:01, 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 v2 1/2] qga-win: add logging to Windows event log

2023-01-23 Thread Denis V. Lunev
Hi Stefan! On 1/23/23 20:38, Andrey Drobyshev wrote: Hi Stefan, On 1/23/23 19:28, Stefan Weil wrote: Hi, cross builds fail with this code. Please see details below. Am 29.11.22 um 18:38 schrieb Andrey Drobyshev via: This commit allows QGA to write to Windows event log using Win32 API's

Re: Using QEMU for VRChat

2022-11-02 Thread Denis V. Lunev
On 8/10/22 13:06, danko babro wrote: Dear QEMU dev team, Recently a game called VRChat got a security update, implementing Easy Anti Cheat into their game (pretty much spyware that logs everything happening on the users PC) which made me want to install their game on a virtual machine. The

Re: ublk-qcow2: ublk-qcow2 is available

2022-10-05 Thread Denis V. Lunev
On 10/5/22 14:21, Stefan Hajnoczi wrote: On Wed, 5 Oct 2022 at 00:19, Ming Lei wrote: On Tue, Oct 04, 2022 at 09:53:32AM -0400, Stefan Hajnoczi wrote: On Tue, 4 Oct 2022 at 05:44, Ming Lei wrote: On Mon, Oct 03, 2022 at 03:53:41PM -0400, Stefan Hajnoczi wrote: On Fri, Sep 30, 2022 at

Re: [PATCH 1/1] qxl: add subsystem_vendor_id property

2022-10-03 Thread Denis V. Lunev
On 9/29/22 09:37, Gerd Hoffmann wrote: On Wed, Sep 28, 2022 at 05:52:44PM +0200, Denis V. Lunev wrote: This property is needed for WHQL/inboxing of Windows drivers. We do need to get drivers to be separated by the hypervisor vendors and that should be done as PCI subvendor ID. This patch adds

Re: ublk-qcow2: ublk-qcow2 is available

2022-10-03 Thread Denis V. Lunev
On 10/3/22 21:53, Stefan Hajnoczi wrote: On Fri, Sep 30, 2022 at 05:24:11PM +0800, Ming Lei wrote: ublk-qcow2 is available now. Cool, thanks for sharing! yep So far it provides basic read/write function, and compression and snapshot aren't supported yet. The target/backend implementation is

Re: [PATCH v2 1/1] scripts: check commit message length to fit 75 characters

2022-09-29 Thread Denis V. Lunev
On 9/29/22 13:48, Markus Armbruster wrote: "Denis V. Lunev" writes: There are a lot of commits descriptions which are rendered in the 'git log' with line wrap. Apparently, this is looking awkward. Let us add check into checkpatch.pl for that. I am not very good Perl

[PATCH 1/1] scripts: check commit message length to fit 75 characters

2022-09-28 Thread Denis V. Lunev
have faced a lot of obstacles here thus direct port from them looks beneficial. Signed-off-by: Denis V. Lunev CC: Alexey Kardashevskiy CC: "Philippe Mathieu-Daudé" CC: "Marc-André Lureau" CC: Paolo Bonzini CC: Eric Blake CC: Markus Armbruster --- roms/SLOF

[PATCH v2 1/1] scripts: check commit message length to fit 75 characters

2022-09-28 Thread Denis V. Lunev
have faced a lot of obstacles here thus direct port from them looks beneficial. Signed-off-by: Denis V. Lunev CC: Alexey Kardashevskiy CC: "Philippe Mathieu-Daudé" CC: "Marc-André Lureau" CC: Paolo Bonzini CC: Eric Blake CC: Markus Armbruster --- Changes from v1: - fixed for

[PATCH 1/1] qxl: add subsystem_vendor_id property

2022-09-28 Thread Denis V. Lunev
been written by Denis Plotnikov while he has been working in Virtuozzo. Signed-off-by: Denis V. Lunev CC: Denis Plotnikov CC: Yan Vugenfirer CC: Gerd Hoffmann --- hw/display/qxl.c | 4 hw/display/qxl.h | 1 + 2 files changed, 5 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c

Re: [PATCH] qemu-nbd: set timeout to qemu-nbd socket

2022-09-26 Thread Denis V. Lunev
On 9/26/22 12:05, Vladimir Sementsov-Ogievskiy wrote: [+ Den] On 9/25/22 16:53, luzhipeng wrote: From: lu zhipeng Prevent the NBD socket stuck all the time, So set timeout. Signed-off-by: lu zhipeng ---   nbd/client.c | 8   1 file changed, 8 insertions(+) diff --git

Re: [PATCH] add keepalive for qemu-nbd

2022-09-21 Thread Denis V. Lunev
On 9/21/22 10:36, songlinfeng wrote: From: songlinfeng we want to export a image with qemu-nbd as server, in client we use libnbd to connect qemu-nbd,but when client power down,the server is still working. qemu-nbd will exit when last client exit.so,we still want server exit when client

Re: [PATCH v3 4/5] tests/x86: Add 'q35' machine type to hotplug hd-geo-test

2022-09-19 Thread Denis V. Lunev
On 9/15/22 15:14, Michael Labiuk wrote: Add pci bridge setting to test hotplug. Duplicate tests for plugging scsi and virtio devices for q35 machine type. Signed-off-by: Michael Labiuk --- tests/qtest/hd-geo-test.c | 148 ++ 1 file changed, 148

Re: [PATCH v3 2/5] tests/x86: Add 'q35' machine type to ivshmem-test

2022-09-19 Thread Denis V. Lunev
On 9/15/22 15:14, Michael Labiuk wrote: Configure pci bridge setting to test ivshmem on 'q35'. < empty line here is needed Signed-off-by: Michael Labiuk --- tests/qtest/ivshmem-test.c | 30 ++ 1 file changed, 30 insertions(+) diff --git

Re: [PATCH v3 1/5] tests/x86: Add subtest with 'q35' machine type to device-plug-test

2022-09-19 Thread Denis V. Lunev
On 9/15/22 15:14, Michael Labiuk wrote: Configure pci bridge setting to plug pci device and unplug. Move common code for device removing to function. Signed-off-by: Michael Labiuk --- tests/qtest/device-plug-test.c | 83 -- 1 file changed, 58 insertions(+), 25

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

2022-09-08 Thread Denis V. Lunev
On 9/8/22 19:15, Denis V. Lunev wrote: On 9/2/22 10:52, Alexander Ivanov wrote: Cluster offsets must be unique among all BAT entries. Find duplicate offsets in the BAT. If a duplicated offset is found fix it by copying the content of the relevant cluster to a new allocated cluster and set

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

2022-09-08 Thread Denis V. Lunev
On 9/2/22 10:52, Alexander Ivanov wrote: Cluster offsets must be unique among all BAT entries. Find duplicate offsets in the BAT. If a duplicated offset is found fix it by copying the content of the relevant cluster to a new allocated cluster and set the new cluster offset to the duplicated

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

2022-09-08 Thread Denis V. Lunev
On 9/2/22 10:53, 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 | 95 --- 1 file changed, 65 insertions(+), 30 deletions(-)

Re: [PATCH v5 0/2] block: add missed block_acct_setup with new block device init procedure

2022-09-07 Thread Denis V. Lunev
On 8/24/22 11:50, Denis V. Lunev wrote: Commit 5f76a7aac156ca75680dad5df4a385fd0b58f6b1 is looking harmless from the first glance, but it has changed things a lot. 'libvirt' uses it to detect that it should follow new initialization way and this changes things considerably. With this procedure

Re: [PATCH for 7.2] minor fixups in block code

2022-09-07 Thread Denis V. Lunev
On 8/17/22 10:37, Denis V. Lunev wrote: These 2 patches are just minor improvements to make code a bit better. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Stefan Hajnoczi CC: Fam Zheng CC: Ronnie Sahlberg CC: Paolo Bonzini CC: Peter Lieven CC: Vladimir Sementsov

Re: [PATCH 0/6] parallels: Add duplication check, repair at open, fix bugs

2022-09-07 Thread Denis V. Lunev
On 9/2/22 10:52, Alexander Ivanov wrote: This patchset is based on git: https://src.openvz.org/~den/qemu.git parallels Fix incorrect data end calculation in parallels_open(). Add parallels_handle_leak() and highest_offset() helpers. Add checking and repairing duplicate offsets in BAT.

Re: [PATCH 2/6] parallels: Create parallels_handle_leak() to truncate excess clusters

2022-09-07 Thread Denis V. Lunev
On 9/2/22 10:52, Alexander Ivanov wrote: This helper will be reused in the next patch for duplications check. Signed-off-by: Alexander Ivanov --- block/parallels.c | 65 +++ 1 file changed, 43 insertions(+), 22 deletions(-) diff --git

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

2022-09-07 Thread Denis V. Lunev
On 9/2/22 10:52, Alexander Ivanov wrote: Cluster offsets must be unique among all BAT entries. Find duplicate offsets in the BAT. If a duplicated offset is found fix it by copying the content of the relevant cluster to a new allocated cluster and set the new cluster offset to the duplicated

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

2022-09-07 Thread Denis V. Lunev
On 9/2/22 10:53, 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 | 95 --- 1 file changed, 65 insertions(+), 30 deletions(-)

Re: [PATCH 5/6] parallels: Replace fprintf by qemu_log

2022-09-07 Thread Denis V. Lunev
On 9/2/22 10:52, Alexander Ivanov wrote: Use a standard QEMU function for logging. Signed-off-by: Alexander Ivanov --- block/parallels.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index 688aa081e2..08526196da 100644

Re: [PATCH 4/6] parallels: Use highest_offset() helper in leak check

2022-09-07 Thread Denis V. Lunev
On 9/2/22 10:52, Alexander Ivanov wrote: Deduplicate code by using highest_offset() helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index

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

2022-09-07 Thread Denis V. Lunev
DRV_SECTOR_BITS)) { /* there is not enough unused space to fit to block align between BAT and actual data. We can't avoid read-modify-write... */ s->header_size = size; Reviewed-by: Denis V. Lunev Sidenote: if the image is truncated for more than BAT size and

Re: [PATCH v7 00/10] parallels: Refactor the code of images checks and fix a bug

2022-09-01 Thread Denis V. Lunev
On 29.08.2022 12:12, Alexander Ivanov wrote: Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for simplier code. v7: 1,2: Fix

Re: [PATCH v2 0/4] Add 'q35' machine type to hotplug tests

2022-08-31 Thread Denis V. Lunev
On 29.08.2022 19:01, Michael Labiuk wrote: Add pci bridge setting to run hotplug tests on q35 machine type. Hotplug tests was bounded to 'pc' machine type by commit 7b172333f1b Michael Labiuk (4): tests/x86: Add subtest with 'q35' machine type to device-plug-test tests/x86: Add 'q35'

Re: [PATCH for 7.2] minor fixups in block code

2022-08-29 Thread Denis V. Lunev
On 17.08.2022 10:37, Denis V. Lunev wrote: These 2 patches are just minor improvements to make code a bit better. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Stefan Hajnoczi CC: Fam Zheng CC: Ronnie Sahlberg CC: Paolo Bonzini CC: Peter Lieven CC: Vladimir Sementsov

Re: [PATCH v6 11/10] parallels: Incorrect condition in out-of-image check

2022-08-26 Thread Denis V. Lunev
_SECTOR_BITS; -if (off > size) { +if (off >= size) { fprintf(stderr, "%s cluster %u is outside image\n", fix & BDRV_FIX_ERRORS ? "Repairing" : "ERROR", i); res->corruptions++; Reviewed-by: Denis V. Lunev

Re: [PATCH v6 07/10] parallels: Move check of cluster outside image to a separate function

2022-08-26 Thread Denis V. Lunev
On 26.08.2022 15:23, Alexander Ivanov wrote: On 26.08.2022 15:08, Denis V. Lunev wrote: On 25.08.2022 16:31, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper

Re: [PATCH v6 08/10] parallels: Move check of leaks to a separate function

2022-08-26 Thread Denis V. Lunev
if (off == 0) { +prev_off = 0; +continue; +} + +res->bfi.allocated_clusters++; + +if (prev_off != 0 && (prev_off + s->cluster_size) != off) { +res->bfi.fragmented_clusters++; +} +prev_off = off; +}

Re: [PATCH v6 07/10] parallels: Move check of cluster outside image to a separate function

2022-08-26 Thread Denis V. Lunev
ated_clusters++; if (off > high_off) { high_off = off; @@ -519,8 +548,6 @@ static int coroutine_fn parallels_co_check(BlockDriverState *bs, } } -s->data_end = res->image_end_offset >> BDRV_SECTOR_BITS; - out: qemu_co_mutex_unlock(>lock); Reviewed-by: Denis V. Lunev

Re: [PATCH v6 03/10] parallels: Fix data_end after out-of-image check

2022-08-26 Thread Denis V. Lunev
res->image_end_offset >> BDRV_SECTOR_BITS; + out: qemu_co_mutex_unlock(>lock); return ret; Reviewed-by: Denis V. Lunev

Re: [PATCH v6 02/10] parallels: Fix high_off calculation in parallels_co_check()

2022-08-26 Thread Denis V. Lunev
ontinue; } res->bfi.allocated_clusters++; with string length fixes in the commit message (more that 74 chars) Reviewed-by: Denis V. Lunev

Re: [PATCH v6 01/10] parallels: Out of image offset in BAT leads to image inflation

2022-08-26 Thread Denis V. Lunev
t;data_end) { s->data_end = off + s->tracks; } with string length fixes in the commit message (more that 74 chars) Reviewed-by: Denis V. Lunev

Re: [PATCH] tests/x86: Add 'q35' machine type to hotplug tests

2022-08-26 Thread Denis V. Lunev
On 26.08.2022 13:41, Michael Labiuk wrote: Add pci bridge setting to run hotplug tests on q35 machine type. Hotplug tests was bounded to 'pc' machine type by commit 7b172333f1b Signed-off-by: Michael Labiuk --- tests/qtest/device-plug-test.c | 26 ++ tests/qtest/drive_del-test.c |

[PATCH 1/2] block: pass OnOffAuto instead of bool to block_acct_setup()

2022-08-24 Thread Denis V. Lunev
We would have one more place for block_acct_setup() calling, which should not corrupt original value. Signed-off-by: Denis V. Lunev Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Peter Krempa CC: Markus Armbruster CC: John Snow CC: Kevin Wolf CC: Hanna Reitz --- block/accounting.c

<    1   2   3   4   5   6   7   8   9   10   >