aboutsummaryrefslogtreecommitdiff
path: root/block-raw-posix.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2009-05-09 17:03:42 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-14 16:13:41 -0500
commit5efa9d5a8b18841c9c62208a494d7f519238979a (patch)
treec3d65b0b6bd54ca614e4e7e4b8eb295117ba9d78 /block-raw-posix.c
parent0bfe3ca51ebddbf2cc099fa34f359bd1ac4f65e6 (diff)
downloadqemu-5efa9d5a8b18841c9c62208a494d7f519238979a.zip
qemu-5efa9d5a8b18841c9c62208a494d7f519238979a.tar.gz
qemu-5efa9d5a8b18841c9c62208a494d7f519238979a.tar.bz2
Convert block infrastructure to use new module init functionality
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block-raw-posix.c')
-rw-r--r--block-raw-posix.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/block-raw-posix.c b/block-raw-posix.c
index 406ec7d..f3a9476 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -25,6 +25,7 @@
#include "qemu-timer.h"
#include "qemu-char.h"
#include "block_int.h"
+#include "module.h"
#ifdef CONFIG_AIO
#include "posix-aio-compat.h"
#endif
@@ -845,7 +846,7 @@ static void raw_flush(BlockDriverState *bs)
fsync(s->fd);
}
-BlockDriver bdrv_raw = {
+static BlockDriver bdrv_raw = {
.format_name = "raw",
.instance_size = sizeof(BDRVRawState),
.bdrv_probe = NULL, /* no probe for protocols */
@@ -1397,7 +1398,7 @@ static int hdev_create(const char *filename, int64_t total_size,
}
#endif
-BlockDriver bdrv_host_device = {
+static BlockDriver bdrv_host_device = {
.format_name = "host_device",
.instance_size = sizeof(BDRVRawState),
.bdrv_open = hdev_open,
@@ -1427,3 +1428,11 @@ BlockDriver bdrv_host_device = {
.bdrv_aio_ioctl = raw_aio_ioctl,
#endif
};
+
+static void bdrv_raw_init(void)
+{
+ bdrv_register(&bdrv_raw);
+ bdrv_register(&bdrv_host_device);
+}
+
+block_init(bdrv_raw_init);