mirror of https://github.com/xqemu/xqemu.git
commit: Implement bdrv_commit_top.bdrv_co_get_block_status
In some cases, bdrv_co_get_block_status() is called recursively for the whole backing chain. The automatically inserted bdrv_commit_top filter driver must not stop the recursion, so implement a callback that simply forwards the request to bs->backing. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
b64aa44195
commit
9196565866
|
@ -232,6 +232,17 @@ static int coroutine_fn bdrv_commit_top_preadv(BlockDriverState *bs,
|
||||||
return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags);
|
return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int64_t coroutine_fn bdrv_commit_top_get_block_status(
|
||||||
|
BlockDriverState *bs, int64_t sector_num, int nb_sectors, int *pnum,
|
||||||
|
BlockDriverState **file)
|
||||||
|
{
|
||||||
|
*pnum = nb_sectors;
|
||||||
|
*file = bs->backing->bs;
|
||||||
|
return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
|
||||||
|
(sector_num << BDRV_SECTOR_BITS);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void bdrv_commit_top_close(BlockDriverState *bs)
|
static void bdrv_commit_top_close(BlockDriverState *bs)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -250,6 +261,7 @@ static void bdrv_commit_top_child_perm(BlockDriverState *bs, BdrvChild *c,
|
||||||
static BlockDriver bdrv_commit_top = {
|
static BlockDriver bdrv_commit_top = {
|
||||||
.format_name = "commit_top",
|
.format_name = "commit_top",
|
||||||
.bdrv_co_preadv = bdrv_commit_top_preadv,
|
.bdrv_co_preadv = bdrv_commit_top_preadv,
|
||||||
|
.bdrv_co_get_block_status = bdrv_commit_top_get_block_status,
|
||||||
.bdrv_close = bdrv_commit_top_close,
|
.bdrv_close = bdrv_commit_top_close,
|
||||||
.bdrv_child_perm = bdrv_commit_top_child_perm,
|
.bdrv_child_perm = bdrv_commit_top_child_perm,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue