Loading block/block-backend.c +10 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ struct BlockBackend { uint64_t shared_perm; bool disable_perm; bool allow_aio_context_change; bool allow_write_beyond_eof; NotifierList remove_bs_notifiers, insert_bs_notifiers; Loading Loading @@ -1092,6 +1093,11 @@ void blk_set_allow_write_beyond_eof(BlockBackend *blk, bool allow) blk->allow_write_beyond_eof = allow; } void blk_set_allow_aio_context_change(BlockBackend *blk, bool allow) { blk->allow_aio_context_change = allow; } static int blk_check_byte_request(BlockBackend *blk, int64_t offset, size_t size) { Loading Loading @@ -1891,6 +1897,10 @@ static bool blk_root_can_set_aio_ctx(BdrvChild *child, AioContext *ctx, { BlockBackend *blk = child->opaque; if (blk->allow_aio_context_change) { return true; } /* Only manually created BlockBackends that are not attached to anything * can change their AioContext without updating their user. */ if (!blk->name || blk->dev) { Loading include/sysemu/block-backend.h +1 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ int blk_set_perm(BlockBackend *blk, uint64_t perm, uint64_t shared_perm, void blk_get_perm(BlockBackend *blk, uint64_t *perm, uint64_t *shared_perm); void blk_set_allow_write_beyond_eof(BlockBackend *blk, bool allow); void blk_set_allow_aio_context_change(BlockBackend *blk, bool allow); void blk_iostatus_enable(BlockBackend *blk); bool blk_iostatus_is_enabled(const BlockBackend *blk); BlockDeviceIoStatus blk_iostatus(const BlockBackend *blk); Loading Loading
block/block-backend.c +10 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ struct BlockBackend { uint64_t shared_perm; bool disable_perm; bool allow_aio_context_change; bool allow_write_beyond_eof; NotifierList remove_bs_notifiers, insert_bs_notifiers; Loading Loading @@ -1092,6 +1093,11 @@ void blk_set_allow_write_beyond_eof(BlockBackend *blk, bool allow) blk->allow_write_beyond_eof = allow; } void blk_set_allow_aio_context_change(BlockBackend *blk, bool allow) { blk->allow_aio_context_change = allow; } static int blk_check_byte_request(BlockBackend *blk, int64_t offset, size_t size) { Loading Loading @@ -1891,6 +1897,10 @@ static bool blk_root_can_set_aio_ctx(BdrvChild *child, AioContext *ctx, { BlockBackend *blk = child->opaque; if (blk->allow_aio_context_change) { return true; } /* Only manually created BlockBackends that are not attached to anything * can change their AioContext without updating their user. */ if (!blk->name || blk->dev) { Loading
include/sysemu/block-backend.h +1 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,7 @@ int blk_set_perm(BlockBackend *blk, uint64_t perm, uint64_t shared_perm, void blk_get_perm(BlockBackend *blk, uint64_t *perm, uint64_t *shared_perm); void blk_set_allow_write_beyond_eof(BlockBackend *blk, bool allow); void blk_set_allow_aio_context_change(BlockBackend *blk, bool allow); void blk_iostatus_enable(BlockBackend *blk); bool blk_iostatus_is_enabled(const BlockBackend *blk); BlockDeviceIoStatus blk_iostatus(const BlockBackend *blk); Loading