From patchwork Fri Jul 19 08:38:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 260209 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8942C2C008C for ; Fri, 19 Jul 2013 18:44:50 +1000 (EST) Received: from localhost ([::1]:42167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V06Iy-0002kf-7S for incoming@patchwork.ozlabs.org; Fri, 19 Jul 2013 04:44:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V06IX-0002f6-IC for qemu-devel@nongnu.org; Fri, 19 Jul 2013 04:44:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V06IV-00006y-08 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 04:44:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48201) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V06IU-00006s-P9 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 04:44:18 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6J8dxQR031127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Jul 2013 04:39:59 -0400 Received: from localhost (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6J8dtAt032592; Fri, 19 Jul 2013 04:39:57 -0400 From: Stefan Hajnoczi To: Date: Fri, 19 Jul 2013 16:38:48 +0800 Message-Id: <1374223132-29107-8-git-send-email-stefanha@redhat.com> In-Reply-To: <1374223132-29107-1-git-send-email-stefanha@redhat.com> References: <1374223132-29107-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Peter Lieven , Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 07/11] block/raw: add bdrv_co_write_zeroes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Peter Lieven Signed-off-by: Peter Lieven Reviewed-by: Kevin Wolf Signed-off-by: Stefan Hajnoczi --- block/raw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/block/raw.c b/block/raw.c index ce10422..8c81de9 100644 --- a/block/raw.c +++ b/block/raw.c @@ -42,6 +42,13 @@ static int coroutine_fn raw_co_is_allocated(BlockDriverState *bs, return bdrv_co_is_allocated(bs->file, sector_num, nb_sectors, pnum); } +static int coroutine_fn raw_co_write_zeroes(BlockDriverState *bs, + int64_t sector_num, + int nb_sectors) +{ + return bdrv_co_write_zeroes(bs->file, sector_num, nb_sectors); +} + static int64_t raw_getlength(BlockDriverState *bs) { return bdrv_getlength(bs->file); @@ -128,6 +135,7 @@ static BlockDriver bdrv_raw = { .bdrv_co_readv = raw_co_readv, .bdrv_co_writev = raw_co_writev, .bdrv_co_is_allocated = raw_co_is_allocated, + .bdrv_co_write_zeroes = raw_co_write_zeroes, .bdrv_co_discard = raw_co_discard, .bdrv_probe = raw_probe,