diff options
author | Max Reitz <mreitz@redhat.com> | 2019-10-11 17:28:06 +0200 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2019-10-28 11:54:00 +0100 |
commit | 8bc584fe035d98b8aca4fcc818617c91df0ed925 (patch) | |
tree | f88aa3e4d673fce26ed685a6a9eca498527928e7 /block/qcow2.h | |
parent | 0a85af351d90e1ae9e06b3bb5290ddf2d5d8b950 (diff) |
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 <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20191011152814.14791-9-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 4 |
1 files changed, 4 insertions, 0 deletions
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); |