From 8bc584fe035d98b8aca4fcc818617c91df0ed925 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 11 Oct 2019 17:28:06 +0200 Subject: qcow2: Separate qcow2_check_read_snapshot_table() Reading the snapshot table can fail. That is a problem when we want to repair the image. Therefore, stop reading the snapshot table in qcow2_do_open() in check mode. Instead, add a new function qcow2_check_read_snapshot_table() that reads the snapshot table at a later point. In the future, we want to handle errors here and fix them. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Message-id: 20191011152814.14791-9-mreitz@redhat.com Signed-off-by: Max Reitz --- block/qcow2.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'block/qcow2.h') diff --git a/block/qcow2.h b/block/qcow2.h index 6c7a23fdf6..adb5c3bc28 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -718,6 +718,10 @@ void qcow2_free_snapshots(BlockDriverState *bs); int qcow2_read_snapshots(BlockDriverState *bs, Error **errp); int qcow2_write_snapshots(BlockDriverState *bs); +int coroutine_fn qcow2_check_read_snapshot_table(BlockDriverState *bs, + BdrvCheckResult *result, + BdrvCheckMode fix); + /* qcow2-cache.c functions */ Qcow2Cache *qcow2_cache_create(BlockDriverState *bs, int num_tables, unsigned table_size); -- cgit v1.2.3