Move Linux-specific FS TRIM code to commands-linux.c and add support of
ZFS TRIM for FreeBSD.
Alexander Ivanov (2):
qga: Move FS TRIM code to commands-linux.c
qga: Add ZFS TRIM support for FreeBSD
qga/commands-bsd.c| 109 ++
qga/commands-common.h
Use zpool tool for ZFS pools trimming in FreeBSD.
Signed-off-by: Alexander Ivanov
---
qga/commands-bsd.c| 109 ++
qga/commands-common.h | 1 +
2 files changed, 110 insertions(+)
diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c
index 15cade2d4c
In the next patch ZFS TRIM support for FreeBSD will be added. Move
Linux-specific TRIM code to commands-linux.c file.
Signed-off-by: Alexander Ivanov
---
qga/commands-linux.c | 73
qga/commands-posix.c | 72
From: Alexander Ivanov
Parallels image file can be corrupted this way: two guest memory areas
refer to the same host memory area (duplicated offsets in BAT).
qemu-img check copies data from duplicated cluster to the new cluster and
writes new corresponding offset to BAT instead of duplicated one
From: Alexander Ivanov
When duplicates are repaired a new space area is allocated
and further leak check considers it as a leak.
Let fix it without printing any messages.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 19 +--
1 file changed, 13 insertions(+), 6
From: Alexander Ivanov
There could be corruptions in the image file:
two quest 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
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
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
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
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
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
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 | 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
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
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
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 | 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
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
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
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: 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
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
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
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
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
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: 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
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
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
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
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
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
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.
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
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
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
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()
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
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
.
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
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 +
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
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
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
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
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
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
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
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
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
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
---
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
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
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
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
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/
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
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
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
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
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
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
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
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
If the check is called during normal work, tracking of the check must be
present in VM logs to have some clues if something going wrong with user's
data.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --
mer 5): Fixed formatting.
5 (former 6): Fixed comments. Added O_INACTIVE check in the condition.
Replaced inuse detection by header_unclean checking.
Replaced playing with corutines by bdrv_check() usage.
Alexander Ivanov (5):
parallels: Incorrect data end calculati
deduplicate the
code.
Move parallels_fix_leak() call to parallels_co_check() to fix both types
of leak: real corruption and a leak produced by allocate_clusters()
during deduplication.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 168 +-
1 file
t data_end contains the offset in bytes.
Replace the alignment to sector size by division by sector size and fix
the comparision with s->header_size.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
---
block/parallels.c | 88
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(-)
diff --git a/block/parallels.c b/block
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
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_GUARD.
Alexander Ivanov (
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
---
block/parallels.c | 59 ++-
1
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
---
block/parallels.c | 84 +--
1
All the offsets in the BAT must be lower than the file size.
Fix the check condition for correct check.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/parallels.c b/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
Reviewed-by: Denis V. Lunev
Reviewed-by: Vladimir Sementsov-Ogievskiy
---
block/parallels.c | 31
Don't let high_off be more than the file size
even if we don't fix the image.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index
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
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
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
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 17 +
1 file changed
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
Set data_end to the end of the last cluster inside the image.
In such a way we can be sure that corrupted offsets in the BAT
can't affect on the image size.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 2 ++
1 file changed, 2 insertions(+)
diff --
This patchset should be applied on the top of *[PATCH v8 00/11]
parallels: Refactor the code of images checks and fix a bug*
On 12.01.2023 16:01, Alexander Ivanov wrote:
Fix incorrect data end calculation in parallels_open().
Split image leak handling to separate check and fix helpers.
Add
On 18.01.2023 15:45, Hanna Czenczek wrote:
On 15.01.23 16:58, 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
Reviewed-by
On 18.01.2023 15:46, Hanna Czenczek wrote:
On 15.01.23 16:58, Alexander Ivanov wrote:
All the offsets in the BAT must be lower than the file size.
Fix the check condition for correct check.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 2 +-
1 file
Don't let high_off be more than the file size even if we don't fix the
image.
Signed-off-by: Alexander Ivanov
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index
Set data_end to the end of the last cluster inside the image. In such a
way we can be sure that corrupted offsets in the BAT can't affect on the
image size. If there are no allocated clusters set image_end_offset by
data_end.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 8 ++
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 f9acee1fa8..7382c01191 100644
--- a/block
rk 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_GUARD.
Alexander Ivanov (12):
parallels
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 | 52
All the offsets in the BAT must be lower than the file size.
Fix the check condition for correct check.
Signed-off-by: Alexander Ivanov
---
block/parallels.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/parallels.c b/block/parallels.c
index e4faa14add..e469fe3f78
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
---
block/parallels.c | 81 ++-
1 file changed, 52 insertions
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
Reviewed-by: Denis V. Lunev
---
block/parallels.c | 17 +
1 file changed
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
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 | 85 ---
1 file changed, 50 insertions
1 - 100 of 529 matches
Mail list logo