From patchwork Mon Dec 3 10:14:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10709145 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 E971214E2 for ; Mon, 3 Dec 2018 10:25:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 949AF2B0C3 for ; Mon, 3 Dec 2018 10:24:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 890612B0D9; Mon, 3 Dec 2018 10:24:50 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 0E5E62B0C3 for ; Mon, 3 Dec 2018 10:24:50 +0000 (UTC) Received: from localhost ([::1]:47802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTlPF-0001Ca-9g for patchwork-qemu-devel@patchwork.kernel.org; Mon, 03 Dec 2018 05:24:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gTlFx-0002Oc-Pt for qemu-devel@nongnu.org; Mon, 03 Dec 2018 05:15:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gTlFr-000501-Vy for qemu-devel@nongnu.org; Mon, 03 Dec 2018 05:15:13 -0500 Received: from mail-eopbgr60112.outbound.protection.outlook.com ([40.107.6.112]:44323 helo=EUR04-DB3-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 1gTlFq-0004nY-8V; Mon, 03 Dec 2018 05:15:07 -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=SNbE8fyndPP8F6upmM+BETEMYXaP42IXcxoO4eHP+uQ=; b=Zpmjn5Ohlo70FOz2ZQjwQeTKh4gp2rR2teugzs1TfAGCAjZffc5GDJUuBPE3Ix+RLFNfwjicizD/HWGRhJIIVhBWvp2H0KvpXnJH7adQHTTxtNncbPVlWdjAyhOU1XOg+4Xw8z6eCSsWj3pFw3ZMxl3hMQ881p9YHV4JeyeliK4= Received: from AM0PR08MB3347.eurprd08.prod.outlook.com (52.134.94.148) by AM0PR08MB3922.eurprd08.prod.outlook.com (20.178.118.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1382.18; Mon, 3 Dec 2018 10:14:59 +0000 Received: from AM0PR08MB3347.eurprd08.prod.outlook.com ([fe80::a0bd:dda4:d9e4:1d01]) by AM0PR08MB3347.eurprd08.prod.outlook.com ([fe80::a0bd:dda4:d9e4:1d01%2]) with mapi id 15.20.1382.020; Mon, 3 Dec 2018 10:14:59 +0000 From: Anton Nefedov To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v10 7/9] block: support BDRV_REQ_ALLOCATE in passthrough drivers Thread-Index: AQHUivELYrOYb5W/Skevq0eKVt4lpQ== Date: Mon, 3 Dec 2018 10:14:59 +0000 Message-ID: <20181203101429.88735-8-anton.nefedov@virtuozzo.com> References: <20181203101429.88735-1-anton.nefedov@virtuozzo.com> In-Reply-To: <20181203101429.88735-1-anton.nefedov@virtuozzo.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0301CA0004.eurprd03.prod.outlook.com (2603:10a6:3:76::14) To AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [185.231.240.5] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR08MB3922; 20:zUnfHAlPsOsTUR74oRDSynW2qz5eo37VbwYhVPWYYgVt1w4QpSCPKNMRAIdk/F7Q/AfycxBbDEfm/M3X7cW6KC/YBhL1w1tdDItpOZ5gWifWDYVihAaCiRpY17PJSurRFK+xC0fa4QA7uVxN0k0QNXKYVBCZmqNp6GZ1pDxnQeI= x-ms-office365-filtering-correlation-id: 37696fc8-9885-4c6c-71b3-08d659082e19 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3922; x-ms-traffictypediagnostic: AM0PR08MB3922: authentication-results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3231455)(999002)(944501493)(52105112)(3002001)(148016)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:AM0PR08MB3922; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3922; x-forefront-prvs: 08756AC3C8 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(366004)(39840400004)(376002)(346002)(396003)(189003)(199004)(476003)(107886003)(5660300001)(54906003)(14454004)(2906002)(52116002)(386003)(7736002)(1076002)(99286004)(6506007)(316002)(3846002)(6116002)(305945005)(68736007)(25786009)(478600001)(76176011)(97736004)(86362001)(575784001)(66066001)(36756003)(8676002)(44832011)(6486002)(8936002)(2501003)(81156014)(81166006)(256004)(26005)(2351001)(11346002)(4326008)(446003)(102836004)(106356001)(105586002)(5640700003)(186003)(6436002)(71200400001)(71190400001)(6512007)(486006)(53936002)(6916009)(2616005); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3922; H:AM0PR08MB3347.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3JKWU4FWQVOtA+EquuPDbWR+mylNF7+TZ9VYfRPBi6toTH6wXOKrA6xcHvUGOQvOqq7vQ5EA84EK649/VuJgvpgJ6zcN2Cln+0W3uKAL3+rvpfn4lslwrKxbnt+p/ZMt8roXAtoJcEx2MiYqupTGeJ3gweqo80Cr4fSOMTymJxDvj1+xKiS43lmzPM0LEqa7qtXWvqyRwQPT0v/7olebEFzkbK/AfBmi3qTHkOF1NP8XOhV4i7T9FSWrhEZtqOS9WIzRP47OXgcVlwnwJWvcQH5jLe4HTWksUoHqGrGe5maKyc6JqvEID8xZItBdqOKsMK5XPBXfTGZ6WOtyz7/bzd0etfzIX1IzKTFD4Oak/rc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 37696fc8-9885-4c6c-71b3-08d659082e19 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Dec 2018 10:14:59.0255 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3922 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.112 Subject: [Qemu-devel] [PATCH v10 7/9] 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 56908c9b19..9d836a6bd3 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1531,7 +1531,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)) {