aboutsummaryrefslogtreecommitdiff
path: root/block-raw-posix.c
diff options
context:
space:
mode:
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);