From nobody Wed Apr 16 03:25:20 2025 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1553615789133721.0403506308947; Tue, 26 Mar 2019 08:56:29 -0700 (PDT) Received: from localhost ([127.0.0.1]:34046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8oR3-00060z-S9 for importer@patchew.org; Tue, 26 Mar 2019 11:56:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h8oN4-0002rt-6L for qemu-devel@nongnu.org; Tue, 26 Mar 2019 11:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h8oN2-0004zA-Qh for qemu-devel@nongnu.org; Tue, 26 Mar 2019 11:52:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41502) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h8oN0-0004x2-8C; Tue, 26 Mar 2019 11:52:10 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 933F73082208; Tue, 26 Mar 2019 15:52:09 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-65.ams2.redhat.com [10.36.117.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76C4C60141; Tue, 26 Mar 2019 15:52:08 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 26 Mar 2019 16:51:54 +0100 Message-Id: <20190326155157.3719-5-kwolf@redhat.com> In-Reply-To: <20190326155157.3719-1-kwolf@redhat.com> References: <20190326155157.3719-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 26 Mar 2019 15:52:09 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/7] block: Advertise BDRV_REQ_NO_FALLBACK in filter drivers 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, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Filter drivers that support .bdrv_co_pwrite_zeroes can safely advertise BDRV_REQ_NO_FALLBACK because they just forward the request flags to their child node. Signed-off-by: Kevin Wolf Acked-by: Eric Blake --- block/blkdebug.c | 2 +- block/copy-on-read.c | 7 +++---- block/mirror.c | 3 ++- block/raw-format.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 1ea835c2b9..efd9441625 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -401,7 +401,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *o= ptions, int flags, bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & bs->file->bs->supported_zero_flags); ret =3D -EINVAL; =20 diff --git a/block/copy-on-read.c b/block/copy-on-read.c index d670fec42b..53972b1da3 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -34,12 +34,11 @@ static int cor_open(BlockDriverState *bs, QDict *option= s, int flags, } =20 bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | - (BDRV_REQ_FUA & - bs->file->bs->supported_write_flags); + (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); =20 bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & - bs->file->bs->supported_zero_flags); + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & + bs->file->bs->supported_zero_flags); =20 return 0; } diff --git a/block/mirror.c b/block/mirror.c index eb9a4cdf56..ff15cfb197 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1548,7 +1548,8 @@ static void mirror_start_job(const char *job_id, Bloc= kDriverState *bs, } mirror_top_bs->total_sectors =3D bs->total_sectors; mirror_top_bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED; - mirror_top_bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED; + mirror_top_bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | + BDRV_REQ_NO_FALLBACK; bs_opaque =3D g_new0(MirrorBDSOpaque, 1); mirror_top_bs->opaque =3D bs_opaque; bdrv_set_aio_context(mirror_top_bs, bdrv_get_aio_context(bs)); diff --git a/block/raw-format.c b/block/raw-format.c index cec29986cc..385cdc2490 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -434,7 +434,7 @@ static int raw_open(BlockDriverState *bs, QDict *option= s, int flags, bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & bs->file->bs->supported_zero_flags); =20 if (bs->probed && !bdrv_is_read_only(bs)) { --=20 2.20.1