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:
}
+
if (old_l2_entry == new_l2_entry && old_l2_bitmap == new_l2_bitmap) {
continue;
}
Reviewed-by: Alexander Ivanov
--
Best regards,
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
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
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
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
->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
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
#
-# 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
fset, nb_subclusters, &scri);
if (ret < 0) {
return ret;
Reviewed-by: Alexander Ivanov
--
Best regards,
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
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
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
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
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
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
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
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
From: Alexander Ivanov
We will add more and more checks of images so we need to reorganize the code.
Put each check to a separate helper function with a separate loop.
Add two helpers: truncate_file() and sync_header(). They will be used
in multiple functions.
Signed-off-by: Alexander Ivanov
From: Alexander Ivanov
We will add more and more checks of images so we need to reorganize the code.
Put each check to a separate helper function with a separate loop.
Add two helpers: truncate_file() and sync_header(). They will be used
in multiple functions.
Parallels image file can be
From: Alexander Ivanov
There could be corruptions in the image file:
two guest memory areas refer to the same host cluster.
If a duplicate offset is found fix it by copying the content
of the referred cluster to a new allocated cluster and
replace one of the two referring entries by the new
From: Alexander Ivanov
Check if original and duplicated offsets refer to the same cluster.
Repair the image and check that writing to a referred cluster
doesn't affects another referred cluster.
Signed-off-by: Natalia Kuzmina
Signed-off-by: Alexander Ivanov
---
tests/qemu-iotest
bdrv_co_pwrite_sync by bdrv_co_flush for writing to the disk
only dirty blocks.
Merge parallels_check_fragmentation to parallels_collect_statistics.
Alexander Ivanov (9):
parallels: Move check of unclean image to a separate function
parallels: Move check of cluster outside image to a separate
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 96 ---
1 file changed, 58 insertions(+), 38 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 7b400ecdcc..6d4cfb738b 100644
--- a/block/parallels.c
+++ b/block/parallels.c
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 29 +++--
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index a229c06f25..108aa907b8 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -413,6 +413,23
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 38 +-
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 6d4cfb738b..0edbb812dd 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -530,12
data_end field with the original file size if the image
was opened for checking and repairing purposes or raise an error.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/block/parallels.c b/block/parallels.c
index
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 25 ++---
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 0edbb812dd..b0982d60d0 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -553,13 +553,29
Frgamentation is a part of statistics so it is better to count the statistics
in one function.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 31 ---
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 76 +--
1 file changed, 53 insertions(+), 23 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 108aa907b8..7b400ecdcc 100644
--- a/block/parallels.c
+++ b/block/parallels.c
It's too costly to write all the BAT to the disk. Let the flush function
write only dirty blocks.
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 72cf7499c1..38b1482e81 1
Replace the way that we use mutex in parallels_co_check() for more clean code.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 11 ---
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index b0982d60d0..3cb5452613 100644
--- a
ne in parallels_co_check.
Now we use a helper to set BAT entry and mark the block dirty.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 7f68f3cbc9..6879e
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 more clean code.
Alexander Ivanov (8):
parallels: Out of image offset in BAT
data_end field with the original file size if the image
was opened for checking and repairing purposes or raise an error.
v2: No changes.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/block/parallels.c b/block
Replace the way we use mutex in parallels_co_check() for more clean code.
v2: Fix an incorrect usage of WITH_QEMU_LOCK_GUARD.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/block/parallels.c
v2: Move fragmentation counting code to this function too.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 54 +++
1 file changed, 31 insertions(+), 23 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 8737eadfb4
v2: Revert the condition with s->header_unclean.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 31 +--
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 6879ea4597..c53b2810cf 100644
--- a/bl
v2: Move unrelated helper parallels_set_bat_entry creation to
a separate patch.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 48 ++-
1 file changed, 35 insertions(+), 13 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
Will need to set BAT entry in multiple places.
Move the code of settings entries and marking relevant blocks dirty
to a separate helper parallels_set_bat_entry.
v2: A new patch - a part of a splitted patch.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 12 +---
1 file changed
v2: No changes.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 85 +--
1 file changed, 52 insertions(+), 33 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 12104ba5ad..8737eadfb4 100644
--- a/block/parallels.c
+++ b
This helper will be reused in next patches during parallels_co_check
rework to simplify its code.
Signed-off-by: Alexander Ivanov
---
v2: A new patch - a part of a splitted patch.
v3: Fix commit message.
block/parallels.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff
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.
Alexander Ivanov (8):
parallels: Out of image offset in BAT
manually write BAT and track its modification.
This makes code more generic and allows to split
parallels_set_bat_entry() for independent pieces.
Signed-off-by: Alexander Ivanov
---
v2: Patch order was changed so the replacement is done in parallels_co_check.
Now we use a helper to set BAT
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
---
v2: Revert the condition with s->header_unclean.
v3: Fix commit message.
block/parallels.c |
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
---
v2: Move unrelated helper parallels_set_bat_entry creation to
a separate patch.
v3: Fix commit
-off-by: Alexander Ivanov
---
v2: No change.
v3: Fix commit message.
block/parallels.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/block/parallels.c b/block/parallels.c
index a229c06f25..a76cf9d993 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -732,6 +732,7
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
---
v2: No change.
v3: Fix commit message.
block/parallels.c | 85
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
---
v2: Move fragmentation counting code to this function too.
v3: Fix commit message.
block/parallels.c
Replace the way we use mutex in parallels_co_check() for simplier
and less error prone code.
Signed-off-by: Alexander Ivanov
---
v2: Fix an incorrect usage of WITH_QEMU_LOCK_GUARD.
v3: Fix commit message.
block/parallels.c | 26 --
1 file changed, 12 insertions(+), 14
repairing duplicate offsets in BAT.
Add tests for parallels format checks.
Refactor and fix old parallels tests.
Alexander Ivanov (10):
parallels: Incorrect condition in out-of-image check
parallels: Incorrect data end calculation in parallels_open
parallels: Create parallels_handle_leak() to
All the offsets in the BAT must be at least one cluster away from
the end of the data area.
Fix the check condition for correct check.
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
Deduplicate code by using highest_offset() helper.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 9 +
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index bd129f44fa..93d21804f2 100644
--- a/block/parallels.c
+++ b/block
deduplicate the code.
Add highest_offset() helper. It will be used for code deduplication
in the next patch.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 136 ++
1 file changed, 136 insertions(+)
diff --git a/block/parallels.c b/block
In this test cluster size is 64k, but modern tools generate images
with cluster size 1M.
Calculate cluster size using track field from image header.
Signed-off-by: Alexander Ivanov
---
tests/qemu-iotests/131 | 5 -
tests/qemu-iotests/131.out | 44
Fill the image with a pattern to generate entries in the BAT,
set the first BAT entry outside the image, try to read the corrupted image,
repair and check for zeroes in the first cluster.
Signed-off-by: Alexander Ivanov
---
tests/qemu-iotests/tests/parallels-checks | 78
t data_end contains the offset in bytes.
Replace the alignment to sector size by division by sector size.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/parallels.c b/block/parallels.c
index c42c955075..ce04a4da71 10
This helper will be reused in the next patch for duplications check.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 83 ++-
1 file changed, 53 insertions(+), 30 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index ce04a4da71
Write a pattern to the last cluster, extend the image
by 1 claster, repair and check that the last cluster
still has the same pattern.
Signed-off-by: Alexander Ivanov
---
tests/qemu-iotests/tests/parallels-checks | 27 +++
tests/qemu-iotests/tests/parallels-checks.out | 22
Fill the image with a pattern and write another pattern
in the second cluster. Corrupt the image and check if the pattern
changes. Repair the image and check the patterns on guest
and host sides.
Signed-off-by: Alexander Ivanov
---
tests/qemu-iotests/tests/parallels-checks | 31
Replace hardcoded numbers by variables.
Signed-off-by: Alexander Ivanov
---
tests/qemu-iotests/131 | 29 -
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/tests/qemu-iotests/131 b/tests/qemu-iotests/131
index a847692b4c..601546c84c 100755
--- a/tests
On 17.08.2022 21:21, Vladimir Sementsov-Ogievskiy wrote:
On 8/15/22 12:02, Alexander Ivanov wrote:
This helper will be reused in next patches during parallels_co_check
rework to simplify its code.
Signed-off-by: Alexander Ivanov
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
v2: A new
On 17.08.2022 21:43, Vladimir Sementsov-Ogievskiy wrote:
On 8/17/22 22:27, Denis V. Lunev wrote:
On 17.08.2022 21:13, Vladimir Sementsov-Ogievskiy wrote:
On 8/15/22 12:02, Alexander Ivanov wrote:
data_end field in BDRVParallelsState is set to the biggest offset
present
in BAT. If this
On 17.08.2022 21:48, Vladimir Sementsov-Ogievskiy wrote:
On 8/15/22 12:02, Alexander Ivanov wrote:
BAT is written in the context of conventional operations over
the image inside bdrv_co_flush() when it calls
parallels_co_flush_to_os() callback. Thus we should not
modify BAT array directly, but
On 17.08.2022 23:00, Vladimir Sementsov-Ogievskiy wrote:
On 8/15/22 12:02, 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
When an image is opened for check there is no error if an offset in the BAT
points outside the image. In such a way we can repair the image.
Out-of-image offsets are repaired in the check, but data_end field
still points outside. Fix this field by file size.
Signed-off-by: Alexander Ivanov
eck(). Split the check
in parallels_open() and the fix in parallels_co_check() to two patches.
Move offset convertation to parallels_set_bat_entry().
Fix 'ret' rewriting by bdrv_co_flush() results.
Keep 'i' as uint32_t.
Alexander Ivanov (9):
parallels: Out of image
manually write BAT and track its modification.
This makes code more generic and allows to split
parallels_set_bat_entry() for independent pieces.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 23 ++-
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a
parallels_open() if data_end points outside the image and
it is not a check (let the check to repaire the image).
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/block/parallels.c b/block/parallels.c
index a229c06f25..c245ca35cd
This helper will be reused in next patches during parallels_co_check
rework to simplify its code.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 24c05b95e8
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.
s->data_end fix relates to out-of-image check so move it
to the helper too.
Signed-off-by: Alexander Ivanov
---
block/parallels.c |
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 | 31 +--
1 file changed, 21 insertions(+), 10 deletions
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 | 84 +--
1 file changed, 52 insertions
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 | 53 +++
1 file changed, 31 insertions
Replace the way we use mutex in parallels_co_check() for simplier
and less error prone code.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 26 --
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index
use a helper to set BAT entry and mark the block dirty.
4: Revert the condition with s->header_unclean.
5: Move unrelated helper parallels_set_bat_entry creation to a separate patch.
7: Move fragmentation counting code to this function too.
8: Fix an incorrect usage of WITH_QEMU_LOCK_G
parallels_open() if data_end points outside the image and
it is not a check (let the check to repaire the image).
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/block/parallels.c b/block/parallels.c
index a229c06f25..c245ca35cd
This helper will be reused in next patches during parallels_co_check
rework to simplify its code.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions
manually write BAT and track its modification.
This makes code more generic and allows to split
parallels_set_bat_entry() for independent pieces.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 23 ++-
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a
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
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 50
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
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 31
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 | 87 +--
1 file changed, 54 insertions
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
---
block/parallels.c | 33 ++---
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/block
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
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 53
Make data_end pointing to the end of the last cluster if a leak was fixed.
Otherwise set the file size to data_end.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/block/parallels.c b/block/parallels.c
index
On 23.08.2022 08:58, Vladimir Sementsov-Ogievskiy wrote:
On 8/22/22 12:05, Alexander Ivanov wrote:
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 the
On 23.08.2022 09:38, Vladimir Sementsov-Ogievskiy wrote:
On 8/22/22 12:05, Alexander Ivanov wrote:
Make data_end pointing to the end of the last cluster if a leak was
fixed.
Otherwise set the file size to data_end.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 10 +-
1
On 23.08.2022 11:20, Denis V. Lunev wrote:
On 23.08.2022 09:23, Alexander Ivanov wrote:
On 23.08.2022 08:58, Vladimir Sementsov-Ogievskiy wrote:
On 8/22/22 12:05, Alexander Ivanov wrote:
data_end field in BDRVParallelsState is set to the biggest offset
present
in BAT. If this offset is
On 23.08.2022 11:40, Denis V. Lunev wrote:
On 22.08.2022 11:05, 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
On 23.08.2022 11:58, Vladimir Sementsov-Ogievskiy wrote:
On 8/23/22 12:20, Denis V. Lunev wrote:
On 23.08.2022 09:23, Alexander Ivanov wrote:
On 23.08.2022 08:58, Vladimir Sementsov-Ogievskiy wrote:
On 8/22/22 12:05, Alexander Ivanov wrote:
data_end field in BDRVParallelsState is set to
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 | 59 ++-
1 file changed, 43 insertions
manually write BAT and track its modification.
This makes code more generic and allows to split
parallels_set_bat_entry() for independent pieces.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 23 ++-
1 file changed, 10 insertions(+), 13
Set data_end to the end of the last cluster inside the image.
In such a way we can be shure that corrupted offsets in the BAT
can't affect on the image size.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/block/parallels.c b/
This helper will be reused in next patches during parallels_co_check
rework to simplify its code.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff
tation counting code to this function too.
8: Fix an incorrect usage of WITH_QEMU_LOCK_GUARD.
Alexander Ivanov (10):
parallels: Out of image offset in BAT leads to image inflation
parallels: Fix high_off calculation in parallels_co_check()
parallels: Fix data_end after out-of-image check
para
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 | 84 +--
1 file changed, 52 insertions
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
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 31
parallels_open() if data_end points outside the image and
it is not a check (let the check to repaire the image).
Set data_end to the end of the cluster with the last correct offset.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 17 +
1 file changed, 17 insertions(+)
diff --git
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
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 53
Don't let high_off be more than the file size even if we don't fix the image.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 93bc2750ef..7e8cdbbc3a 100644
-
1 - 100 of 447 matches
Mail list logo