diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2015-04-28 14:27:51 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-04-28 15:36:17 +0200 |
commit | 0eb7217e49b84553bb30f97bc34380633fd846fe (patch) | |
tree | 1985de5f1a30ed6c4f15aef4baa4ad9e2d568eb4 /block.c | |
parent | e0c47b6cb1de430fbc6f828f7acffa851c580840 (diff) | |
download | qemu-0eb7217e49b84553bb30f97bc34380633fd846fe.tar.gz qemu-0eb7217e49b84553bb30f97bc34380633fd846fe.tar.bz2 qemu-0eb7217e49b84553bb30f97bc34380633fd846fe.zip |
block: extract bdrv_setup_io_funcs()
Move the code to install coroutine and aio emulation function pointers
in a BlockDriver to its own function.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -349,7 +349,7 @@ void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz, dest, sz, errp); } -void bdrv_register(BlockDriver *bdrv) +void bdrv_setup_io_funcs(BlockDriver *bdrv) { /* Block drivers without coroutine functions need emulation */ if (!bdrv->bdrv_co_readv) { @@ -365,6 +365,11 @@ void bdrv_register(BlockDriver *bdrv) bdrv->bdrv_aio_writev = bdrv_aio_writev_em; } } +} + +void bdrv_register(BlockDriver *bdrv) +{ + bdrv_setup_io_funcs(bdrv); QLIST_INSERT_HEAD(&bdrv_drivers, bdrv, list); } |