cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 6fa5e64aabc703a4338a4e8705f6398df856009a Mon Sep 17 00:00:00 2001
9ae3a8
From: Orit Wasserman <owasserm@redhat.com>
9ae3a8
Date: Wed, 9 Oct 2013 10:09:07 +0200
9ae3a8
Subject: [PATCH 12/25] block/raw: add bdrv_co_write_zeroes
9ae3a8
9ae3a8
RH-Author: Orit Wasserman <owasserm@redhat.com>
9ae3a8
Message-id: <1381313355-15641-3-git-send-email-owasserm@redhat.com>
9ae3a8
Patchwork-id: 54798
9ae3a8
O-Subject: [RHEL7.0 qemu-kvm v2 02/10] block/raw: add bdrv_co_write_zeroes
9ae3a8
Bugzilla: 921465
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Juan Quintela <quintela@redhat.com>
9ae3a8
9ae3a8
From: Peter Lieven <pl@kamp.de>
9ae3a8
9ae3a8
Signed-off-by: Peter Lieven <pl@kamp.de>
9ae3a8
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
(cherry picked from commit 8bf9344ad6883e6d85b69bab36d9d76e4257e9ed)
9ae3a8
---
9ae3a8
 block/raw.c | 8 ++++++++
9ae3a8
 1 file changed, 8 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block/raw.c |    8 ++++++++
9ae3a8
 1 files changed, 8 insertions(+), 0 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/raw.c b/block/raw.c
9ae3a8
index ce10422..8c81de9 100644
9ae3a8
--- a/block/raw.c
9ae3a8
+++ b/block/raw.c
9ae3a8
@@ -42,6 +42,13 @@ static int coroutine_fn raw_co_is_allocated(BlockDriverState *bs,
9ae3a8
     return bdrv_co_is_allocated(bs->file, sector_num, nb_sectors, pnum);
9ae3a8
 }
9ae3a8
 
9ae3a8
+static int coroutine_fn raw_co_write_zeroes(BlockDriverState *bs,
9ae3a8
+                                            int64_t sector_num,
9ae3a8
+                                            int nb_sectors)
9ae3a8
+{
9ae3a8
+    return bdrv_co_write_zeroes(bs->file, sector_num, nb_sectors);
9ae3a8
+}
9ae3a8
+
9ae3a8
 static int64_t raw_getlength(BlockDriverState *bs)
9ae3a8
 {
9ae3a8
     return bdrv_getlength(bs->file);
9ae3a8
@@ -128,6 +135,7 @@ static BlockDriver bdrv_raw = {
9ae3a8
     .bdrv_co_readv          = raw_co_readv,
9ae3a8
     .bdrv_co_writev         = raw_co_writev,
9ae3a8
     .bdrv_co_is_allocated   = raw_co_is_allocated,
9ae3a8
+    .bdrv_co_write_zeroes   = raw_co_write_zeroes,
9ae3a8
     .bdrv_co_discard        = raw_co_discard,
9ae3a8
 
9ae3a8
     .bdrv_probe         = raw_probe,
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8