From patchwork Thu Jul 13 10:01:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manos Pitsidianakis X-Patchwork-Id: 9838121 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4C67B602A0 for ; Thu, 13 Jul 2017 10:05:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E1CA2858F for ; Thu, 13 Jul 2017 10:05:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3285C286EC; Thu, 13 Jul 2017 10:05:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B370F2858F for ; Thu, 13 Jul 2017 10:05:53 +0000 (UTC) Received: from localhost ([::1]:58482 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVb0K-0006Rh-W2 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Jul 2017 06:05:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVaxZ-0004ee-TN for qemu-devel@nongnu.org; Thu, 13 Jul 2017 06:03:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVaxY-00049D-W9 for qemu-devel@nongnu.org; Thu, 13 Jul 2017 06:03:01 -0400 Received: from smtp1.ntua.gr ([147.102.222.183]:38082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVaxW-00046l-HW; Thu, 13 Jul 2017 06:02:58 -0400 Received: from mail.ntua.gr (ppp046176127036.access.hol.gr [46.176.127.36]) (authenticated bits=0) by smtp1.ntua.gr (8.15.2/8.15.2) with ESMTPSA id v6DA1d1D063061 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 13 Jul 2017 13:01:39 +0300 (EEST) (envelope-from el13635@mail.ntua.gr) X-Authentication-Warning: smtp1.ntua.gr: Host ppp046176127036.access.hol.gr [46.176.127.36] claimed to be mail.ntua.gr From: Manos Pitsidianakis To: qemu-devel Date: Thu, 13 Jul 2017 13:01:16 +0300 Message-Id: <20170713100117.11961-4-el13635@mail.ntua.gr> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170713100117.11961-1-el13635@mail.ntua.gr> References: <20170713100117.11961-1-el13635@mail.ntua.gr> X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 147.102.222.183 Subject: [Qemu-devel] [PATCH v5 3/4] block: remove bdrv_truncate callback in blkdebug X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , qemu-block , Max Reitz , Stefan Hajnoczi Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c and set is_filter to true. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Manos Pitsidianakis --- block/blkdebug.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index c19ab28f07..91ffd1fe12 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -821,12 +821,6 @@ static int64_t blkdebug_getlength(BlockDriverState *bs) return bdrv_getlength(bs->file->bs); } -static int blkdebug_truncate(BlockDriverState *bs, int64_t offset, - PreallocMode prealloc, Error **errp) -{ - return bdrv_truncate(bs->file, offset, prealloc, errp); -} - static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options) { BDRVBlkdebugState *s = bs->opaque; @@ -909,6 +903,7 @@ static BlockDriver bdrv_blkdebug = { .format_name = "blkdebug", .protocol_name = "blkdebug", .instance_size = sizeof(BDRVBlkdebugState), + .is_filter = true, .bdrv_parse_filename = blkdebug_parse_filename, .bdrv_file_open = blkdebug_open, @@ -917,7 +912,6 @@ static BlockDriver bdrv_blkdebug = { .bdrv_child_perm = bdrv_filter_default_perms, .bdrv_getlength = blkdebug_getlength, - .bdrv_truncate = blkdebug_truncate, .bdrv_refresh_filename = blkdebug_refresh_filename, .bdrv_refresh_limits = blkdebug_refresh_limits,