From patchwork Mon Mar 12 10:16:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10275917 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 94D5260467 for ; Mon, 12 Mar 2018 10:24:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9544C28C01 for ; Mon, 12 Mar 2018 10:24:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86C3928CC0; Mon, 12 Mar 2018 10:24:48 +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.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 D18D528C01 for ; Mon, 12 Mar 2018 10:24:47 +0000 (UTC) Received: from localhost ([::1]:57525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evKdI-00088J-IK for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Mar 2018 06:24:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evKWK-0002nA-VI for qemu-devel@nongnu.org; Mon, 12 Mar 2018 06:17:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evKWH-0006oF-6q for qemu-devel@nongnu.org; Mon, 12 Mar 2018 06:17:32 -0400 Received: from mail-eopbgr10122.outbound.protection.outlook.com ([40.107.1.122]:49387 helo=EUR02-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 1evKWG-0006gT-VB; Mon, 12 Mar 2018 06:17:29 -0400 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; bh=7PBC+RsUKZIc6QZvwccRzXMwyDgF7CAccBCHSDnqymw=; b=bKt3sOmkZgsPKp3cmuV1nxqoZkcUtxp5bU2H3moe+lrUqm7Y9JqWSGpd8V4HwK0tG262XtcSbCQGiNMjkT6/IcanXVT+uwIwXwpCF9K7ISxaH9BJOs+spre8KAJT2T34n+8f2ZcT0UzHGFCTZzxvuaeAg4Co46n7lBWZSlP985o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by DB6PR0801MB1991.eurprd08.prod.outlook.com (2603:10a6:4:76::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Mon, 12 Mar 2018 10:17:26 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 13:16:56 +0300 Message-Id: <1520849818-6915-8-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520849818-6915-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1520849818-6915-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR06CA0148.eurprd06.prod.outlook.com (2603:10a6:7:16::35) To DB6PR0801MB1991.eurprd08.prod.outlook.com (2603:10a6:4:76::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02cfc388-f2cb-4aec-c844-08d5880274e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0801MB1991; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 3:mlfJxeNKp4jPYeAHrFiaFE58ltClePJ6w6jd6jWa50bUlEIPfIHsXl8HQa6PGncAE8WYGKvOQ81wF9lU0EItPwqBb+sDtXd1ESLw7LX7LywnW9fl0xBFzhKrWPq0gwcYp1f/S1uLqLOr4iE5gpmIuWlnLeCSFyMBYtnE5/O+Ahq7S5x6jgE/LztV2051koTFH2y1z+F2uAAM9I0X+mLfsas+s6oQLynyNeLiDj3ARQT2bjD2RNhuFQv0yUd6ATdp; 25:KElfnvlaiQJ/z0XeqEAgXCpDEcvb0uVuwk2L+EkjtvQX9D7oH6iWgOQj5KzC8XkMRc7JbaYWZf+vb3T3/FF3ev/IyMYy+c6KCGQXKat9+XqUmGATNaGq+WWra5Y1yaKdA64zOsva8cctRN+1OBZLvtd0rErH8CnyLcuc8N5jcuckxrE6DeiBqCmVDKn2xPmVubugYpIlHYzjvhJiTorYYAYCL0QtqlLqMb9Rgs08hXJ0gAMwCI5HjQPeX/6dfPn1FjqKs8WQNfIBzGgwaWFO0TSLFvnablZVq53vPgScje1vaibrPdi+EHL6MqPUnyQcW/DgKlAy4uFTBQeMQaABUg==; 31:dGFkWChDg3RSa2qu1qkq+UQfTNiR0umlDmwkpq+tyqT18bNIXPcbOcFw+OlFtH54PuqUYoC8hmK05oXbqVUY27Yi0o/E+VZiBbaRVxAK8UaB6jT3CaI+HSGS+aUZmJyNafjByX+G6sL5GjtDICfZd5ztA7fmq2N6Q2HO2eiYSy7NhihTHZ38b3tqU5/1r86myTIhcyNkZ9cjgD1FyfHcalw/0VBjCj1MuQcbWWrKs84= X-MS-TrafficTypeDiagnostic: DB6PR0801MB1991: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 20:oZmk4NgRdi5Jhu8JUqZQwqo5fTkYcXYQwfsKZ/4/wfJgnEYXRWHbPtXKaHavBEPHW/Uy1sf124lOq6xh/5sMtRi2Mc5L4L3xkTC5+ugRqyS5bDG0UQcW+GHQcOgZaQmrG90U3/TqcpIxnUl0kvtp9JRT5sOANRKazwmCOrYTJHsNodaXRw/s9dzQuY7h8cgNZOD+zCoHHj1ewiZHAgL4NvyeI2VSC32r2fQtBgXfdyBTVKJa0D7idpzLd3T2pWXcURwxFeqs0p2emxhyYZybXxLav/ziWX8jIk64mbJjKKdMHI2a/n5JChdrBp9l8fVMVXCtPo7OXe4zhEHzU/Fz3FsrRkUdLB2OL8qpioTkw5kSy+CkG0uW+8721ODPWtmKaz3FJZ1ylx0OljbxKZKO97cHqJqdlHbFZ49arcqXMs/wozPRrUSq4NzLfkujzPLxwphjVxhtEc6oL8TrH3YOOWs4JNMvsUEf+mL3Me5rQuduhrF/hPs9t2g6A2Ht4oB8; 4:+EsOBcO1HQCugiVYiCTcpKz36M6rJpwox/twyUEYgZ+wJtUd3zmjyYqQS45CqaGqZomJVqXF+2h2hdIZtEBzuYXtD40AuKzXPCsl5ZA12lP+1kJfJlCaN4nUpjYPoTp/BulqilYa9NJEpMVk4rE17ApVz825lMkQj/5zZX07Nskqfte7piZPtCTS4t31R/cKt0bg/Au3DgPVUOSzDpb9c3SvqwswTr2oLCEc+hu7Z7FdTyE9BJxAqo+UpwV7idkZLwqSo72PPuQf8P+Kb+rqBw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR0801MB1991; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1991; X-Forefront-PRVS: 06098A2863 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(346002)(39380400002)(376002)(396003)(199004)(189003)(47776003)(106356001)(4326008)(81166006)(16586007)(107886003)(8676002)(69596002)(6116002)(68736007)(3846002)(105586002)(50226002)(386003)(6506007)(81156014)(8936002)(55236004)(2906002)(36756003)(478600001)(2351001)(2361001)(25786009)(316002)(6486002)(53416004)(76176011)(97736004)(52116002)(51416003)(66066001)(48376002)(50466002)(6916009)(6666003)(6512007)(2950100002)(5660300001)(26005)(86362001)(53936002)(16526019)(7736002)(186003)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0801MB1991; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0801MB1991; 23:z2PlVLGuWvhelHak0/9I00qphK9iXIIM/sE+7ci?= =?us-ascii?Q?tV4zuWa4As9qeTzVsM7PRmq9+Et6lu2HbP7CfsrdfDjnlansNmTDgJP5sk+B?= =?us-ascii?Q?nUXg4hJbm6Q7TOozMY5MZShrNuRwUcZ9p4lO6d9moOJdZCnDeBkLKQUhBCny?= =?us-ascii?Q?4UvtUYOAyqetx0wCbQOidDPIM3+vU69ijvVpzNZ0Yo570rCQMZJj2QCiRsOc?= =?us-ascii?Q?ovCHtZC9F9Qps0km960YdHPCi51rLVDjQG3BsNPuFlcI/xlkbe7ibQRR4ZEL?= =?us-ascii?Q?6qWOjGqcJC6jLUJXzeIMvBjPm4YEbpJp2c1T1WcRqwJ8TPZOhu9HvpdYFcEZ?= =?us-ascii?Q?c0Btt3j8YLC+wEdNt+nf+2BdwQ9FoBSG3fSY5uBoMvXPqGLG3VWKaXVo0AF7?= =?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Exjjr8+dHBUTtdr4FIOySIZ/RbW+9yMh5L4IU9oB3WmDSkh0+gwVy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 20:giynGPH+FutL1+vOLYHbaC72CCDc7q/spONo+aFhQ18yb5TjexS0YeJlnDku0OZkTvzKgRM/uuqNHvtY8tHOruH9yu9KyfcC0c+zGG+cbne8L+x8UKb0GMeUvuXoaHDXUdCG4CVpMwXLGgj1UKlIq5c7hJsKkYCKsGOWM78UkzE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 10:17:26.7402 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02cfc388-f2cb-4aec-c844-08d5880274e1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1991 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.1.122 Subject: [Qemu-devel] [PATCH v8 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, Anton Nefedov , berto@igalia.com, den@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com 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: Alberto Garcia --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/quorum.c | 3 ++- block/raw-format.c | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 5897124..d46f6c9 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -400,7 +400,8 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, bs->supported_write_flags = BDRV_REQ_FUA & bs->file->bs->supported_write_flags; - bs->supported_zero_flags = (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + bs->supported_zero_flags = + (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 de2fdc1..03bec62 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -146,7 +146,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, s->test_file->bs->supported_write_flags; bs->supported_zero_flags = - (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/mirror.c b/block/mirror.c index 2fb786f..58f006f 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1105,7 +1105,7 @@ static void mirror_top_set_supported_flags(BlockDriverState *bs) bs->supported_write_flags = BDRV_REQ_FUA & bs->backing->bs->supported_write_flags; bs->supported_zero_flags = - (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->backing->bs->supported_zero_flags; } diff --git a/block/quorum.c b/block/quorum.c index dc77a23..e369e79 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -873,7 +873,8 @@ static void quorum_set_supported_flags(BlockDriverState *bs) int i; bs->supported_write_flags = BDRV_REQ_FUA; - bs->supported_zero_flags = BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP; + bs->supported_zero_flags = + BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE; for (i = 0; i < s->num_children; i++) { bs->supported_write_flags &= s->children[i]->bs->supported_write_flags; diff --git a/block/raw-format.c b/block/raw-format.c index a378547..ca65f86 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -417,7 +417,8 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, bs->sg = bs->file->bs->sg; bs->supported_write_flags = BDRV_REQ_FUA & bs->file->bs->supported_write_flags; - bs->supported_zero_flags = (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + bs->supported_zero_flags = + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags; if (bs->probed && !bdrv_is_read_only(bs)) {