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 <alexander.iva...@virtuozzo.com>
---
v2: No change.
v3: Fix commit message.
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/block/parallels.c
@@ -469,14 +469,13 @@ static int parallels_check_outside_image(BlockDriverState
*bs,
return 0;
}
-static int coroutine_fn parallels_co_check(BlockDriverState *bs,
- BdrvCheckResult *res,
- BdrvCheckMode fix)
+static int parallels_check_leak(BlockDriverState *bs,
+ BdrvCheckResult *res,
+ BdrvCheckMode fix)
{
BDRVParallelsState *s = bs->opaque;
- int64_t size, prev_off, high_off;
- int ret;
- uint32_t i;
+ int64_t size, off, high_off, count;
+ int i, ret;
'i' should be kept to be uint32_t, as pre-patch.
With it fixed:
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsement...@yandex-team.ru>
--
Best regards,
Vladimir