From patchwork Mon Mar 12 10:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10275911 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 98C0A60467 for ; Mon, 12 Mar 2018 10:22:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E8FD28C59 for ; Mon, 12 Mar 2018 10:22:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9333528CC0; Mon, 12 Mar 2018 10:22:03 +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 E80EC28C59 for ; Mon, 12 Mar 2018 10:22:02 +0000 (UTC) Received: from localhost ([::1]:57515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evKag-0006ia-1D for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Mar 2018 06:22:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evKWG-0002iu-0a for qemu-devel@nongnu.org; Mon, 12 Mar 2018 06:17:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evKWB-0006ZY-LR for qemu-devel@nongnu.org; Mon, 12 Mar 2018 06:17:27 -0400 Received: from mail-eopbgr10121.outbound.protection.outlook.com ([40.107.1.121]:6708 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 1evKWB-0006Rl-BN; Mon, 12 Mar 2018 06:17:23 -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=evNB/IdSU8+uYV0mok0I/J8AwJ371aEgDbIdgNTwYdc=; b=EIc4ru8bzS3jFCVXYkRN6B9LES2H1Fr22fJwzBIRGiik8CAWjkAOUw8VfsDfktT2gaVwMXrLrKZFLe8JPqht2LDXKguNCNH91wewFnfAZ/09pQ5EGcv6mbIXXYniw18i/7uIkSvkoPCDfQf+TAo0yAypko2xe9mZA+nRM6+MGKQ= 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:20 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 13:16:50 +0300 Message-Id: <1520849818-6915-2-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: 45b24dc6-4342-49a3-a42f-08d5880270f3 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:EwtLWL9HBXTEe2QA6gJzCGaPhCylZSAlL09VsSXw1mL5yaYMUSiZeG/3ZaFwOsiEZFVeC6asVKsHobiaiky1w+z3QXreMTqFCjDXKUojqHngpUwyrDeXPlVqATKVg1zrnCZkqX+hNP+nzgz8dMhxuXv0/5Ouh4V+vfMYtGvlCM0N9Ww4jTqdTdWTWAi6YFQrf9d8AeVJrLmzCrKOuc7yCplxLPsxeJFrm0Mux/VvMYezo4Ob/LKTVK6DJGUPBk4/; 25:8Hp8hANssWiSSc6riQGS5+QhUA2pm7v1wMU/zE3MUlfGSnce1Ns6sauiE8d7QUIoT/CIr03acN9qAGcqvF5j51YrIbw9w6l7T5kLG12zAtBLubfepqmJjad0S8oidFJekWThjI33+5VC24QlHenJzuNP6lg/6eJXooo/K1qkq1ag9pESvAY5itCylu40L0/ywYjNHWSQXiT78oqNYTBZZGcZkMBt3fEZfnwjbfEsOVnsL67Y5eZu8Hmnzw0bi9y2a+9PmtPqX/Wg4qY1RMI61K95lu3rn0hVSjhq8kTM1vxNlXIeJ7HyQLaRjeZoSNhB+PYPQKEwK9cmIsAFIBTt3g==; 31:wKpp7h3HWJxphN2lPSUhrJw4TkGtDkkF/AhyCow13Uo4KHT7JVr1/KA2rUZmbUKMPHzKvZ7WZpApwZNyeQ2/ehKna+778lU0l5syANJ60dnfUL2w57ltwRQHqxfvRw573oqNILu0etufUNKrLjLcnx0p8wC3ZJNc53/9OMbAZ2elpS2pBjlJuVr8wsR3msYLajsNU94BSA1nsVY4UBuQ92vtNA3Dm29PY4yEwSi7QUk= X-MS-TrafficTypeDiagnostic: DB6PR0801MB1991: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 20:H9zuKxhfhuTpGroEeXbM+bPINpqVRKwLbZRod5RB2YqEyG7BJ2tKTDRuvEkUpG/vtOhx13PEcmlIdG6e9k2IoJi5Gh3JbN1dk5b4jeDo+P8bgXKBMeKT2+ZmapJGmkVB+ieWWktKFbqtvEIthFZeU5QrYeE431/yUN81Strm1zYBPkm2NsDYA4ykCsOag+2cNgIvt3C4XswM9GOqxtC1JXg15kg9ndDwjmw6SkuoVKw6EvT9sMVp/O1MbBDQttPf3MNBW2XqA2pTwbH7i90wkv8tEG7qZk8XgYeegyGV2TZA0HjHNyuJ7ccLbI8parbZOStT29CDqslieORAbE2ZnQsTnQitISIfBLCC+zw3dHLCcS88XkWlIhhWd7OMzLHgh66LHuoMUcaq6A5DA1vOGmk/LEmiNcibakoCuBYlF5Qng45GFSbi+FQbxkxrwoMBkJMp/hSNU26/LooVoaqoGxYZBZ1ggnMN7BxHy++8Spbvyov9PFbxPjUZ/EjkIvyB; 4:hIPUklOYsG2829Q2JSUVIB1x2HEoOZYEyCrLeT/Vr1m4/Qstg7K3hTn5ONNg/5LXirJvrvnXIPe0ctjJQ7o1v8Mra9AG4SAiHfV97SNrYiqohqGiORpGpgev4De3WAdDQn8UabbxyXG9EPBMRs28qbr5i5ToyPga5jplDCwjEIRyPBOKbHa0yDyGeGKiIpdgCovmfFrkcXQWeei/R+WLeBU7TTdlxWCm8WWS0PcNmaVpu3wcTLuIOJMAc2B3IE+LXQhfI19lS79qPpDcj/auYA== 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:c/kixztzb6C4T1yh3/6PDVMBkHzB9PGSjMSYN9m?= =?us-ascii?Q?EqsAVd0h6AoG+2+X5wG7gj9pdCl0aK/P9lSb/Ba1fnWzCl4GtX/8fQkfcEs4?= =?us-ascii?Q?3wVN1M+SN3r7Yc2d23D5xIuyIaIt+VgrH13mtllDAHk32m9hu8aohhHoJ+wl?= =?us-ascii?Q?OuK41LrUT+yi8JYRJxJacRoQgxeKXYzpwutB2pHWzIGR++tp8tIi5jBq3lW4?= =?us-ascii?Q?WbmU/T7ug8sGd1lweK0HP/5GH8Pd2Z+5Y5FiQt7ECQFmuz31mWvXjyXd5Ucl?= =?us-ascii?Q?o7FAmJtlK/2GX7nM9ghDlZL9rhw7nl9WCZ47faUiSX8svTkpt1yfyw2cMLz3?= =?us-ascii?Q?Fl85M+6D0Uijh1GCMmrf0ZldZsIvSBh8zFnhA10LXLDZ3L2peIwYn+mbgpPw?= =?us-ascii?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FS6JNLUm4Q9FDYcftzw3v9vGyVsgA/QhOJ8zbKSXZ4gSlM9UqRC+VmPXSMUtBbGZFtn87 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 20:zh/UpiIkOyh5iXnzV9yEgsatBv04i8xwvvcB0a6HY2xTeg2Qsf1WZGqhRPrDvmP2W96c8nm4oiDSplxQ4nmUVeUxIsVveW7YuusA9pHfLqZ9dsh51qv2F5uJIT2doWXOFKH571VAZaF9ZMKGsw2eFIuK77NOtiKOdKYjUfOG8Jo= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 10:17:20.1464 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45b24dc6-4342-49a3-a42f-08d5880270f3 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.121 Subject: [Qemu-devel] [PATCH v8 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 --- block/mirror.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/block/mirror.c b/block/mirror.c index f5bf620..2fb786f 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1100,6 +1100,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, @@ -1165,6 +1174,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, mirror_top_bs, BLK_PERM_CONSISTENT_READ,