aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
Diffstat (limited to 'block.c')
-rw-r--r--block.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/block.c b/block.c
index eb1d5621b5..56835afc56 100644
--- a/block.c
+++ b/block.c
@@ -1282,6 +1282,19 @@ void bdrv_flush_all(void)
}
}
+int bdrv_has_zero_init(BlockDriverState *bs)
+{
+ assert(bs->drv);
+
+ if (bs->drv->no_zero_init) {
+ return 0;
+ } else if (bs->file) {
+ return bdrv_has_zero_init(bs->file);
+ }
+
+ return 1;
+}
+
/*
* Returns true iff the specified sector is present in the disk image. Drivers
* not implementing the functionality are assumed to not support backing files,