mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
block: Convert bdrv_get_info() to co_wrapper_mixed
bdrv_get_info() is categorized as an I/O function, and it currently doesn't run in a coroutine. We should let it take a graph rdlock since it traverses the block nodes graph, which however is only possible in a coroutine. Therefore turn it into a co_wrapper to move the actual function into a coroutine where the lock can be taken. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20230113204212.359076-11-kwolf@redhat.com> Reviewed-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
82618d7bc3
commit
3d47eb0a2a
18 changed files with 59 additions and 43 deletions
8
block.c
8
block.c
|
@ -6301,7 +6301,7 @@ void bdrv_get_backing_filename(BlockDriverState *bs,
|
||||||
pstrcpy(filename, filename_size, bs->backing_file);
|
pstrcpy(filename, filename_size, bs->backing_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
int coroutine_fn bdrv_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
BlockDriver *drv = bs->drv;
|
BlockDriver *drv = bs->drv;
|
||||||
|
@ -6310,15 +6310,15 @@ int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
if (!drv) {
|
if (!drv) {
|
||||||
return -ENOMEDIUM;
|
return -ENOMEDIUM;
|
||||||
}
|
}
|
||||||
if (!drv->bdrv_get_info) {
|
if (!drv->bdrv_co_get_info) {
|
||||||
BlockDriverState *filtered = bdrv_filter_bs(bs);
|
BlockDriverState *filtered = bdrv_filter_bs(bs);
|
||||||
if (filtered) {
|
if (filtered) {
|
||||||
return bdrv_get_info(filtered, bdi);
|
return bdrv_co_get_info(filtered, bdi);
|
||||||
}
|
}
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
memset(bdi, 0, sizeof(*bdi));
|
memset(bdi, 0, sizeof(*bdi));
|
||||||
ret = drv->bdrv_get_info(bs, bdi);
|
ret = drv->bdrv_co_get_info(bs, bdi);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -880,7 +880,8 @@ static int coroutine_fn blkio_truncate(BlockDriverState *bs, int64_t offset,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int blkio_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
blkio_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1000,7 +1001,7 @@ static void blkio_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||||
.bdrv_close = blkio_close, \
|
.bdrv_close = blkio_close, \
|
||||||
.bdrv_co_getlength = blkio_co_getlength, \
|
.bdrv_co_getlength = blkio_co_getlength, \
|
||||||
.bdrv_co_truncate = blkio_truncate, \
|
.bdrv_co_truncate = blkio_truncate, \
|
||||||
.bdrv_get_info = blkio_get_info, \
|
.bdrv_co_get_info = blkio_co_get_info, \
|
||||||
.bdrv_attach_aio_context = blkio_attach_aio_context, \
|
.bdrv_attach_aio_context = blkio_attach_aio_context, \
|
||||||
.bdrv_detach_aio_context = blkio_detach_aio_context, \
|
.bdrv_detach_aio_context = blkio_detach_aio_context, \
|
||||||
.bdrv_co_pdiscard = blkio_co_pdiscard, \
|
.bdrv_co_pdiscard = blkio_co_pdiscard, \
|
||||||
|
|
|
@ -737,13 +737,13 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int block_crypto_get_info_luks(BlockDriverState *bs,
|
static int coroutine_fn
|
||||||
BlockDriverInfo *bdi)
|
block_crypto_co_get_info_luks(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BlockDriverInfo subbdi;
|
BlockDriverInfo subbdi;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = bdrv_get_info(bs->file->bs, &subbdi);
|
ret = bdrv_co_get_info(bs->file->bs, &subbdi);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -955,7 +955,7 @@ static BlockDriver bdrv_crypto_luks = {
|
||||||
.bdrv_co_pwritev = block_crypto_co_pwritev,
|
.bdrv_co_pwritev = block_crypto_co_pwritev,
|
||||||
.bdrv_co_getlength = block_crypto_co_getlength,
|
.bdrv_co_getlength = block_crypto_co_getlength,
|
||||||
.bdrv_measure = block_crypto_measure,
|
.bdrv_measure = block_crypto_measure,
|
||||||
.bdrv_get_info = block_crypto_get_info_luks,
|
.bdrv_co_get_info = block_crypto_co_get_info_luks,
|
||||||
.bdrv_get_specific_info = block_crypto_get_specific_info_luks,
|
.bdrv_get_specific_info = block_crypto_get_specific_info_luks,
|
||||||
.bdrv_amend_options = block_crypto_amend_options_luks,
|
.bdrv_amend_options = block_crypto_amend_options_luks,
|
||||||
.bdrv_co_amend = block_crypto_co_amend_luks,
|
.bdrv_co_amend = block_crypto_co_amend_luks,
|
||||||
|
|
|
@ -3086,7 +3086,8 @@ static int coroutine_fn raw_co_pwrite_zeroes(
|
||||||
return raw_do_pwrite_zeroes(bs, offset, bytes, flags, false);
|
return raw_do_pwrite_zeroes(bs, offset, bytes, flags, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
raw_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3323,7 +3324,7 @@ BlockDriver bdrv_file = {
|
||||||
|
|
||||||
.bdrv_co_truncate = raw_co_truncate,
|
.bdrv_co_truncate = raw_co_truncate,
|
||||||
.bdrv_co_getlength = raw_co_getlength,
|
.bdrv_co_getlength = raw_co_getlength,
|
||||||
.bdrv_get_info = raw_get_info,
|
.bdrv_co_get_info = raw_co_get_info,
|
||||||
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
||||||
.bdrv_get_specific_stats = raw_get_specific_stats,
|
.bdrv_get_specific_stats = raw_get_specific_stats,
|
||||||
.bdrv_check_perm = raw_check_perm,
|
.bdrv_check_perm = raw_check_perm,
|
||||||
|
@ -3694,7 +3695,7 @@ static BlockDriver bdrv_host_device = {
|
||||||
|
|
||||||
.bdrv_co_truncate = raw_co_truncate,
|
.bdrv_co_truncate = raw_co_truncate,
|
||||||
.bdrv_co_getlength = raw_co_getlength,
|
.bdrv_co_getlength = raw_co_getlength,
|
||||||
.bdrv_get_info = raw_get_info,
|
.bdrv_co_get_info = raw_co_get_info,
|
||||||
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
.bdrv_co_get_allocated_file_size = raw_co_get_allocated_file_size,
|
||||||
.bdrv_get_specific_stats = hdev_get_specific_stats,
|
.bdrv_get_specific_stats = hdev_get_specific_stats,
|
||||||
.bdrv_check_perm = raw_check_perm,
|
.bdrv_check_perm = raw_check_perm,
|
||||||
|
|
|
@ -722,14 +722,14 @@ BdrvTrackedRequest *coroutine_fn bdrv_co_get_self_request(BlockDriverState *bs)
|
||||||
/**
|
/**
|
||||||
* Round a region to cluster boundaries
|
* Round a region to cluster boundaries
|
||||||
*/
|
*/
|
||||||
void bdrv_round_to_clusters(BlockDriverState *bs,
|
void coroutine_fn bdrv_round_to_clusters(BlockDriverState *bs,
|
||||||
int64_t offset, int64_t bytes,
|
int64_t offset, int64_t bytes,
|
||||||
int64_t *cluster_offset,
|
int64_t *cluster_offset,
|
||||||
int64_t *cluster_bytes)
|
int64_t *cluster_bytes)
|
||||||
{
|
{
|
||||||
BlockDriverInfo bdi;
|
BlockDriverInfo bdi;
|
||||||
IO_CODE();
|
IO_CODE();
|
||||||
if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {
|
if (bdrv_co_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {
|
||||||
*cluster_offset = offset;
|
*cluster_offset = offset;
|
||||||
*cluster_bytes = bytes;
|
*cluster_bytes = bytes;
|
||||||
} else {
|
} else {
|
||||||
|
@ -739,12 +739,12 @@ void bdrv_round_to_clusters(BlockDriverState *bs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bdrv_get_cluster_size(BlockDriverState *bs)
|
static coroutine_fn int bdrv_get_cluster_size(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
BlockDriverInfo bdi;
|
BlockDriverInfo bdi;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = bdrv_get_info(bs, &bdi);
|
ret = bdrv_co_get_info(bs, &bdi);
|
||||||
if (ret < 0 || bdi.cluster_size == 0) {
|
if (ret < 0 || bdi.cluster_size == 0) {
|
||||||
return bs->bl.request_alignment;
|
return bs->bl.request_alignment;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2171,7 +2171,8 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
iscsi_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
IscsiLun *iscsilun = bs->opaque;
|
IscsiLun *iscsilun = bs->opaque;
|
||||||
bdi->cluster_size = iscsilun->cluster_size;
|
bdi->cluster_size = iscsilun->cluster_size;
|
||||||
|
@ -2435,7 +2436,7 @@ static BlockDriver bdrv_iscsi = {
|
||||||
.bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
|
.bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
|
||||||
|
|
||||||
.bdrv_co_getlength = iscsi_co_getlength,
|
.bdrv_co_getlength = iscsi_co_getlength,
|
||||||
.bdrv_get_info = iscsi_get_info,
|
.bdrv_co_get_info = iscsi_co_get_info,
|
||||||
.bdrv_co_truncate = iscsi_co_truncate,
|
.bdrv_co_truncate = iscsi_co_truncate,
|
||||||
.bdrv_refresh_limits = iscsi_refresh_limits,
|
.bdrv_refresh_limits = iscsi_refresh_limits,
|
||||||
|
|
||||||
|
@ -2474,7 +2475,7 @@ static BlockDriver bdrv_iser = {
|
||||||
.bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
|
.bdrv_co_invalidate_cache = iscsi_co_invalidate_cache,
|
||||||
|
|
||||||
.bdrv_co_getlength = iscsi_co_getlength,
|
.bdrv_co_getlength = iscsi_co_getlength,
|
||||||
.bdrv_get_info = iscsi_get_info,
|
.bdrv_co_get_info = iscsi_co_get_info,
|
||||||
.bdrv_co_truncate = iscsi_co_truncate,
|
.bdrv_co_truncate = iscsi_co_truncate,
|
||||||
.bdrv_refresh_limits = iscsi_refresh_limits,
|
.bdrv_refresh_limits = iscsi_refresh_limits,
|
||||||
|
|
||||||
|
|
|
@ -957,7 +957,7 @@ static int coroutine_fn mirror_run(Job *job, Error **errp)
|
||||||
*/
|
*/
|
||||||
bdrv_get_backing_filename(target_bs, backing_filename,
|
bdrv_get_backing_filename(target_bs, backing_filename,
|
||||||
sizeof(backing_filename));
|
sizeof(backing_filename));
|
||||||
if (!bdrv_get_info(target_bs, &bdi) && bdi.cluster_size) {
|
if (!bdrv_co_get_info(target_bs, &bdi) && bdi.cluster_size) {
|
||||||
s->target_cluster_size = bdi.cluster_size;
|
s->target_cluster_size = bdi.cluster_size;
|
||||||
} else {
|
} else {
|
||||||
s->target_cluster_size = BDRV_SECTOR_SIZE;
|
s->target_cluster_size = BDRV_SECTOR_SIZE;
|
||||||
|
|
|
@ -1129,7 +1129,8 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qcow_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
qcow_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BDRVQcowState *s = bs->opaque;
|
BDRVQcowState *s = bs->opaque;
|
||||||
bdi->cluster_size = s->cluster_size;
|
bdi->cluster_size = s->cluster_size;
|
||||||
|
@ -1198,7 +1199,7 @@ static BlockDriver bdrv_qcow = {
|
||||||
|
|
||||||
.bdrv_make_empty = qcow_make_empty,
|
.bdrv_make_empty = qcow_make_empty,
|
||||||
.bdrv_co_pwritev_compressed = qcow_co_pwritev_compressed,
|
.bdrv_co_pwritev_compressed = qcow_co_pwritev_compressed,
|
||||||
.bdrv_get_info = qcow_get_info,
|
.bdrv_co_get_info = qcow_co_get_info,
|
||||||
|
|
||||||
.create_opts = &qcow_create_opts,
|
.create_opts = &qcow_create_opts,
|
||||||
.strong_runtime_opts = qcow_strong_runtime_opts,
|
.strong_runtime_opts = qcow_strong_runtime_opts,
|
||||||
|
|
|
@ -5143,7 +5143,8 @@ err:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
qcow2_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BDRVQcow2State *s = bs->opaque;
|
BDRVQcow2State *s = bs->opaque;
|
||||||
bdi->cluster_size = s->cluster_size;
|
bdi->cluster_size = s->cluster_size;
|
||||||
|
@ -6077,7 +6078,7 @@ BlockDriver bdrv_qcow2 = {
|
||||||
.bdrv_snapshot_list = qcow2_snapshot_list,
|
.bdrv_snapshot_list = qcow2_snapshot_list,
|
||||||
.bdrv_snapshot_load_tmp = qcow2_snapshot_load_tmp,
|
.bdrv_snapshot_load_tmp = qcow2_snapshot_load_tmp,
|
||||||
.bdrv_measure = qcow2_measure,
|
.bdrv_measure = qcow2_measure,
|
||||||
.bdrv_get_info = qcow2_get_info,
|
.bdrv_co_get_info = qcow2_co_get_info,
|
||||||
.bdrv_get_specific_info = qcow2_get_specific_info,
|
.bdrv_get_specific_info = qcow2_get_specific_info,
|
||||||
|
|
||||||
.bdrv_save_vmstate = qcow2_save_vmstate,
|
.bdrv_save_vmstate = qcow2_save_vmstate,
|
||||||
|
|
|
@ -1486,7 +1486,8 @@ static int64_t coroutine_fn bdrv_qed_co_getlength(BlockDriverState *bs)
|
||||||
return s->header.image_size;
|
return s->header.image_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bdrv_qed_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
bdrv_qed_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BDRVQEDState *s = bs->opaque;
|
BDRVQEDState *s = bs->opaque;
|
||||||
|
|
||||||
|
@ -1654,7 +1655,7 @@ static BlockDriver bdrv_qed = {
|
||||||
.bdrv_co_pwrite_zeroes = bdrv_qed_co_pwrite_zeroes,
|
.bdrv_co_pwrite_zeroes = bdrv_qed_co_pwrite_zeroes,
|
||||||
.bdrv_co_truncate = bdrv_qed_co_truncate,
|
.bdrv_co_truncate = bdrv_qed_co_truncate,
|
||||||
.bdrv_co_getlength = bdrv_qed_co_getlength,
|
.bdrv_co_getlength = bdrv_qed_co_getlength,
|
||||||
.bdrv_get_info = bdrv_qed_get_info,
|
.bdrv_co_get_info = bdrv_qed_co_get_info,
|
||||||
.bdrv_refresh_limits = bdrv_qed_refresh_limits,
|
.bdrv_refresh_limits = bdrv_qed_refresh_limits,
|
||||||
.bdrv_change_backing_file = bdrv_qed_change_backing_file,
|
.bdrv_change_backing_file = bdrv_qed_change_backing_file,
|
||||||
.bdrv_co_invalidate_cache = bdrv_qed_co_invalidate_cache,
|
.bdrv_co_invalidate_cache = bdrv_qed_co_invalidate_cache,
|
||||||
|
|
|
@ -368,9 +368,10 @@ static BlockMeasureInfo *raw_measure(QemuOpts *opts, BlockDriverState *in_bs,
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
raw_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
return bdrv_get_info(bs->file->bs, bdi);
|
return bdrv_co_get_info(bs->file->bs, bdi);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
|
static void raw_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||||
|
@ -626,7 +627,7 @@ BlockDriver bdrv_raw = {
|
||||||
.is_format = true,
|
.is_format = true,
|
||||||
.has_variable_length = true,
|
.has_variable_length = true,
|
||||||
.bdrv_measure = &raw_measure,
|
.bdrv_measure = &raw_measure,
|
||||||
.bdrv_get_info = &raw_get_info,
|
.bdrv_co_get_info = &raw_co_get_info,
|
||||||
.bdrv_refresh_limits = &raw_refresh_limits,
|
.bdrv_refresh_limits = &raw_refresh_limits,
|
||||||
.bdrv_probe_blocksizes = &raw_probe_blocksizes,
|
.bdrv_probe_blocksizes = &raw_probe_blocksizes,
|
||||||
.bdrv_probe_geometry = &raw_probe_geometry,
|
.bdrv_probe_geometry = &raw_probe_geometry,
|
||||||
|
|
|
@ -1240,7 +1240,8 @@ coroutine_fn qemu_rbd_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int qemu_rbd_getinfo(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
qemu_rbd_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BDRVRBDState *s = bs->opaque;
|
BDRVRBDState *s = bs->opaque;
|
||||||
bdi->cluster_size = s->object_size;
|
bdi->cluster_size = s->object_size;
|
||||||
|
@ -1651,7 +1652,7 @@ static BlockDriver bdrv_rbd = {
|
||||||
.bdrv_co_create = qemu_rbd_co_create,
|
.bdrv_co_create = qemu_rbd_co_create,
|
||||||
.bdrv_co_create_opts = qemu_rbd_co_create_opts,
|
.bdrv_co_create_opts = qemu_rbd_co_create_opts,
|
||||||
.bdrv_has_zero_init = bdrv_has_zero_init_1,
|
.bdrv_has_zero_init = bdrv_has_zero_init_1,
|
||||||
.bdrv_get_info = qemu_rbd_getinfo,
|
.bdrv_co_get_info = qemu_rbd_co_get_info,
|
||||||
.bdrv_get_specific_info = qemu_rbd_get_specific_info,
|
.bdrv_get_specific_info = qemu_rbd_get_specific_info,
|
||||||
.create_opts = &qemu_rbd_create_opts,
|
.create_opts = &qemu_rbd_create_opts,
|
||||||
.bdrv_co_getlength = qemu_rbd_co_getlength,
|
.bdrv_co_getlength = qemu_rbd_co_getlength,
|
||||||
|
|
|
@ -327,9 +327,10 @@ static int coroutine_fn vdi_co_check(BlockDriverState *bs, BdrvCheckResult *res,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vdi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
vdi_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
/* TODO: vdi_get_info would be needed for machine snapshots.
|
/* TODO: vdi_co_get_info would be needed for machine snapshots.
|
||||||
vm_state_offset is still missing. */
|
vm_state_offset is still missing. */
|
||||||
BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
|
BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
|
||||||
logout("\n");
|
logout("\n");
|
||||||
|
@ -1049,7 +1050,7 @@ static BlockDriver bdrv_vdi = {
|
||||||
.bdrv_co_pwritev = vdi_co_pwritev,
|
.bdrv_co_pwritev = vdi_co_pwritev,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
.bdrv_get_info = vdi_get_info,
|
.bdrv_co_get_info = vdi_co_get_info,
|
||||||
|
|
||||||
.is_format = true,
|
.is_format = true,
|
||||||
.create_opts = &vdi_create_opts,
|
.create_opts = &vdi_create_opts,
|
||||||
|
|
|
@ -1161,7 +1161,8 @@ static void vhdx_block_translate(BDRVVHDXState *s, int64_t sector_num,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int vhdx_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
vhdx_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BDRVVHDXState *s = bs->opaque;
|
BDRVVHDXState *s = bs->opaque;
|
||||||
|
|
||||||
|
@ -2245,7 +2246,7 @@ static BlockDriver bdrv_vhdx = {
|
||||||
.bdrv_co_writev = vhdx_co_writev,
|
.bdrv_co_writev = vhdx_co_writev,
|
||||||
.bdrv_co_create = vhdx_co_create,
|
.bdrv_co_create = vhdx_co_create,
|
||||||
.bdrv_co_create_opts = vhdx_co_create_opts,
|
.bdrv_co_create_opts = vhdx_co_create_opts,
|
||||||
.bdrv_get_info = vhdx_get_info,
|
.bdrv_co_get_info = vhdx_co_get_info,
|
||||||
.bdrv_co_check = vhdx_co_check,
|
.bdrv_co_check = vhdx_co_check,
|
||||||
.bdrv_has_zero_init = vhdx_has_zero_init,
|
.bdrv_has_zero_init = vhdx_has_zero_init,
|
||||||
|
|
||||||
|
|
|
@ -3012,7 +3012,8 @@ static bool vmdk_extents_type_eq(const VmdkExtent *a, const VmdkExtent *b)
|
||||||
(a->flat || a->cluster_sectors == b->cluster_sectors);
|
(a->flat || a->cluster_sectors == b->cluster_sectors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vmdk_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
vmdk_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BDRVVmdkState *s = bs->opaque;
|
BDRVVmdkState *s = bs->opaque;
|
||||||
|
@ -3129,7 +3130,7 @@ static BlockDriver bdrv_vmdk = {
|
||||||
.bdrv_has_zero_init = vmdk_has_zero_init,
|
.bdrv_has_zero_init = vmdk_has_zero_init,
|
||||||
.bdrv_get_specific_info = vmdk_get_specific_info,
|
.bdrv_get_specific_info = vmdk_get_specific_info,
|
||||||
.bdrv_refresh_limits = vmdk_refresh_limits,
|
.bdrv_refresh_limits = vmdk_refresh_limits,
|
||||||
.bdrv_get_info = vmdk_get_info,
|
.bdrv_co_get_info = vmdk_co_get_info,
|
||||||
.bdrv_gather_child_options = vmdk_gather_child_options,
|
.bdrv_gather_child_options = vmdk_gather_child_options,
|
||||||
|
|
||||||
.is_format = true,
|
.is_format = true,
|
||||||
|
|
|
@ -598,7 +598,8 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vpc_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
static int coroutine_fn
|
||||||
|
vpc_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
|
||||||
{
|
{
|
||||||
BDRVVPCState *s = (BDRVVPCState *)bs->opaque;
|
BDRVVPCState *s = (BDRVVPCState *)bs->opaque;
|
||||||
|
|
||||||
|
@ -1240,7 +1241,7 @@ static BlockDriver bdrv_vpc = {
|
||||||
.bdrv_co_pwritev = vpc_co_pwritev,
|
.bdrv_co_pwritev = vpc_co_pwritev,
|
||||||
.bdrv_co_block_status = vpc_co_block_status,
|
.bdrv_co_block_status = vpc_co_block_status,
|
||||||
|
|
||||||
.bdrv_get_info = vpc_get_info,
|
.bdrv_co_get_info = vpc_co_get_info,
|
||||||
|
|
||||||
.is_format = true,
|
.is_format = true,
|
||||||
.create_opts = &vpc_create_opts,
|
.create_opts = &vpc_create_opts,
|
||||||
|
|
|
@ -154,7 +154,10 @@ bool bdrv_supports_compressed_writes(BlockDriverState *bs);
|
||||||
const char *bdrv_get_node_name(const BlockDriverState *bs);
|
const char *bdrv_get_node_name(const BlockDriverState *bs);
|
||||||
const char *bdrv_get_device_name(const BlockDriverState *bs);
|
const char *bdrv_get_device_name(const BlockDriverState *bs);
|
||||||
const char *bdrv_get_device_or_node_name(const BlockDriverState *bs);
|
const char *bdrv_get_device_or_node_name(const BlockDriverState *bs);
|
||||||
int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
|
|
||||||
|
int coroutine_fn bdrv_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
|
||||||
|
int co_wrapper_mixed bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
|
||||||
|
|
||||||
ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs,
|
ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
BlockStatsSpecific *bdrv_get_specific_stats(BlockDriverState *bs);
|
BlockStatsSpecific *bdrv_get_specific_stats(BlockDriverState *bs);
|
||||||
|
|
|
@ -693,7 +693,8 @@ struct BlockDriver {
|
||||||
int64_t offset, int64_t bytes, QEMUIOVector *qiov,
|
int64_t offset, int64_t bytes, QEMUIOVector *qiov,
|
||||||
size_t qiov_offset);
|
size_t qiov_offset);
|
||||||
|
|
||||||
int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi);
|
int coroutine_fn (*bdrv_co_get_info)(BlockDriverState *bs,
|
||||||
|
BlockDriverInfo *bdi);
|
||||||
|
|
||||||
ImageInfoSpecific *(*bdrv_get_specific_info)(BlockDriverState *bs,
|
ImageInfoSpecific *(*bdrv_get_specific_info)(BlockDriverState *bs,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue