From patchwork Tue May 8 14:58:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10386309 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 523D26037F for ; Tue, 8 May 2018 15:01:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4075B28E78 for ; Tue, 8 May 2018 15:01:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3480C28E7B; Tue, 8 May 2018 15:01: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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, 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 08D4128E65 for ; Tue, 8 May 2018 15:01:05 +0000 (UTC) Received: from localhost ([::1]:51635 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG46z-0001pC-4y for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 May 2018 11:01:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47803) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG44g-0000E2-HT for qemu-devel@nongnu.org; Tue, 08 May 2018 10:58:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG44c-0001Ud-DZ for qemu-devel@nongnu.org; Tue, 08 May 2018 10:58:42 -0400 Received: from mail-db5eur01on0097.outbound.protection.outlook.com ([104.47.2.97]:13120 helo=EUR01-DB5-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 1fG44c-0001Tv-44; Tue, 08 May 2018 10:58:38 -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=gnalBcW9C48aOaMktgfMgUOu0Dmj+eaakbQNX4JTJa4=; b=RnbjJLa4/oLJ+9qYhEYFDN5PVfSQUPN234As+l5TxDztyism3kOJGW7zMn7xx3e1Pf3gZfuotEvZbWOaodPt3c1VzBh4MxY5k4g9LWUMYIxh9pnoZQlBxi5yhTvYWyPIhO6op/6EGOjvruop4rFWLdGmXc5hW8vxGpvzh5xuZ1s= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 8 May 2018 14:58:35 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 17:58:08 +0300 Message-Id: <1525791496-125188-2-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525791496-125188-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1525791496-125188-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR07CA0020.eurprd07.prod.outlook.com (2603:10a6:6:2d::30) To AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3347; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 3:96plPnL2HxKKi9QShd0Bk7DlyhmwLkXOZwG1/XZsb4lK0aObINZESuz3uNm9/oXA4pHAp1KkQWiQVplD44WJFTDagvBvQImKt2HLTOUP/m2jNQkypDWQTQNKD6Q7Qr44Gr6D/Bb06dTZnIPsGhR2SQ9XNIJbjvWY1fSpecWZMyyyZS1bb1MBbc71rLJVjRwB6vurQ+IxQVPJ5Bs+bcqmmKO3wGE0OICHvc0p24NcuIc++BdDrzjSQ0isGNHHucyx; 25:RBXo1EjYQ/n7uoCqN8TxiHotJOECTOpZUtRzHPx6uIGUFPTaobuLNrarcUgqLp55lipkndJer9USkF2b3Fq4jzWLQ1UFDprXJpQuvofSvrue0CO3/22rv5C00pUHiBHLkLLyyCLyUNGbmI5ZkEa/DatPlughY6PBfK67WxxYEQ3WHKDouYhybnB6g1Qqrh52oMQmPTUInbkcRnlY/9VyaUqeNMC7+gBY22MuGjtDT7rSg9Z63KGCaonppZ+uyzoFPjzFaOOXLTcIWyTmRKqCRZdzj1xpKOOmfq9BF3Tg/lC8MuiB0E2Tte/foQZDVibS5iO76atd/uuZciCTM1QQ+Q==; 31:FlgoitBuJDVKl15hfN0sIgnbxtgN+SIhDD6Vn9Z1PwSzON1DtKOtpVV3MYtF8v4Gjx3FjAkwNkNKVNjmT+ZnMrfOz/bN336xmjW+vDduXnZV8BFaUfSkXONFHdyEsdYLyJhwowiEqI2VMZHXv9iHSLDeWZVaUnvoclCjrhu1Xx1RdUFx2P9MH7nJ8jgkCtVxOuNtw+aYpnDJpoaYaBgfqJjzB96W93fW5leel+DcAws= X-MS-TrafficTypeDiagnostic: AM0PR08MB3347: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 20:+DyOVkPif0HnezaY5WYhRRNr4DZwopIERH966+K2F6eT/9fLnRWs3SUI+EZ7h746nrSixBD1Mjtzt9gUByunSA077Rok9Oy6m273diJ3rtS4bZAiW08qAZu8Zxn1zpltTwjxCFvfIIfFc+iEVX0GSYEyl9P4SY6HDgYadJt36azi3pw1EDpxcyrypBsVLDQoTqa/7kntSwgKXL5YKCTyzNPSTmoVri0qauiSCPEDJeJ6NOy+hZAcYZvt2TK/QRauo1btsGkDkrt3vdETbGHAZc5YQXd9QXad7q27/xpRwe2Z4Uxe7daRgny4aDwOvYOascKMlDuXzCgPOYuO5G55r3letQjWFzCJz3KwgnvshxpskViVrNg5HmidbyNUrNhjRKzVVlGrrW1hLqMi1rsrYaAg/y4rvzEO2G8p7naZXab+TbJcm7bW5kylKQnpIUOfJaqY++cT7o0E2p1IwAfq4JO7Zm0NA/e2Un0cI7EUyDfA9t5r4ebY30bREGKHgSng; 4:NlHIn70xIEA0rtO4VScpnG2WSyrLfj3oF+AYdTQnp+C/gorqfTlGZoyA/kEmy8Rxfp49ajRMYpkVdB23rLkJqPIBn9lem2B033CfBzjtvhD++SNdvPnBp/usTMcPUDo2Mr0DRL2+lCGpt7R4WR1xW+a425n6EcZ6Cbg7A/hnQ7r85ej1tGNVrp+qz/2YcN9iuFCJFsYV8jS3hm8Dsx83If27h2WO4sOHW9Sh80rPkMu1zKvjBzilvU2U+gayksvLBDGKPgPyKADCCiNo57FhEQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM0PR08MB3347; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3347; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39850400004)(366004)(376002)(396003)(346002)(39380400002)(199004)(189003)(5660300001)(6486002)(81156014)(8676002)(81166006)(97736004)(2361001)(6116002)(3846002)(2351001)(446003)(2616005)(44832011)(16586007)(956004)(486006)(316002)(305945005)(476003)(86362001)(11346002)(25786009)(68736007)(6916009)(6666003)(36756003)(69596002)(51416003)(66066001)(47776003)(386003)(6506007)(52116002)(8936002)(26005)(53416004)(55236004)(76176011)(105586002)(186003)(106356001)(16526019)(107886003)(53936002)(4326008)(7736002)(50226002)(50466002)(48376002)(478600001)(6512007)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3347; H:xantnef-ws.sw.ru; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3347; 23:cG+wydW+dVW4H21lOlnh/bGhKKmHu7TJ2r+/LGlT5?= =?us-ascii?Q?jt+0WLp2bEc3E+956cbLn53cjXExifCsFgjsvqNe/bUz3OHhOdhM9f3PWW2G?= =?us-ascii?Q?q8e70ZKjmrmpRgnRrWFxZlw1HyGZowDDS14OjtFajeX4uBXGxMPM8JIHO6tD?= =?us-ascii?Q?PyYVv7IslD0ES7cR3R/ueo+ME2OhDN4uLd9C8DV/+U9qP5rYe2jPcyIfmwKG?= =?us-ascii?Q?d6JdvaeOVxOIMnakuq4rj9QWIbGQo9hP8uaKJg2hvHEn9Bt06tR3ixo1cJ6P?= =?us-ascii?Q?VsFvXcY9jhY8HtgGUloILJLkrHF9Jez+6nEE+xdfbh72LKc3J5/FvLKhUrl9?= =?us-ascii?Q?QfK9GQWwp1pBwPSfhu853LVTsB53GKCT2ySDzRqzN/w4aJegT9wUixPkZGZl?= =?us-ascii?Q?I/fbtTjhEUAOU7wnwbNeD+Fd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ii?Q?8JA7z4ZMGvLu2n7JN6RrH0=3D?= X-Microsoft-Antispam-Message-Info: t5qC/xynjU499ZWnLTdE9tz7/S6G7rPMVRO3yAMF8uPDDtByS3st3L9nGBf/AA85OJU47nevOzzb9cuCudoFAa1YGNZ4g3imSiRdvnd56iCfhhLtGZr61zdK65QEKbtkNbgKNOTt+1zXLD2qDzAazZXK6lrOZFWcOpx2wyYUNaCftif5YASgBTbJzeWksSFV X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 6:gJWS/sEyqohq7caTnrcZnabGPeQksXgWqmsyh14jX+FPVvjBDMGWyAncGWQQDmB2ViC7a+322t0bIJwbV2vKNq5bZ6Ds7D3dh79zeNlO8aT+EUyVChGT55bU6cF5UfoKBlcHYD+lI9ZM00u1PTmx8IEKaPvEGCurWcvzvfQ+R3bNeRH6oLM7rLmeBcyylPkXkYeybTiOCt9R47f/EAjaIHkH5y279xZijRTzN+q8nL7UnPwrmOL885A5vTtFKoho1gAlE2KBHqrihi2WVGKCRqejGou97bx7TW6V0rFqOL5HMN7+mxX3ePjJUt1bk4wB46Dn8jUFishdkyqwqXnbakzuwRcBBLZfNe1HmiNhWtP4+mRFHWiz3tYX3+AsH71s6J5QTTUBZtjekYUWvLSJbyMpqhkHkyO/GAw/ga9/d+I4yyF4xPWHjklaV5tCd820cfO5IDr+HIlSAspMptRxwQ==; 5:YUgF+YRchfd+ts3Bd7mkiKFlMp3SeSWG1mgC/NN4SqAfwwhoM8jOKSlfXjCxltmVvFTaBkxm6lJMJ+Ytk0a4uxAjVHBHadXUku8o9jiexgnuyneAtpVdZH7w0nsGXkoAibAABY5uQgAHrTse168KVG+mEjhkW9oNMhAoXRy0Ufg=; 24:snRC9QdWf/UtmIQ0ydMF4Wj5VELl2SFJsomtp03rZ5OBnz/YdtX4YSYLehfWF99htfUnMfl8ROLt3eGR5LUi9z6OB2LDNQnxkl4XdcJHB0s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 7:5S9lR9q3iVO1vniDZPCx+4gLYVkN/ZLpwEiY42OmtkuM42TtQGh1IcF9/xJAqzmJR2BJdYMRf7lgjW4ngto6WLSRxFPJefoufirBE2Ioffr26IDsauqRKTqMrL3tRNdLBDIrklalSSoiMktJS6xEtLqiQ2r0WJFrkwJtDQ2+krNCmNWOXAIkigyx50EwNo+roEgLahlu8z9/dGWebLbABZ8beBdSDj+kbzs0MZdgzL4cXcn0n2eQFGJQC/nlhpEz; 20:vdQXQ0loGxHAT+D3i+8ZKY4fYT05pcKNMGW2KitN/0O4woJx7EnIQd68fwXm5tAMCYVlUWVoExAxUzRIzN5ykFCj4lgBpGeCtm+SWefN4pqRkHIGDdJt9qeOP8xJX7+gfoCrLvhsKULu284ES2jr5B8M0WC2LW+UpwSQNTVj6fk= X-MS-Office365-Filtering-Correlation-Id: 0bfbba4c-5aed-4cf2-8ceb-08d5b4f42d0f X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 14:58:35.5994 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bfbba4c-5aed-4cf2-8ceb-08d5b4f42d0f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3347 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.97 Subject: [Qemu-devel] [PATCH v9 1/9] mirror: inherit supported write/zero flags 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 Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake --- block/mirror.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index 820f512..a22ddef 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1098,6 +1098,15 @@ static BlockDriver bdrv_mirror_top = { .bdrv_child_perm = bdrv_mirror_top_child_perm, }; +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) & + bs->backing->bs->supported_zero_flags; +} + static void mirror_start_job(const char *job_id, BlockDriverState *bs, int creation_flags, BlockDriverState *target, const char *replaces, int64_t speed, @@ -1163,6 +1172,8 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs, return; } + mirror_top_set_supported_flags(mirror_top_bs); + /* Make sure that the source is not resized while the job is running */ s = block_job_create(job_id, driver, NULL, mirror_top_bs, BLK_PERM_CONSISTENT_READ,