From patchwork Mon Jan 14 11:18:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10762251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0D9DE6C2 for ; Mon, 14 Jan 2019 11:25:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD202286BD for ; Mon, 14 Jan 2019 11:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC2CD289B1; Mon, 14 Jan 2019 11:25:07 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2FF4F286BD for ; Mon, 14 Jan 2019 11:25:07 +0000 (UTC) Received: from localhost ([127.0.0.1]:50131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj0Mc-0005bw-AL for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Jan 2019 06:25:06 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj0Gf-0000ZO-Af for qemu-devel@nongnu.org; Mon, 14 Jan 2019 06:18:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gj0Gb-0001DD-Vb for qemu-devel@nongnu.org; Mon, 14 Jan 2019 06:18:57 -0500 Received: from mail-eopbgr130115.outbound.protection.outlook.com ([40.107.13.115]:51232 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gj0Gb-0000hM-LM; Mon, 14 Jan 2019 06:18:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5zA7BGCxx0SCWPCgXPesNTYExHXO4H8wDamckSODIOo=; b=QhYmnSfPTm5s0ZVxousYS3OUEBRnlBRgN9KNdH6syNF5KCErNMe+kLyU4tzxuNA68Ay5cOwDvzHybHv6WC3OiWtODmfE4kiNhdplLBMGuleM6jtzNkV2ggvFUp6UiCbfYxQ5BWgYfFFoLla+UntRcmmsjcL5NWLFdsFR6WhTHuc= Received: from AM0PR08MB4292.eurprd08.prod.outlook.com (20.179.33.17) by AM0PR08MB2977.eurprd08.prod.outlook.com (52.134.92.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.14; Mon, 14 Jan 2019 11:18:29 +0000 Received: from AM0PR08MB4292.eurprd08.prod.outlook.com ([fe80::d13a:1305:bb54:1916]) by AM0PR08MB4292.eurprd08.prod.outlook.com ([fe80::d13a:1305:bb54:1916%6]) with mapi id 15.20.1516.019; Mon, 14 Jan 2019 11:18:29 +0000 From: Anton Nefedov To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v12 08/10] block: support BDRV_REQ_ALLOCATE in passthrough drivers Thread-Index: AQHUq/rgEPz/gC1bCE+GczvhLb6DGw== Date: Mon, 14 Jan 2019 11:18:29 +0000 Message-ID: <20190114111744.113188-9-anton.nefedov@virtuozzo.com> References: <20190114111744.113188-1-anton.nefedov@virtuozzo.com> In-Reply-To: <20190114111744.113188-1-anton.nefedov@virtuozzo.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0701CA0065.eurprd07.prod.outlook.com (2603:10a6:3:9e::33) To AM0PR08MB4292.eurprd08.prod.outlook.com (2603:10a6:208:13b::17) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [185.231.240.5] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR08MB2977; 20:d7HnD8Lap8OHTh3SBI3jJ5W0hRrcEqREcr7bC1nq0RXwShX8IPMppJAYoVorLEMUuC5DTEMHjQar86WpscvkpJFbYQWJX4fXdZtyuEQFOT9aIfBqdyN7YB3kNdq2nSdCtNeIlf9KLnLP1OYuWTq6ZN9bKQEOgzd2UDjOU6vyZSA= x-ms-office365-filtering-correlation-id: 301fd29d-3acd-437a-8b56-08d67a1202e9 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB2977; x-ms-traffictypediagnostic: AM0PR08MB2977: x-microsoft-antispam-prvs: x-forefront-prvs: 0917DFAC67 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39840400004)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(6346003)(256004)(14454004)(5640700003)(6486002)(6916009)(8936002)(1076003)(36756003)(97736004)(53936002)(305945005)(476003)(107886003)(478600001)(186003)(2906002)(486006)(6116002)(50226002)(3846002)(26005)(2501003)(2616005)(99286004)(8676002)(11346002)(66066001)(4326008)(5660300001)(52116002)(71200400001)(81156014)(25786009)(81166006)(71190400001)(76176011)(2351001)(7736002)(316002)(105586002)(106356001)(68736007)(102836004)(44832011)(6436002)(446003)(54906003)(6512007)(575784001)(86362001)(6506007)(386003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB2977; H:AM0PR08MB4292.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: gdu5rk+wCCQ7GX1/g4ShidcZHBKaDH3jrSmZdcnFPLXmc2ej80V+NyWcn0Mr+GahplgY8lYSYj5+TF2r8zPSjfqx7e7weKnq8UqWoPAFHOEtxv90VghrW6E2kCUvWx0Vk4ZPoYhW5kxo8s1M1p74piii/NWQitHeDa1VzWgKKQ2irWGKjEv/7DeOKHa+FWYwNG6zPXY85sRuR0q2uZ+fktPHCt/QHdutqE/SVEjubMncoTEqBVyRAlfMZSavVgJnrSzDyj2qWvY9mQ9LW9OrKpYPd/JVIHda+LaD11pu2ehkE3QstE+cqrKPBs+hkI9m93nRys7MBgaws6/jBPQftdPr5h/EzHvLtcMPC93eiw/XnDN7A88zuN5YHZFHT0VIx7fZxE0FjD4BQBLODTtlaQNyQD5YUdd7CYwhwTWO748= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 301fd29d-3acd-437a-8b56-08d67a1202e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jan 2019 11:18:29.0529 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB2977 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.13.115 Subject: [Qemu-devel] [PATCH v12 08/10] block: support BDRV_REQ_ALLOCATE in passthrough 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" , Vladimir Sementsov-Ogievskiy , "berto@igalia.com" , Denis Lunev , "qemu-block@nongnu.org" , "mreitz@redhat.com" , Anton Nefedov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alberto Garcia --- block/blkdebug.c | 2 +- block/blkverify.c | 2 +- block/copy-on-read.c | 4 ++-- block/mirror.c | 2 +- block/raw-format.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 0759452925..f0fc2ec276 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -401,7 +401,7 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, bs->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED | (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); bs->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags); ret = -EINVAL; diff --git a/block/blkverify.c b/block/blkverify.c index bb52596cbb..9cb4f94b68 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -146,7 +146,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, bs->file->bs->supported_write_flags & s->test_file->bs->supported_write_flags); bs->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags & s->test_file->bs->supported_zero_flags); diff --git a/block/copy-on-read.c b/block/copy-on-read.c index 64dcc424b5..1eb993699a 100644 --- a/block/copy-on-read.c +++ b/block/copy-on-read.c @@ -38,8 +38,8 @@ static int cor_open(BlockDriverState *bs, QDict *options, int flags, bs->file->bs->supported_write_flags); bs->supported_zero_flags = 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_ALLOCATE) & + bs->file->bs->supported_zero_flags); return 0; } diff --git a/block/mirror.c b/block/mirror.c index 7b5a5f13a2..057516acb9 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1532,7 +1532,7 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs, mirror_top_bs->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED | (BDRV_REQ_FUA & bs->supported_write_flags); mirror_top_bs->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->supported_zero_flags); bs_opaque = g_new0(MirrorBDSOpaque, 1); diff --git a/block/raw-format.c b/block/raw-format.c index 6f6dc99b2c..ad7453dc83 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -432,7 +432,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, bs->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED | (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); bs->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags); if (bs->probed && !bdrv_is_read_only(bs)) {