qcow: manually add more coroutine_fn annotations
get_cluster_offset() and decompress_cluster() are only called from the read and write paths. The validity of these was double-checked with Alberto Faria's static analyzer. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20221013123711.620631-12-pbonzini@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
f72b38b67e
commit
ea4b80146e
15
block/qcow.c
15
block/qcow.c
|
@ -92,7 +92,8 @@ typedef struct BDRVQcowState {
|
||||||
|
|
||||||
static QemuOptsList qcow_create_opts;
|
static QemuOptsList qcow_create_opts;
|
||||||
|
|
||||||
static int decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset);
|
static int coroutine_fn decompress_cluster(BlockDriverState *bs,
|
||||||
|
uint64_t cluster_offset);
|
||||||
|
|
||||||
static int qcow_probe(const uint8_t *buf, int buf_size, const char *filename)
|
static int qcow_probe(const uint8_t *buf, int buf_size, const char *filename)
|
||||||
{
|
{
|
||||||
|
@ -349,10 +350,11 @@ static int qcow_reopen_prepare(BDRVReopenState *state,
|
||||||
* return 0 if not allocated, 1 if *result is assigned, and negative
|
* return 0 if not allocated, 1 if *result is assigned, and negative
|
||||||
* errno on failure.
|
* errno on failure.
|
||||||
*/
|
*/
|
||||||
static int get_cluster_offset(BlockDriverState *bs,
|
static int coroutine_fn get_cluster_offset(BlockDriverState *bs,
|
||||||
uint64_t offset, int allocate,
|
uint64_t offset, int allocate,
|
||||||
int compressed_size,
|
int compressed_size,
|
||||||
int n_start, int n_end, uint64_t *result)
|
int n_start, int n_end,
|
||||||
|
uint64_t *result)
|
||||||
{
|
{
|
||||||
BDRVQcowState *s = bs->opaque;
|
BDRVQcowState *s = bs->opaque;
|
||||||
int min_index, i, j, l1_index, l2_index, ret;
|
int min_index, i, j, l1_index, l2_index, ret;
|
||||||
|
@ -583,7 +585,8 @@ static int decompress_buffer(uint8_t *out_buf, int out_buf_size,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset)
|
static int coroutine_fn decompress_cluster(BlockDriverState *bs,
|
||||||
|
uint64_t cluster_offset)
|
||||||
{
|
{
|
||||||
BDRVQcowState *s = bs->opaque;
|
BDRVQcowState *s = bs->opaque;
|
||||||
int ret, csize;
|
int ret, csize;
|
||||||
|
|
Loading…
Reference in New Issue