aboutsummaryrefslogtreecommitdiff
path: root/block-cow.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-cow.c
parent0bfe3ca51ebddbf2cc099fa34f359bd1ac4f65e6 (diff)
Convert block infrastructure to use new module init functionality
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block-cow.c')
-rw-r--r--block-cow.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/block-cow.c b/block-cow.c
index 17e3292258..94b3549389 100644
--- a/block-cow.c
+++ b/block-cow.c
@@ -24,6 +24,7 @@
#ifndef _WIN32
#include "qemu-common.h"
#include "block_int.h"
+#include "module.h"
#include <sys/mman.h>
/**************************************************************/
@@ -252,7 +253,7 @@ static void cow_flush(BlockDriverState *bs)
fsync(s->fd);
}
-BlockDriver bdrv_cow = {
+static BlockDriver bdrv_cow = {
.format_name = "cow",
.instance_size = sizeof(BDRVCowState),
.bdrv_probe = cow_probe,
@@ -264,4 +265,11 @@ BlockDriver bdrv_cow = {
.bdrv_flush = cow_flush,
.bdrv_is_allocated = cow_is_allocated,
};
+
+static void bdrv_cow_init(void)
+{
+ bdrv_register(&bdrv_cow);
+}
+
+block_init(bdrv_cow_init);
#endif