[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 75/76] block: extract bdrv_setup_io_funcs()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 75/76] block: extract bdrv_setup_io_funcs() |
Date: |
Tue, 28 Apr 2015 17:00:57 +0200 |
From: Stefan Hajnoczi <address@hidden>
Move the code to install coroutine and aio emulation function pointers
in a BlockDriver to its own function.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 7 ++++++-
include/block/block_int.h | 8 ++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 3b865ee..954d783 100644
--- a/block.c
+++ b/block.c
@@ -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);
}
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 5ad20b2..db29b74 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -439,6 +439,14 @@ extern BlockDriver bdrv_file;
extern BlockDriver bdrv_raw;
extern BlockDriver bdrv_qcow2;
+/**
+ * bdrv_setup_io_funcs:
+ *
+ * Prepare a #BlockDriver for I/O request processing by populating
+ * unimplemented coroutine and AIO interfaces with generic wrapper functions
+ * that fall back to implemented interfaces.
+ */
+void bdrv_setup_io_funcs(BlockDriver *bdrv);
int get_tmp_filename(char *filename, int size);
BlockDriver *bdrv_probe_all(const uint8_t *buf, int buf_size,
--
1.8.3.1
- [Qemu-devel] [PULL 64/76] hbitmap: truncate tests, (continued)
- [Qemu-devel] [PULL 64/76] hbitmap: truncate tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 65/76] iotests: add invalid input incremental backup tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 68/76] iotests: add incremental backup failure recovery test, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 69/76] iotests: add incremental backup granularity tests, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 71/76] block/dmg: make it modular, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 70/76] block/mirror: Always call block_job_sleep_ns(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 73/76] block: replace bdrv_states iteration with bdrv_next(), Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 67/76] iotests: add simple incremental backup case, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 72/76] vmdk: Widen before shifting 32 bit header field, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 74/76] block: add bdrv_set_dirty()/bdrv_reset_dirty() to block_int.h, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 75/76] block: extract bdrv_setup_io_funcs(),
Kevin Wolf <=
- [Qemu-devel] [PULL 76/76] block: move I/O request processing to block/io.c, Kevin Wolf, 2015/04/28
- [Qemu-devel] [PULL 66/76] iotests: add QMP event waiting queue, Kevin Wolf, 2015/04/28
- Re: [Qemu-devel] [PULL 00/76] Block patches, Peter Maydell, 2015/04/28