From nobody Wed Dec 17 05:34:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150470671929463.94520824960625; Wed, 6 Sep 2017 07:05:19 -0700 (PDT) Received: from localhost ([::1]:36278 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpaxC-0006o3-6T for importer@patchew.org; Wed, 06 Sep 2017 10:05:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpav8-0005TV-2F for qemu-devel@nongnu.org; Wed, 06 Sep 2017 10:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpav2-0000qH-GI for qemu-devel@nongnu.org; Wed, 06 Sep 2017 10:03:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dpaus-0000jp-Vw; Wed, 06 Sep 2017 10:02:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CE026DB; Wed, 6 Sep 2017 14:02:54 +0000 (UTC) Received: from dhcp-200-186.str.redhat.com (dhcp-200-186.str.redhat.com [10.33.200.186]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D07518C4F; Wed, 6 Sep 2017 14:02:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0CE026DB Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kwolf@redhat.com From: Kevin Wolf To: qemu-block@nongnu.org Date: Wed, 6 Sep 2017 16:02:35 +0200 Message-Id: <20170906140246.7326-4-kwolf@redhat.com> In-Reply-To: <20170906140246.7326-1-kwolf@redhat.com> References: <20170906140246.7326-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 06 Sep 2017 14:02:54 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/14] 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: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Manos Pitsidianakis Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c and set is_filter to true. is_filter also gi= ves access to other callbacks that are forwarded automatically to bs->file for filters. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Manos Pitsidianakis Signed-off-by: Kevin Wolf --- block/blkdebug.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 8e385acf54..f10e3e5638 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -808,12 +808,6 @@ static int64_t blkdebug_getlength(BlockDriverState *bs) return bdrv_getlength(bs->file->bs); } =20 -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 =3D bs->opaque; @@ -896,6 +890,7 @@ static BlockDriver bdrv_blkdebug =3D { .format_name =3D "blkdebug", .protocol_name =3D "blkdebug", .instance_size =3D sizeof(BDRVBlkdebugState), + .is_filter =3D true, =20 .bdrv_parse_filename =3D blkdebug_parse_filename, .bdrv_file_open =3D blkdebug_open, @@ -904,7 +899,6 @@ static BlockDriver bdrv_blkdebug =3D { .bdrv_child_perm =3D bdrv_filter_default_perms, =20 .bdrv_getlength =3D blkdebug_getlength, - .bdrv_truncate =3D blkdebug_truncate, .bdrv_refresh_filename =3D blkdebug_refresh_filename, .bdrv_refresh_limits =3D blkdebug_refresh_limits, =20 --=20 2.13.5