diff mbox

[RFC,3/4] qcow2: implement bdrv_zero_init

Message ID 04300ac9c374bb7e001456dc4e56201d6050072f.1384227383.git.hutao@cn.fujitsu.com
State New
Headers show

Commit Message

Hu Tao Nov. 12, 2013, 7:47 a.m. UTC
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
---
 block/qcow2.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 6e5d98d..359030f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2180,6 +2180,12 @@  static int qcow2_amend_options(BlockDriverState *bs,
     return 0;
 }
 
+static int qcow2_zero_init(BlockDriverState *bs, int64_t offset,
+                           int64_t length)
+{
+    return bdrv_zero_init(bs->file, offset, length);
+}
+
 static QEMUOptionParameter qcow2_create_options[] = {
     {
         .name = BLOCK_OPT_SIZE,
@@ -2234,6 +2240,7 @@  static BlockDriver bdrv_qcow2 = {
     .bdrv_reopen_prepare  = qcow2_reopen_prepare,
     .bdrv_create        = qcow2_create,
     .bdrv_has_zero_init = bdrv_has_zero_init_1,
+    .bdrv_zero_init     = qcow2_zero_init,
     .bdrv_co_get_block_status = qcow2_co_get_block_status,
     .bdrv_set_key       = qcow2_set_key,
     .bdrv_make_empty    = qcow2_make_empty,