From patchwork Tue Jan 16 13:04:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10166825 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 CF93A60325 for ; Tue, 16 Jan 2018 13:12:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE37B28488 for ; Tue, 16 Jan 2018 13:12:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B299728520; Tue, 16 Jan 2018 13:12:54 +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 44BC428488 for ; Tue, 16 Jan 2018 13:12:54 +0000 (UTC) Received: from localhost ([::1]:35336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebR2r-0000nO-HS for patchwork-qemu-devel@patchwork.kernel.org; Tue, 16 Jan 2018 08:12:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebQvT-0002n7-26 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:05:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebQvJ-0006VK-Jc for qemu-devel@nongnu.org; Tue, 16 Jan 2018 08:05:15 -0500 Received: from mail-ve1eur01on0099.outbound.protection.outlook.com ([104.47.1.99]:39168 helo=EUR01-VE1-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 1ebQvJ-0006T2-Di; Tue, 16 Jan 2018 08:05:05 -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; bh=wSDcWIWKcj5APoSYHWxJghyyqCiJF2bnWFE0iQsN+m4=; b=bLNmx22oBQjbZelCdLBiuuYQl+U3sviiAPXvGz+FrbnaGfaKYPwEafBI9LrPwn3HR0gXva6XR9TksIvTXIgRtVROGsDwj1H3OnOAxo2xCCwWuHP9OanQ16wtLMs/NB+z47Ps9uzGYkDgXQ3rf3xC9XpdVriKgfNUB2o9C4ikOk0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by VI1PR0801MB2000.eurprd08.prod.outlook.com (2603:10a6:800:8a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 13:05:03 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 16:04:27 +0300 Message-Id: <1516107870-8110-7-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516107870-8110-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1516107870-8110-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1P190CA0006.EURP190.PROD.OUTLOOK.COM (2603:10a6:3:bc::16) To VI1PR0801MB2000.eurprd08.prod.outlook.com (2603:10a6:800:8a::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83b4784f-dba2-4e5e-91b1-08d55ce1c26d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB2000; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 3:9ehfpLUIdFIj8CGoR8TPwrn72c/QIs1p0tNYBl/rhktWKZAda3Ns8XEgaUuo4m0lKoSGr8DJVCiFoSzCO8lflIC1VFOJ2WsVhBEV4k1eq4Du34vgKSEoATW+lvPtt8azhjp47ey/j6xPDeYp65HrLvuYwQFWpGWHDrCZM1m5NeevNLWYSbqsfwvJINWa2puIIE0fPOvErvIj8hA6ro1LdnM8f59CIGPC0Ky4SR31RhgTesCyLPb+H4mSPagWN2uN; 25:JkR9kQZ816lUpJ1VhU2JUTt22Js828E+AgTxpRrvGk0PlptxhgpGXrQL81AXg6HhjcGAFTBvtWmYrdC+hMlU2pSAQS4AsRdr8ykSaEvTwYPH8UFZn1m0o+D+jUH/z5UIlHOuBia2C0KM8oiIG8NopSwwykdSq7sJRDMwMmZKxzKn7I3X8eDtYirCXrlpQ4qQg7HSd6mPe+ZJ85L+JBY1UKXDvWDm+VjnxZGsAWmf2HyKUAo1fE/TqomPKcAQmPsVk/qUGmuHyVrsxEBkO0pbn18ZQ+MZpwxjK38s7GXcYVq17vMTkZFK/DbHh5w7SHFdzIvQc6xK7Cgre/uUgzZ4Ig==; 31:RWLM02/Ne8gqxg1hA0Cc35UbKrWQFu7m6MfCUAoydwclwcCLWI0TIK/aCRfUxqylw4lj+1Nhh5rq1OMhI7YM9Il4mJdB+LeTQzh6X9zobJF7bBxm+u5aIFGAsB296SZsbdJGQFSWmRUAQqnorjN8RHNGY6zmVE9F82wmy5SpmuTQuQ6u1ItZoUiagoau+cHRCihXwV+j3M1nXj/B3G6JIl0WhzxuN0E9g9uXKc3FNQI= X-MS-TrafficTypeDiagnostic: VI1PR0801MB2000: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 20:RhT1sKI6i3ROprZM0NYsmuwYazEWdMmtL8qzQGtJx6TolLrJyokI8OK68CszkGETteaFZGG9WT28d61Hp6+2tPh8MIhjH/xjo8gHnCe7+2+P8nOqONZMnmkujoGitZNWuVQix0MZBot8yEt8VXzO66FeFjeAm5PPzGRvMtDtAzlFwkQX3gUci9ZzL273043xE3bMhCs1BCePOm6iXAKkffgM9UPbEo9S+9HuSJjtPaInOLiH/+IJvZME61RyKnykpTtO6jOdjAQXS+oUrVeX6ElVq3qgu0curMvu9r8PgRd16EjlDHKQV0AHh8rdij7sLrXNyAbZpLelczLTlEMsFKxeOPBUg5Sa9s4cmr6nhUHyjtKUkbr07r3G5zg4BPxe4VlO6YeIkMRIN0Ji/q37idmmnoSwhne3Sn26gt7psao=; 4:lOBjQJ5+06DZZB92sIH7ImqPkHudiC8gDig2JKAfbIeWN/Tf50j3/NbkZrSNN3sF6y/hr+VhlSfjPePPB9p/OORaNJrk4bWvrclFRvse1CrH7DEHtkhU/Hs8bGLILOw/ZVzkac4zrqEvMzvWib3+9tLLW0SeEFFI4eLnkZgmI4HrIP4ICJAzFxR7Ld+A5Ml+tapPztrEXuh2w/PmdJwhFpbG/hP03KT8xktvEO+pubHbCBJCiygJrWgQb9v4k4z+evz0VY8LIVu0vhnraxwmaQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231023)(944501161)(10201501046)(6041268)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0801MB2000; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR0801MB2000; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(396003)(366004)(39380400002)(376002)(39840400004)(189003)(199004)(105586002)(2906002)(48376002)(6916009)(2950100002)(5660300001)(53416004)(66066001)(6512007)(53936002)(26005)(50466002)(47776003)(16526018)(6666003)(2351001)(478600001)(36756003)(106356001)(2361001)(69596002)(51416003)(305945005)(68736007)(4326008)(8936002)(81166006)(386003)(52116002)(3846002)(25786009)(8676002)(81156014)(6486002)(50226002)(76176011)(6116002)(6506007)(97736004)(316002)(16586007)(86362001)(107886003)(7736002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB2000; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; VI1PR0801MB2000; 23:Q6CEuDSB+WydxV58RDMgePW2/flKqxGT/P4uH74?= =?us-ascii?Q?x7SC/PgcFyQcnIbxRGJ6ZiRnrr/PjheKZ7RXnsW+qr9UzssqThHYgGfr/lre?= =?us-ascii?Q?abWinno65STHOr1pznOrrxD7bPvEtL0Tl4MChLiXlBXoTpbIbUrUqeDBHai5?= =?us-ascii?Q?t45RGzo1y69Bais8rw/uhb+GPZ8gsfGQHIHqDIzSoc2GWo8wyHoOdiHELSdU?= =?us-ascii?Q?A7oxmCmA+/54jsTucM8yBNWPlvJE9AFgyTlFEOEzvZ6nPv0i5M4bc1CJBz/v?= =?us-ascii?Q?DVa1LKnzTV+Mm9HoUfhTc/KSMWHk8jceq+NGDEdgMBcklUPajpBUDNYWAo4E?= =?us-ascii?Q?tEQgKDG4XVol/1cGuqUQrzBPhR9owNNFnLbrc4NztBSTmgFJ+mUfXbWGQ4uo?= =?us-ascii?Q?tVYqDt+mDu7h+lGBI2f2ooRWT8Fig+yeTRieDTZ9jO9Z0T9kPAuCG5MfPYQr?= =?us-ascii?Q?BuVU7inThNNOut92CjdKGjmzqRxTxMQZEB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8XRMxsoilfIV326CYtqjzBAtEQO/bo5IPZP4tuTHeZR6HjK+XMDP9RZGHLXMkm2BgVT6oXccUqsPydPylo6jKRdHq9D1oIenhCpxXfn00L+ZDONWZFsbQ57DE0Dfh+TAVbZkdoOIAbnT/p1cn5GjsU8TqOva3FoNla0bFKZYWTV9obbN8HUL3M6FHsbPLFveTp6PA=; 5:U3JQdLmXZ5sC1B2a96XsaYWozQjgPK/+CrmjQgRar3CSj1G9JLKxsUpPBy3wOxSKy5VmRQ4HHiH01VKYALL3aSJXF7g5xfbcIx1C1XxYS1oBfDjla8935t14lwSiOSORqp3Q55G5FnOJeC1/R8LW6ct1ZT8WuV8Gb/hk3rmbjHU=; 24:csVprB/R3+sUpyzBvcOHZ6oLwbKFPN2zvY3F4r/GGou7apxWK3MbeG7haefgNwfOu+KSqB8JF2sno1n7wRwec4d+yRO5p/g5ag1NrxDEyZ8=; 7:/tH0aMrEKmUIDOtN2gvjt7yjizJczZdsXWsO40wJE2ZVCcvwWDZDBehr9nFfcazVNPDXCUPwg6GFI2Euu6krQoBTdZGhSWBK1b9uHnjcTG/sTjizuvdXn7vvglnIH29yQifozIfgwr9zljrrzb7fk1Rf2WPlq65F8EUxclakgm8Kx6QDDm6+d85ms8m8MesqQ9VQOFkvE2peHd9iSCDs87zQ3sBcmP40j2RDs3NAbKlytPKv9+DVW+of5+u7FYEE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB2000; 20:WHqn1bbErFkvT0/uNNGijHwsRQisjoFq9eG8+GsyeGTgtRyVzdCfZhAZsni7q1ABfAKOiHxUnWkketwQYt46ruMDSmTMVvkzEYlTy0D3EOuSXHXa13LkAlBHNQpI7As5oo6SzWdY5nstSADEMo9YxAZR6ur1oITX795UY37TjSo= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 13:05:03.5119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83b4784f-dba2-4e5e-91b1-08d55ce1c26d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2000 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.99 Subject: [Qemu-devel] [PATCH v6 6/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/raw-format.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index e216699..7d5773d 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 9ba65d0..b249636 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -145,7 +145,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 d18ec65..eb41deb 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1067,7 +1067,7 @@ static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts) 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/raw-format.c b/block/raw-format.c index ab552c0..b1deb93 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -416,7 +416,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)) {