Skip to content

Commit

Permalink
qed: switch to *_co_* functions
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Faria <afaria@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20221013123711.620631-21-pbonzini@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
albertofaria authored and kevmw committed Oct 27, 2022
1 parent 38505e2 commit 3aba34a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion block/qed-table.c
Expand Up @@ -100,7 +100,7 @@ static int coroutine_fn qed_write_table(BDRVQEDState *s, uint64_t offset,
}

if (flush) {
ret = bdrv_flush(s->bs);
ret = bdrv_co_flush(s->bs);
if (ret < 0) {
goto out;
}
Expand Down
12 changes: 6 additions & 6 deletions block/qed.c
Expand Up @@ -387,7 +387,7 @@ static int coroutine_fn bdrv_qed_do_open(BlockDriverState *bs, QDict *options,
int64_t file_size;
int ret;

ret = bdrv_pread(bs->file, 0, sizeof(le_header), &le_header, 0);
ret = bdrv_co_pread(bs->file, 0, sizeof(le_header), &le_header, 0);
if (ret < 0) {
error_setg(errp, "Failed to read QED header");
return ret;
Expand Down Expand Up @@ -492,7 +492,7 @@ static int coroutine_fn bdrv_qed_do_open(BlockDriverState *bs, QDict *options,
}

/* From here on only known autoclear feature bits are valid */
bdrv_flush(bs->file->bs);
bdrv_co_flush(bs->file->bs);
}

s->l1_table = qed_alloc_table(s);
Expand Down Expand Up @@ -693,7 +693,7 @@ static int coroutine_fn bdrv_qed_co_create(BlockdevCreateOptions *opts,
* The QED format associates file length with allocation status,
* so a new file (which is empty) must have a length of 0.
*/
ret = blk_truncate(blk, 0, true, PREALLOC_MODE_OFF, 0, errp);
ret = blk_co_truncate(blk, 0, true, PREALLOC_MODE_OFF, 0, errp);
if (ret < 0) {
goto out;
}
Expand All @@ -712,18 +712,18 @@ static int coroutine_fn bdrv_qed_co_create(BlockdevCreateOptions *opts,
}

qed_header_cpu_to_le(&header, &le_header);
ret = blk_pwrite(blk, 0, sizeof(le_header), &le_header, 0);
ret = blk_co_pwrite(blk, 0, sizeof(le_header), &le_header, 0);
if (ret < 0) {
goto out;
}
ret = blk_pwrite(blk, sizeof(le_header), header.backing_filename_size,
ret = blk_co_pwrite(blk, sizeof(le_header), header.backing_filename_size,
qed_opts->backing_file, 0);
if (ret < 0) {
goto out;
}

l1_table = g_malloc0(l1_size);
ret = blk_pwrite(blk, header.l1_table_offset, l1_size, l1_table, 0);
ret = blk_co_pwrite(blk, header.l1_table_offset, l1_size, l1_table, 0);
if (ret < 0) {
goto out;
}
Expand Down

0 comments on commit 3aba34a

Please sign in to comment.