From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794492; cv=pass; d=zohomail.com; s=zohoarc; b=LCKprq8Sy6S2XDcs5Sf1lJ0H68ytGdkz6WEpLJ9Z2hERh2LW6Re8YSNJeVMBtG4JzLJaSBhCQWsw6K4fTr9j70S4zwRSkYfD1R2TuDH3l/L9WuyvVJzmFxaPiuEgxfs033DpRzqrYXDD7Y0hbb+Idb7c/1hI1KYYCwK1gTOKKlI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794492; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=86yxeNMvCmwRKQqxnvVlBp2jN3bg7Kd0X2SNe01MIcM=; b=NwiMA/7sjXgKB91VxSOvTODJAHqk1v2yLhcwQbDHQyB2CDN3V+ddvPVadKX1OeNaCiEuHpBxGxpOX8L7Lx5RjhkwiQUPVSXVkIWW3/mBDhX0J0EQF9Zk7a7lsAo7HyUAznqfa52QGVnp6IhxFC2HDWx2u9s5R9PQMzn8MkTX7+0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794492572794.4029808237642; Tue, 24 Aug 2021 01:41:32 -0700 (PDT) Received: from localhost ([::1]:53898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIRzv-00066F-A3 for importer@patchew.org; Tue, 24 Aug 2021 04:41:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy0-0002Q6-Dy; Tue, 24 Aug 2021 04:39:33 -0400 Received: from mail-eopbgr130120.outbound.protection.outlook.com ([40.107.13.120]:56386 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRxx-0007HX-C3; Tue, 24 Aug 2021 04:39:32 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB6533.eurprd08.prod.outlook.com (2603:10a6:20b:33e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:18 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:18 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YxEzpFnfR0ptVX3/SFf0eqI0qoQvG6p7i5TtNc5ORNdRakP58nOty6Mt76ChoMOwX5HO/1g3A3oHgOJ+EACeE8w4y9vEhH9jgNGfPNM+kt7bTkFz3rTZYZ9kdeaU5SM/MAyw42sohk3gpXjEns7DT+41RK4UXuW1K11FbWPTBtaXiXSURk/CLxsGgF4uMqLiMCRqJk79UIGxqxquNAHsNPps5vc/wRfeJGV8PFw8ewlx9An5x7jvCgx96ZPnSC9NQiMdx6q0SA6BBU/m9LAc7iwdbeSjPQt/++wA78FrrEY8aVh+sMRc8KRhCN+l3ZI8lujUcNFtB6agRzRgbHBWpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=86yxeNMvCmwRKQqxnvVlBp2jN3bg7Kd0X2SNe01MIcM=; b=kVYO03Zu6cZj9GBRqDuOktf1b6Wz+VEzmY9p0W1+I2LXaDyp6Bh9Vr0gFsryYYxpG8hZIdI2ITKaO4en094pR6pbPcPMLaY/DXAG/7vJEmCkbXD7+DYMeLsrEX46kLwBX3LfGzVlZDSN9eWsk3P5tLu+/1n0ZAMlwTyprCZYvU3FRdYZAsDEwJ5PS3YHavYJ9ZvdYkYdM/ncWz8NVjNoSW+ZWQJUjwdPALCVJvTv98lucOkbHK1TVp1VCCSYQ6SJtck0Ikumxk+qTGf5+m5L+H5+Tsm/XRQz7nBUiZC6BVUmKEZkdXleVzZ6242bGAfjnnHwgnNJMhoJYk7SiPBVtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=86yxeNMvCmwRKQqxnvVlBp2jN3bg7Kd0X2SNe01MIcM=; b=wo/IBjJgPkuwV6N4H2928LfRzWIwM2JejKsUO8lbd0NRSVArpS/5J/mn8tf8B6ZHPj5abS38VSuB4AHnnA4Folbuzx5DZPM3Tbn7/PpbbS8MQLSS0lnLjh1VyO6rshFofDgFeaRlSmXieOwGG3GSG6eHyuGhXdj+3cPutYA3gB8= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 01/34] block: introduce bdrv_replace_child_bs() Date: Tue, 24 Aug 2021 11:38:23 +0300 Message-Id: <20210824083856.17408-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1a8f8cd5-138e-43a1-4c33-08d966daa97b X-MS-TrafficTypeDiagnostic: AS8PR08MB6533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:489; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kMwdDSmB58wfJ/dhQkMYsw9SPN+uABEcDH6oQ4QgSGDSrrkeQWUaZ+rE+WtA1PC+1jjbMN5fjwNwX+WPsWBQbvpBa+/8eeFmxTRa7c5JVBpAs0+l3zCdC5KJcFBBT+PGIXsKTwzD46JADx91vHtHCZV7dW4XF47xt2fz49G5vg+RcDfKJxKl5ZU2OYEFP00joBy5w8ILtySEGVMCU04Go5T2623dq3nrq8QZX5Q+bfzoHPDHqRY1B2ZJ8HW35gvFRPUrFW6dnP60nTXDsW0/73SXzhtzc2arf3E1ydQkq1cN50BWUoKE9ejrd2hvckMBGCzKIYbui1bSRPwJoADMuF5usr7SQ3L4PVxdHiFF1E5uJ9038444ejBNS0ct0sHb1aMgfn8HIf9szrKcsQLW1pKMHrV+7YVAtVZ/UoVR3Ls8Ih4sItcixij0gai039b5CHk8Ava23h/LEF9N2Iog2ivVUx50emLeAQ79fdDvQtczuubiUUN5z0GgOVQ6WhyU4wjMcrrP2inWc8ZzoIVApFfRp/p2OmSE0OOZ7MsXko0CP4QjYGtZOzio4NwBZ91QsQX2ex6kX+vvvMItL16jq4RDXOjZbQWGIajNk6xE2XkPFY+ITlfhOuomkyOSpWeufDwcQ3IruOsSIt1dm/DLEy/YmvZwISnRqzk4bU9y3ScBClhku2YPl+P1UZOfabyeCC/MHlVXytuCOt3DalsIeQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(376002)(136003)(39830400003)(346002)(316002)(83380400001)(86362001)(36756003)(4326008)(6512007)(186003)(6486002)(478600001)(1076003)(6666004)(6506007)(26005)(38100700002)(38350700002)(7416002)(52116002)(6916009)(2616005)(8676002)(66476007)(2906002)(5660300002)(66556008)(956004)(8936002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QYm7wvra/I7XUiN77k5tnTfsJMGbJIR7QSVQHe4qYtrdRo1eC5x92vxY65Fk?= =?us-ascii?Q?Xmrwu2eD2wsTAODDWhX5nIBIM12ftbKBcZUVfxHtPRUbFMEaIHhjEkGaheX3?= =?us-ascii?Q?QCI8VxNoMjuzAU4L8XeiZYK2XfvUAeN+fM5HmoKbAJDBFBQUdAAz6PgfScvk?= =?us-ascii?Q?lMVfvv/avrtVfEf3Mr0+5/IiSKoalEMTOi5npJmSFD8uEV4tVy7w0pwCpMHh?= =?us-ascii?Q?Q+nPTGQUGALVc54KkXtF91akh2rHG5hD60ETKqD3hSzWxMy455g/gJ+JL2RZ?= =?us-ascii?Q?fUm97WSoF7p4eaZoUqBZFJ85ii0CjUsw+q+/URWtQnQLsCeNMbsJoXgYJaVC?= =?us-ascii?Q?LhU6PAhK0sui5PaggHljZN/6MchMb7Qh/6pGunv5syN6Ywr7hBNw6fICstAX?= =?us-ascii?Q?pQKkDeDT9KXmaMuvCQoiQ9LttcRNfSB0oMsXS/yRXTUv9SR1rAtS14fm4+e+?= =?us-ascii?Q?Jap2QgiUH8h5Xhk1hSFvHHbCH1uXyYclGCibi5w4qRcb9lbugbCq2RlvB1Et?= =?us-ascii?Q?dtT9jXaA4rIop74tMR0OnsyPeEpP+16gYB1yXqXprYfYCpYf9iubqvWtWt0k?= =?us-ascii?Q?oN8j9K1LE4pnhHBtvVkaNrOPzisBJjhGqAN9vtg7O5FUFcdcfMC7qQ5KhXEY?= =?us-ascii?Q?+sHJKjt+0d+CS/n4beB1g0j68duW+aeMTotmlzMNrnS8yoov4W31R4caoAxO?= =?us-ascii?Q?VD/DUubiMhxiB7XNl8Gbigeanr+EoDXvKdgwbya6CBa/acTCkyGWy7IBOCzD?= =?us-ascii?Q?qsfATw0Bn5lYMivnz6xCr7/r/2HRLKxxs7R08STnZIUHfYePLhzEMtKggRU8?= =?us-ascii?Q?ERMoKoyp/Jc3Xdd1KtyjT54UGW1LywKqJXcGdFANu55DMGjzxcb1TNpP1TPS?= =?us-ascii?Q?zlaFxa+yGN6nPkM8iU8V0n1YvmEWfRU2yuTbCm809HQk9fD0CO0zGXPbUW8p?= =?us-ascii?Q?0zOBdmdWGiNYgNZSTfMLDOqUGPO6VSXrfjiyUE/escq/gnOSKIG+vPs9uWnZ?= =?us-ascii?Q?rP/qF/bsG/ezJaCvx0153IS4LS5TyIQdmSy0HYTVUarJDXLhqnxZUYIp5z/y?= =?us-ascii?Q?MZGdJ9xpcMsgTW8PGVtwURlSbZbDm8VEw3/tm5R8NFUR30bi62Zghwz8izqm?= =?us-ascii?Q?V7sCp021cF8T/b/vRPoiYThF54dhYbmjB4nL/aM7ZNzoEmBzeO6p///Nc7/S?= =?us-ascii?Q?/SPEOWS0j5RgfDyNKwOjDlG6tQzhyx8wWINUdKZTC5FsUkELalgRuuqN7SDN?= =?us-ascii?Q?3TsEsk72qmhz+PD43YK8Us1p8eaMnpDeZqIg2r/Y3M9D8VzdJy4QC1eht+41?= =?us-ascii?Q?tG8VET2+hAGoQrxMlC5cO6TD?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a8f8cd5-138e-43a1-4c33-08d966daa97b X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:18.3174 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9epYD94Bt7Lb56JVqEUp80FVNj1Y7h54OxKfFWh8g9m7h8RFKEr1JklTKMJOFD0lMhItKDR+muVeMQm2C2c/yhHIDhTbND2EjXnGwjd3jnE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6533 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.120; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794495391100001 Content-Type: text/plain; charset="utf-8" Add function to transactionally replace bs inside BdrvChild. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block.h | 2 ++ block.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/block/block.h b/include/block/block.h index 3477290f9a..740038a892 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -361,6 +361,8 @@ int bdrv_append(BlockDriverState *bs_new, BlockDriverSt= ate *bs_top, Error **errp); int bdrv_replace_node(BlockDriverState *from, BlockDriverState *to, Error **errp); +int bdrv_replace_child_bs(BdrvChild *child, BlockDriverState *new_bs, + Error **errp); BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *node_optio= ns, int flags, Error **errp); int bdrv_drop_filter(BlockDriverState *bs, Error **errp); diff --git a/block.c b/block.c index e97ce0b1c8..b2b66263f9 100644 --- a/block.c +++ b/block.c @@ -5048,6 +5048,37 @@ out: return ret; } =20 +/* Not for empty child */ +int bdrv_replace_child_bs(BdrvChild *child, BlockDriverState *new_bs, + Error **errp) +{ + int ret; + Transaction *tran =3D tran_new(); + g_autoptr(GHashTable) found =3D NULL; + g_autoptr(GSList) refresh_list =3D NULL; + BlockDriverState *old_bs =3D child->bs; + + bdrv_ref(old_bs); + bdrv_drained_begin(old_bs); + bdrv_drained_begin(new_bs); + + bdrv_replace_child_tran(child, new_bs, tran); + + found =3D g_hash_table_new(NULL, NULL); + refresh_list =3D bdrv_topological_dfs(refresh_list, found, old_bs); + refresh_list =3D bdrv_topological_dfs(refresh_list, found, new_bs); + + ret =3D bdrv_list_refresh_perms(refresh_list, NULL, tran, errp); + + tran_finalize(tran, ret); + + bdrv_drained_end(old_bs); + bdrv_drained_end(new_bs); + bdrv_unref(old_bs); + + return ret; +} + static void bdrv_delete(BlockDriverState *bs) { assert(bdrv_op_blocker_is_empty(bs)); --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794623; cv=pass; d=zohomail.com; s=zohoarc; b=jFyIruIdYF54jkYMLn3yIwu2mcXFfNCNTlu4qGlDOAmVrGnYP55mjo41HAbixIu2n2XDK84gKFjivyBZqeedGOcOusWwjaw+gWow3JnyBBjhijrMXCHFTYEqY8EYFit57adRVQ0BxiSUX97OUKfARwVzBHQgBhFjhA09X9KsnD4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794623; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7GmJJP2me1hAQJQvNuKG3Yp1F2STkJylbpXCBY/QG70=; b=GejToXinrtrABSv1+gfHp/1BrTtyEaq2Gf9lRSPljZmRK12Jb2ALi3wXlDc9O5+yxRFUaEgVvgrxJkC8NzDYAur+/DhVo7FtVSm+OChG/eJCkwKkOoi05paXTFe8OPlLn7O/vSaS6UoghDOOzc+Dg748v6eJ1I6yvuvlPnHrkyQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794623614734.4140099703809; Tue, 24 Aug 2021 01:43:43 -0700 (PDT) Received: from localhost ([::1]:33708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS22-00030L-I2 for importer@patchew.org; Tue, 24 Aug 2021 04:43:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy2-0002RM-Kl; Tue, 24 Aug 2021 04:39:36 -0400 Received: from mail-eopbgr130120.outbound.protection.outlook.com ([40.107.13.120]:56386 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy1-0007HX-3c; Tue, 24 Aug 2021 04:39:34 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB6533.eurprd08.prod.outlook.com (2603:10a6:20b:33e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:19 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:19 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hfs9rTJGppy5wXT7nvZ/9yqvNk3H11IKzOkziRZdu3jjcOFSgVQSKWhgrnbNEQaf02QXmw/j+XOUM5ktqlDeWKRgB84oiED4y7Zt4zcjGHT7bVdpbLs7k0PO9wundwc1fZ4gLQes8YEvnLOJ72TawjV5OgZIUPwGtvYWuxZDmbgSiFlBUNLC+ZbWgUlVjKKRm8NAtVC618PMfy6PNPJYzU+CsyQl5/oMbeoBtkKW10iqdQN95JjSS6+nhN2nXNqHv1Oszia85Sputp3ZkXpx8bKg0YHntc2qmBN3RlsPt1hmEyL8QfEbxXD0XKrDeszaFaZx/dCpLQQaGkpRupZaOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7GmJJP2me1hAQJQvNuKG3Yp1F2STkJylbpXCBY/QG70=; b=Ol/hjIdX/C/B+kHyP7t161DOso02QK6vsX4MfX2k9SdjKEab9l1sglwjgvUXg3bpbUeTCxHl77lVNo4Cup6je+Pk1GkGFDBlvvqstEfmhxAzPYqIS+P4CUmFkxRGhKuBoHlWLo9tEM0tHZgITd0F5bvgJDufwClQU1fnYmcwSdiaAhHsBjwZm3vwO4IY+uCysosHf3BfY4aY55V+4oKT2/yjN5+4Wc4bBbcsenHXWrgs6ArVAwqJfi4avfO6xheONP9g6bzak7Hb7npy2p2d3b3hNheZJiwPah/3v6DVYIK0BpxfdpnHpdyYy4+Qe1Tqnnrohbu0Wv4gkreSHy3AGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7GmJJP2me1hAQJQvNuKG3Yp1F2STkJylbpXCBY/QG70=; b=bl5JjvfeyTcg9bKC7JdT6YXvM/PPU1GMGjirhiwopkKMLE6b2HpJzyeXImjqfA+cZ3LfAUJi7X/VHyhMnZaduJnJBApFv5qHGFstrxcj7SETUz2XzT/b+IokvZEcbVisNhCasRKvJTlwjA4savK0AykRljVg2zqT8e86STJVGY8= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 02/34] block: introduce blk_replace_bs Date: Tue, 24 Aug 2021 11:38:24 +0300 Message-Id: <20210824083856.17408-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36a1e139-5936-452c-50e8-08d966daaa4e X-MS-TrafficTypeDiagnostic: AS8PR08MB6533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:352; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FB9qxIPpwtUT5+JbNdxQCaYHrqwu/Q1CKMUtCSFzy/kHXpxnSn9KqxpJ71sZHi6mpI1MQ2w7Zm8DAFKZCpZ7uXV/BHIUohOTCC2SB31XsMlXVKirlhRbCKiPo/p+hp6CMHh8+te45CCVL/4EeZ9PmxTblhUwBceUrg2ElFrsVRm1x2IuV4OOft5wYg0RrteMRrlWZdQ2G3p5tAiPPH0RwX//sSmaRtXGmHKHHBGxcoqJArDGqhWQ5SU/Q70xQF6+QCIeXrS9duabyzrmKEjEyqbxnT8c1F9f6BLKM9tvL+Mc4vRFHUcj4gjq9llTZ5EDV2Uk25o7gUMkh32ykgpow68vvpxo9RlD9FNZrqP5raLNLya08JrNxtMJRYJFaa11T8d7nErVSHgL6bOj98aNPvhgELVvsz0Hai2/nlv2L/UQCKWzCd+0hNFJIFI/Odr1ZzaR1mH82u8dCcZTPTaC8JZdX6Nehyp6bgjN3qgPZ7K4W3g+uTCCB2iBFn76fLZJw8M2RzwqcsvlGKMmh/yCZDfi/ABqa7vKwbMhMqTH9JS+mXsqEWQFQij3N2tLIMt+3tr8KP/P+B6cw6+S2nLCchJG4GPtkq1SjOhBfOMfS+FuDYYrD1/qvKtdnYEdcGc2GVum4QvOPb98LLlp3x1/qafSkne+fHW1sDfaAhSL41i19c+f/TkBdMtgBLnt/HfFKVdb3kgOOJz/oD267RqzWw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(376002)(136003)(39830400003)(346002)(316002)(83380400001)(86362001)(36756003)(4326008)(6512007)(186003)(6486002)(478600001)(1076003)(6666004)(6506007)(26005)(38100700002)(38350700002)(7416002)(52116002)(6916009)(2616005)(8676002)(66476007)(2906002)(5660300002)(66556008)(956004)(8936002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ETKPveF1EDh+aaTItru66TYl8bCznwxWjNcRd6lls9FSbzmutk5kFBDnRnAm?= =?us-ascii?Q?gTJGC7/gI1kb7wuJNHe5Lh24wQp7HVQI7cZ/VlCZN7vtNxYqf9RhkFsncBGD?= =?us-ascii?Q?inRVWIpYbyrfFCdnFB2IxNM7cWs4tLHrm8iaeXJkozxltdPOYWUoSp2DqmaS?= =?us-ascii?Q?dXZXs9SS4nvJvLmq7KEksa5TV7+zyrhFUAG6PbPwSw84lonR2q7F3GhnbdCx?= =?us-ascii?Q?ZrunkyZyPT1uXU7xCJ0SZ1jJOrf9qa4YFt3jDTHJCj+u2xksI649hxovg2sj?= =?us-ascii?Q?HVq3gcE0TZYTKXHR4CSKJv+X7sPwghimeMsqAWugjc2C9S4B8/v1OQBk5vo6?= =?us-ascii?Q?VSiu+ErtUyelcevD25NVaG4zMqC1qIYpIN4NEEPp+j/87MXdKiHambV2FYRb?= =?us-ascii?Q?uyJBAeD9UK9fHkSRFRUl9KdPKgA5giYLcpDOcwEceU9OQEShkj73OK/VrHt6?= =?us-ascii?Q?tHicBtKa5JsJUTjpUtHqi6im98WPzF2dnept4nzeRqPEn/41nxifeDqBeIUn?= =?us-ascii?Q?NHRLdh7cmPnRWKYnL5RRG/MslMJbr1zk2L2fiNQLCoZ885W+umsqAhYcbFhP?= =?us-ascii?Q?CR/mOCGSGgCqxTKGi2kLliu0dnvw446ma2ZWxYqvAwVe5ElyhOjkdgVtuFu4?= =?us-ascii?Q?QIIB2B/T+5qk6pz+rSJNlaD8Nqd+nePljSdzzdHYq+A1zLjhA60DcIyJCLJS?= =?us-ascii?Q?QRsDmxIoVYoT6v3y7kYpZeHV+GPcpRN/aZv12lyXRVoIJQw8Q2Qdobm6xuko?= =?us-ascii?Q?HebiEhlu+TWh8ln/dXarvre6MBCBsPXcWS6o3+N1FzPdiq4asusXnDtcbQIu?= =?us-ascii?Q?urHsMB3LfIf4AmaBTXYM5vLnIKeBhlIwANxLC5xDA1zqpc+FHlNC75u9bulW?= =?us-ascii?Q?eTmfgMYxBo5iiHUUfzRtPQ3kwhG9h3z2a7idN+qpb/wewpbtO5FyB7cf96kP?= =?us-ascii?Q?gLMDcOTD6cKBGehbrrVfvx6FESSEdajIa3ozYvGCTBl0yLDuQVUMs25Sc8Aw?= =?us-ascii?Q?q/dmpbhSguxzZmZUnTeycMZmFl3DN278qxQajWnjgt75AqeBLLXwQ1Hf3s2K?= =?us-ascii?Q?iAboKdUeMsOpFeJUeXHBc9dv07q1UMABKITBxXA309S5HovH4CjUXB3EWj1J?= =?us-ascii?Q?WTJyGiHDA2qE/MIehedRnQSAQJpDZflpFFI1EPl3UXiuA0LM3f6sowiN5ZZV?= =?us-ascii?Q?fnPsokDPA5XNGWDbbR4Mk6UbxK1+EhlU8AdbN5+B0jnWHnMSt9jHYkqC3CTo?= =?us-ascii?Q?1HR/BdlMiBouDnV3fneeGV3nRq/8/ts+F3n+b0c7wp5v85um2NVIBzWe7t5p?= =?us-ascii?Q?v1tdAIGFcYcYwnMIwg4FMivQ?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36a1e139-5936-452c-50e8-08d966daaa4e X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:19.6983 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LGQ5GiqL5NWqiyXA8XzTmnvb0WilCSduWttG1Jibyw2gQtjiJK1DUc00NywewwZZub/0aqAzXEa5RgNRXsRFQQKYiMSivZssOuSk5vJdPcQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6533 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.120; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794625739100001 Content-Type: text/plain; charset="utf-8" Add function to change bs inside blk. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/sysemu/block-backend.h | 1 + block/block-backend.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 9ac5f7bbd3..29d4fdbf63 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -102,6 +102,7 @@ BlockBackend *blk_by_public(BlockBackendPublic *public); BlockDriverState *blk_bs(BlockBackend *blk); void blk_remove_bs(BlockBackend *blk); int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp); +int blk_replace_bs(BlockBackend *blk, BlockDriverState *new_bs, Error **er= rp); bool bdrv_has_blk(BlockDriverState *bs); bool bdrv_is_root_node(BlockDriverState *bs); int blk_set_perm(BlockBackend *blk, uint64_t perm, uint64_t shared_perm, diff --git a/block/block-backend.c b/block/block-backend.c index deb55c272e..6140d133e2 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -869,6 +869,14 @@ int blk_insert_bs(BlockBackend *blk, BlockDriverState = *bs, Error **errp) return 0; } =20 +/* + * Change BlockDriverState associated with @blk. + */ +int blk_replace_bs(BlockBackend *blk, BlockDriverState *new_bs, Error **er= rp) +{ + return bdrv_replace_child_bs(blk->root, new_bs, errp); +} + /* * Sets the permission bitmasks that the user of the BlockBackend needs. */ --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794795; cv=pass; d=zohomail.com; s=zohoarc; b=heI42wNJrNhdV6++UXtKl9jJAATpGSKGqOCkEa86k5/CQbfJdnvHZ6Lj3ZBIzU29wIwbReQENmg3tQilXDxDYJHh5UvP8GJWhNAmKSadlnVClvkc7Koh1fp3AXDkrk5bKWhRF+H3FsPKko9CDGfyr4GMzoDLKVgUEwuGaYJySa0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2TYk/vlRgkhlvjrVIe+Pk/FNNMZHyvuvS9JwUm7efHQ=; b=CaZkxa7RGw5Zxk7djrZYDzbtctwBKJ30CnsaIwRrIupoTBMZW+JAI3rI8oMjttSbLIQbiESR131HSWmkCC8+nwBZIiL24uMmCFCnkjzk0y9crfGAlAocIW3NGrZ013TulTzAlMfH9TT5PQ9BYZVaEHzCh6EKJ35hYZcgknbh02g= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794795574526.0935791359477; Tue, 24 Aug 2021 01:46:35 -0700 (PDT) Received: from localhost ([::1]:43548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS4o-00017i-D4 for importer@patchew.org; Tue, 24 Aug 2021 04:46:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy4-0002SQ-U0; Tue, 24 Aug 2021 04:39:37 -0400 Received: from mail-eopbgr130120.outbound.protection.outlook.com ([40.107.13.120]:56386 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy3-0007HX-AR; Tue, 24 Aug 2021 04:39:36 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB6533.eurprd08.prod.outlook.com (2603:10a6:20b:33e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:21 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:21 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UfwHYe0e87VLUMMCBZrZGSLmDH8gqsMKEBI1ZvQ1wYKF9D/TXyCwUTwRiTLfZE64+X+bZI9dOppg38ociVpIMWFW2Hv5mDsk635EXbLU8uFlLw57vPMei4sWptrCICqNn6dccpljycktmtusRmJ0uJdmA2cqppxJIUq6IHZ8gmlvB29nQo2t6VeTZW8scDmC4JeXbNbpUfuZ3dXtg87k08ejk1l4djjN4hloZUJHNyteZRb+2DEoWNM0I9M7gOlqa7ZS5PznQQDgEqYN4K1JIULinmjIfQQIF/KcufcEoAMq876ToyhCvmujpRBd+11Udb3273sYBgSGIegnvLZn/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2TYk/vlRgkhlvjrVIe+Pk/FNNMZHyvuvS9JwUm7efHQ=; b=J31WYg24sd5oRJCGVp3Q6Pu7k2iQqbP+FUAcCHMGdmUMRSdzIL2lEEkjVa7pbJq7IGwnToIjJFHpEY9sFxSmZ8qOa2c+e9f4V7pENWoww2VcUxa8pqa1t/1rf7PO2dUA1CRpe+8Wy5Qmp5xatTggFJFoTIeGrDU1/fofg5qajQNfPf0NOFBvUrGllpgyYLapgn0SNvsMTFGlu9+K+YSMB7Ev/2RGSesulqgcrPlbKcwvTLP+KH4M+3IGswqP53Ggrp/Uey8IBNDuTEofX6MjIEF2hNwYxRaerhyIj14x3CypOYKZ3ZdDnke+AeAOsyTpu544sSzuzPZu/x0ujVn99Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2TYk/vlRgkhlvjrVIe+Pk/FNNMZHyvuvS9JwUm7efHQ=; b=PD6OKDFl10QcCs4aMSs5SttsgvH9oiVkIXLpBb0cSl3b0zkxaVR7P8DV6cLA4lqfjLw/R4jdzzrNO8KHIIO2Vb0vPRlmuNl4G4Vh2Km4aLIfZAyl0UCfXqjq2c+2s3n0sg3ZxdbGnfsfZFQ4B7evtKgH9F3eDMuhSmtg8BOyo+I= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 03/34] qdev-properties: PropertyInfo: add realized_set_allowed field Date: Tue, 24 Aug 2021 11:38:25 +0300 Message-Id: <20210824083856.17408-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a6475e6-c311-4b91-e0f1-08d966daab20 X-MS-TrafficTypeDiagnostic: AS8PR08MB6533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:595; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d08I4M37mEDKYNH3SQf1B+S18WPAlk9C/weC4fEqtyJtJvnkGkTv9ybmk8ddcZCpdajVJiPxGbl+/UpcMxMdncb/hBLIdZmc6YiQMf8eInmMefNN9DHHaYWicu0Ag2at1xdVNLm2WLtKDpZ/XT5VKez8y3uJd51/bKOmx4rcBtRvZz6rCFaB5eYMntcTkEFOCIpNMsEooQO1UuyDay7yvGU1vt2cJIARISARRjiaCcFtFxXtAJD8pgUJ2CAfIsUNPB3mwcIN8De1K/plnP+QO15u6FbwE4fUVgT4WtD6tL7EIWGUKFVt/O521qX2qgPu6Rj8aTEYUjDEBCd/lxaeC3jPBjGi5+0MJz5fRjANBFyuGeP/wfAkq6kypZahjB/c664R0qizLCL0R/RJ4ZTjpl8QD2vynQ724h1vfnVO/Gb+Y25SQ3sssXYuxoC1QjjEgmRE3J8Ljrbn07jQFBcUw3F/RY9C/w0qsVK/GBdz1qhfns3rt/LZs06+EIsX/ntn61qU0XNuivbnAp7U+oGDWI4Jk3zlhqfWcGsxamIV8kO5vKRWz3zgEllG7SkW4y/YCrag2SITuhK9XRqEq8o+5DnpviKCZnMgcGMp2+O9hE/GJQZW7G+G8VvTF1EskgUBSeleEeciBtReRjaQ46rghfk5QLRp1Fvjeg8RHIWwJz8JxHlh8UjrFF7cZ2UwznucMRt0Dj8+n8boEsI1HgwE2g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(376002)(136003)(39830400003)(346002)(316002)(83380400001)(86362001)(36756003)(4326008)(6512007)(186003)(6486002)(478600001)(1076003)(6666004)(6506007)(26005)(38100700002)(38350700002)(7416002)(52116002)(6916009)(2616005)(8676002)(66476007)(2906002)(5660300002)(66556008)(956004)(8936002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KWF6tP3fTieqRqrXX6B3Wp4tv1zfmxoometYaIbvNAju+NKMbLcpYcrdfV8/?= =?us-ascii?Q?F8/5IXLYFh0lPJPxa/KCaDlX8v6Ey9RnbaprhhOjv045y2HCjlg9QN+NP3eE?= =?us-ascii?Q?PmAVcwNPKiVVOQjl1qpxBV+InD2oh/mKaNcCqrRuYAek7dVMPYJyXMFluZez?= =?us-ascii?Q?fQgYxM16pskynrWt5Ab3zeEbmlhrw2vgQqx0auxPVHyErdIv2RLcZUE3LBRa?= =?us-ascii?Q?6fd1sjy0cc83/Lx7pWpuMvsNTAiqA7VFoUcCtB1cUoJPwtV3l9ArG4tAUli7?= =?us-ascii?Q?zPiNgn91e/9ARNvpOD9BTaJ4hKd6fMR6wBfzn31ip9s+e413Ark3bq0k+QgG?= =?us-ascii?Q?DJlKQ5UP1Iw0dN3T4uA9tuvv04wE3/PXeYQK1OSLaNm7vTFUuiZt2nlVGzdm?= =?us-ascii?Q?3myniJppUndQ2RyqR/k7YoHWgoQ52CBv7tbVQA58MKIuXWHf0L/XbPefDdkX?= =?us-ascii?Q?m8+yNATODcziWW1kP7ZWQ4vnx3NhcQfe5wWJ7g1bDUp/CWKoguZQ70EL+R5u?= =?us-ascii?Q?XutawxV8PWcYbVik1VjwTt3oBQozhSDj+hSadmjDSXvHKkZMF4dq8VD5Wx7e?= =?us-ascii?Q?vlBEV+eo3QYjFsBRhIq2zzbhHQqmKORdEzJ3H9773yf/84bDXWj90cC8/Zg4?= =?us-ascii?Q?CykXMs7tQzuXeFo9gYEHjjkggFZGpnS8m5TUl5PIQ6f5WNeaiYh2TS3mjPgj?= =?us-ascii?Q?Je32YvoYVUBfMvxxRqnAiInrHFbh3BIVBFE7PTRBU9dXP5wJSbHbZfXBRVw/?= =?us-ascii?Q?bLpxJ8Rc79gV0oWqu9GCXW5m/+4AK13PoIbhtYR4hbS6Y83Ebs8A3l/q2A0g?= =?us-ascii?Q?mgRAO1LPWmXmN/MdIFTm/MY7tsTvyoXYnsSo9VYxvjRP9BN4RYZnBPwVvBEU?= =?us-ascii?Q?IsjznEZIArOgxiC0dw0MfPcZ1ULALBeLX2P4YqRu2jj+p9DpjIzlCbqGeuSM?= =?us-ascii?Q?jBvlHjtLruqBQ27U5bn+RnFYbiZVJZ3G4GpmxB5Vr4lt3l+mwCmSgAt1u9mY?= =?us-ascii?Q?PTNvETFVP8saOaaSv+XvCEceyhRQ5HWQknvvBzFgU1tQ7rNMddTkaiTG2Vht?= =?us-ascii?Q?GzyYiEMk2sXMyZx8JdlFH6ID0hv5846i1OLvo//q8nslFBgQ4JhmizCcwREN?= =?us-ascii?Q?sxVpllcc4m/vd/tgIF4L73R167tti6AklJsOhne8jOINeEWOUOBepMzs9gXb?= =?us-ascii?Q?j4GKFTH4O+OWl9dlwHekW1ncBmu43gKpnVf6GenC33DOnNVg3ZdoZi6VeROd?= =?us-ascii?Q?SbpOAfUQ33v3rsW3vB36bp2OSALPreDTzpXuUY4YdarSTvOHUApv2dkarlKI?= =?us-ascii?Q?LjAUDQdzDly6zyaGqlxBmjBL?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a6475e6-c311-4b91-e0f1-08d966daab20 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:21.0663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y8g5yP+4KtmrYQNk5vNGEyJcHHL6kvzPdq/F1Pyex1qEH2VeO1H6t5RR6igVzg9z19PVYjkMc5z7fePTZcSjGVBFyLE0KZWKVn1Utq6NNwE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6533 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.120; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794797572100001 Content-Type: text/plain; charset="utf-8" Add field, so property can declare support for setting the property when device is realized. To be used in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 0ef97d60ce..f7925f67d0 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -32,6 +32,7 @@ struct PropertyInfo { const char *name; const char *description; const QEnumLookup *enum_table; + bool realized_set_allowed; /* allow setting property on realized devic= e */ int (*print)(Object *obj, Property *prop, char *dest, size_t len); void (*set_default_value)(ObjectProperty *op, const Property *prop); ObjectProperty *(*create)(ObjectClass *oc, const char *name, diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 50f40949f5..c34aac6ebc 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -26,11 +26,11 @@ void qdev_prop_set_after_realize(DeviceState *dev, cons= t char *name, =20 /* returns: true if property is allowed to be set, false otherwise */ static bool qdev_prop_allow_set(Object *obj, const char *name, - Error **errp) + const PropertyInfo *info, Error **errp) { DeviceState *dev =3D DEVICE(obj); =20 - if (dev->realized) { + if (dev->realized && !info->realized_set_allowed) { qdev_prop_set_after_realize(dev, name, errp); return false; } @@ -79,7 +79,7 @@ static void field_prop_set(Object *obj, Visitor *v, const= char *name, { Property *prop =3D opaque; =20 - if (!qdev_prop_allow_set(obj, name, errp)) { + if (!qdev_prop_allow_set(obj, name, prop->info, errp)) { return; } =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794790; cv=pass; d=zohomail.com; s=zohoarc; b=UWtksfBQ57xkrFqB0xk/z+wLA9w+IDGetTWq6IU/hDJ1wqoNiGVxF2leZVwk+PJywZZ2WyuRJnw+h4gaHvMRavYLR26nps69K30+E1MxTQZYroxvZSAwmOs9275sOEUohK1JYZDgE2MsUe4s6V5MOh7rdMKjv/P59T9orT6hG+8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794790; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YJfp4qB2n7EBWUo59Of5E9XDnSvgv7wv4W8IEBSsMhQ=; b=HbTNdSwSLKAzliEOGmasqAoeyEHS4RI7QpM/c4RxXGyPJHAcUaIDDqrXdLk6lDcYdTnPGi3LjA1REb/20rvEa+Tc+uPhHuDs3tmwhmxQK6SVlWeDBEKRwx5uBA/ogXZoOr09WqkrX9SH1hKA2PJopr7zKQFwf9RxqHMO9WwVwiA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794790173388.39972709931783; Tue, 24 Aug 2021 01:46:30 -0700 (PDT) Received: from localhost ([::1]:43010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS4i-0000lr-Js for importer@patchew.org; Tue, 24 Aug 2021 04:46:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy7-0002US-Df; Tue, 24 Aug 2021 04:39:39 -0400 Received: from mail-eopbgr130120.outbound.protection.outlook.com ([40.107.13.120]:56386 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy5-0007HX-Ks; Tue, 24 Aug 2021 04:39:39 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB6533.eurprd08.prod.outlook.com (2603:10a6:20b:33e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:22 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:22 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V7U5XEjMkAH1+d27DME7q6q8Pbjua/jZHOiFoWS+sNqxdAfYTjlmmej1TZ3eC9dZzVSLleddhcN/HQjZVbhd8T2UUgUKSM7kacjFKei2Lb0nY+iPIqL8z0R1DF8ogz8i0qHNlqVuyY9wGugkZXdk0t3kUoetUeR8HZeHlR4kyWZBENASpEOvmmkz7w2vVXibOWwr0kwDr6M6R0aZ+eiYCGtnOqHooeTtnyGOnb1TmHpAAgW4daA0ZfK2gpWsDZ9jIrtY4TVLgzenU4SNcDKD+1B9R/+d8zLEfaii2SXolRhaniPztrjv1lu+jN0RpJ8AG4g3htNLdUt0VqSPi/46Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YJfp4qB2n7EBWUo59Of5E9XDnSvgv7wv4W8IEBSsMhQ=; b=g5XbnCQsntKOi8f3xdjGPnybpZq1PJdwXhBglq5XCEBpVAb725SyR8TNQvTeRq2bDiOUCTqewYRqmh6PpYvyOh5UpmRXqatD8Zs+iIyjCSyUpB6pUMBcY7Vl/KGi33IDOtLkB75+mf/V9eN+FRwW/BlsYFPrpAW6wNuLUxVM1bDk/HAJjZy8E0vvekXr/gupjnDOVqyxyad6ysFXrUZQvD3GKlsw0MUy6XB8I8qQOOC68Kqx6H3JebW6qXBxrfE5IEE08ZodXW57LfgSo5Oigy5Y+yXdDgcHeL1U916NTZJW1chrqq6UryAESjwPXsHziUaxGJdQeqi39ovuTsS1EA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YJfp4qB2n7EBWUo59Of5E9XDnSvgv7wv4W8IEBSsMhQ=; b=qYnAVTC8lG/F9gmgnWab9GAc+XcWr/YjbkbLU+j/5u7f+I/EbMF3TcERySVnk1RYqR1E4LiYac++zYPtUL0ax/XhuT0YrUovMjDgtBRJvUFq/pgRQQ0t79RHz5yZ3pVvG0m7h8IPVFmr3MKAOjKMcCkcvfjkI4RrNCYgaD7ux08= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 04/34] qdev: allow setting drive property for realized device Date: Tue, 24 Aug 2021 11:38:26 +0300 Message-Id: <20210824083856.17408-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 777bc9ca-5850-4d49-97e3-08d966daabf3 X-MS-TrafficTypeDiagnostic: AS8PR08MB6533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d3F6sINr0eS6uSbERnt7FZ2H/cRN7JGmiLhMR5Kw36iCHCVii11KVldfrZQsjlSp1bEl74gq33Ba+RNBn88mboqmdmwHn2wkYRY23o9gwkBz4JCQaKOv65+UWLLHik1jvs570VLFPNGhi2hz0gmjW6Db+xr3X1vdsAWGgFibnMhBFiiNfdLDgl7+wPwlzNrhVvjWJRJ9SSl9P/wfyE/18mu1IgB9cGhbH4O1lct+0+2GHJtiOrQXYFIjz0xGeP75ARC6Jf0zUXyRdMzlr7HjbDf9WIfgf4zRM6SLsRhSx3JEX/Bc3X6lNFURMHwzez9BXfUWD7L+Denet+WsgJD927dE9P4i0lEUNIK+s18DmCzWFBLzrOlroZUBUUiKYmSp8utaOhlbs57CycyOmgRTKWCbMzdaGAw40i8Qb0dOic47a+1F2BmDPM24hhyChpciq5FOyCMKsTVdXrpAm1yMF9BnQnw22uQkzLvEvJDJUOr/gpZ6g/ffHm2T5uXXdvphGSh2hNwzR4dK7EfqrOv2WIm1lrLX0iLvjNTWu++hyn30/vMk0D5KHk7xLjurXqpjs0VpgUiefB2O2d7uguhs+klhF99xl59997tJLAWy0c088nQXvn0rW4EucMbN/QDpl2tke2Mmlhz+Dp97Hpwvh1P2Uwkr/ZwuOZ5w4XDBZ1gimDASt549iubSpadza8jV9LmkxbXzq5GTPTW4HwPNSA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(376002)(136003)(39830400003)(346002)(316002)(83380400001)(86362001)(36756003)(4326008)(6512007)(186003)(6486002)(478600001)(1076003)(6506007)(26005)(38100700002)(38350700002)(7416002)(52116002)(6916009)(2616005)(8676002)(66476007)(2906002)(5660300002)(66556008)(956004)(8936002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eDBHMDRXRUJFRk56UnlCOEZINW9vMEk4WlNsNXNlcnB0TGEvdVFCdlpUeW1R?= =?utf-8?B?c2NMeW5manBPSGh5SVdSWVgrdXV0aktkU0c4Y1dZa3NGZjBySEVCMENiK3Aw?= =?utf-8?B?M3FyTEVHS1lpb2dCSHZKRkMxeTk2Z2JsSGRmNUpmZncvL2prQXhWMiticWM4?= =?utf-8?B?MkdZUE50Y2p5M1pHN2lEUXVGSGtPSXF0ZDhWSDJqMHpZNVd0OTdJY0NWTXYw?= =?utf-8?B?RkNHYkhJUVRqMWlmSlVtNUVXcy9vQVRKOWRBVzh3OWxsNW5kcU8xYTZ2Nndz?= =?utf-8?B?MGlQVEIwRnpkSEEyTk1UMTBUL2JJQ1VMUWxrVlkxbks1STY1Qkl0WFZsMzAx?= =?utf-8?B?QVJCaXlXa3Z0RWtMcGlUY0tPZW9JNEs1OEZUSTdoQlhJbmhtS3R0OU5DNzl3?= =?utf-8?B?Z0hVNi8wbldDalRvYXBmMHR4cGxFOWdNeStJQVpWOVBFWS9hc25GRGhDaHlK?= =?utf-8?B?U1FQaDAwbUI0SXRBMmdSODczRGNDeDdzdG1RbnNBbDU1dm9SQUExQ3hZOXdm?= =?utf-8?B?SmhDVC9xdnVaeGFaMGRlSis2Z2hHU3lFdlFwSXg4RlpUdnFrY04wckc0dzZW?= =?utf-8?B?dHBpWXhiZVg1a0psMnZ5U04vT2lvSVdJYTdVSTB5WDYxZ3Fsd2FjNUhEVnl2?= =?utf-8?B?aXY3Q0ZoejdtVnlySDRaajFiNW5KUnZaL2tBVGpzQ3Vvbzd4NWY5N3ZwUXh1?= =?utf-8?B?K3dkaE10b1pDam9kTXAvMUJUekNnMUtLbnRZQkZQQUorQ1BkL0pBQ2JrTm9t?= =?utf-8?B?TlNBdStJbG11UkhHL1lOaFh4bWk5UEhtWFpVdlZUdjV6ZDVINlBXbmd5Y3pH?= =?utf-8?B?Z0hKbE9HOG5KZDBGMFBVSFhJc05tYmhNY3lZeWttN1d4TTZiRTZmZ3drMEY3?= =?utf-8?B?VzFIK2d3OUVOSitrRGhaTTY3L2YrTWwxMnZMOFVqbkxiZlNkaUVDa3dWL29r?= =?utf-8?B?blhaTUFZVGtxZHE1TE01cGlaTjlYa0ZRckduUU1CZ3ZSQjlPVUdCTkZGSm9l?= =?utf-8?B?UGI2Y1dycnU2ams2M1JyL1lQZUphZ2xhMGwzMkcybTY5WTk1RE90YnZ1YUFT?= =?utf-8?B?MCtlSTlqVFQ2YTI2ODIrQXZYcWdXVm5wSXhINTVvbnhNaEFCVExSd1ZweUlR?= =?utf-8?B?VWt5cU01bk1jcjZBdGhMVmo1V0JISHkvSzR6Z0RMR0hyd3dONlZKc1h0SDZR?= =?utf-8?B?SE9PczR3elJUcHdiVnplcVpMVXNGRW95VUR4K0NmUHViSzU3L1JtVngrSS9V?= =?utf-8?B?cjQ5TjlKMWJyRWhLUTY3NzNqTDVWV3hrQTQyQzRvSkJsdVhkWHozZ1h0Qnlr?= =?utf-8?B?bE1ZOHJ2WnBRRTExZy9Od2plYUE1VjdlMG9rR0IxZTFqbHVwSTBIZE9xWVk3?= =?utf-8?B?WUYxZGpGUXNSeENjaE5uRFhDOCtTanhoYUNIQ0RMbXhZOWZBZitrQ2NGVGRw?= =?utf-8?B?L1RYcjM1RkdsTHd1WjA5VWd3VTVTdS9YYnhwQlZndHZpcUVSZnhZSUI5TVZ2?= =?utf-8?B?SkpEV3NUTXZnekVSemk5Ym43L1Q4SEo2THVBd1FTOGVhWkZVRlhBOWVRTG9k?= =?utf-8?B?aUtjNTZxRFRMOFJNTkxlWmdsdUxFK0ZuVVhXNW5jK0s3ZXprdlVkSlR0bXBN?= =?utf-8?B?amlCUTZLNUJ1TUVHdVM1TVlGd1dvOG1TbU1tOThKVmdWUEJSVlZGZmUwTmlN?= =?utf-8?B?Zng2OHdaYzVXbHQzZjNaMTVYRUd2UGZPT2xvTHBCUGw4cnFRUXdEbjRLL3Nj?= =?utf-8?Q?xOfd2Xbv4G1USdk+svpN4PbhJyfIzIEyicPhZZ7?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 777bc9ca-5850-4d49-97e3-08d966daabf3 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:22.4861 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U+EwV5Fgczv+SgxR9cQoMGokEw9CdHIEOvISPbUdcjPDECHj/iy0f+mHXe9YFvOBXbhYoyJdtUqHhXtVq+9x6JqaAQ3j8OEnfA2dr8mmhR0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6533 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.120; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794791549100001 We need an ability to insert filters above top block node, attached to block device. It can't be achieved with blockdev-reopen command. So, we want do it with help of qom-set. Intended usage: Assume there is a node A that is attached to some guest device. 1. blockdev-add to create a filter node B that has A as its child. 2. qom-set to change the node attached to the guest device=E2=80=99s BlockBackend from A to B. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- hw/core/qdev-properties-system.c | 43 +++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-sys= tem.c index 2760c21f11..e71f5d64d1 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -36,11 +36,11 @@ =20 static bool check_prop_still_unset(Object *obj, const char *name, const void *old_val, const char *new_va= l, - Error **errp) + bool allow_override, Error **errp) { const GlobalProperty *prop =3D qdev_find_global_prop(obj, name); =20 - if (!old_val) { + if (!old_val || (!prop && allow_override)) { return true; } =20 @@ -93,16 +93,34 @@ static void set_drive_helper(Object *obj, Visitor *v, c= onst char *name, BlockBackend *blk; bool blk_created =3D false; int ret; + BlockDriverState *bs; + AioContext *ctx; =20 if (!visit_type_str(v, name, &str, errp)) { return; } =20 - /* - * TODO Should this really be an error? If no, the old value - * needs to be released before we store the new one. - */ - if (!check_prop_still_unset(obj, name, *ptr, str, errp)) { + if (!check_prop_still_unset(obj, name, *ptr, str, true, errp)) { + return; + } + + if (*ptr) { + /* BlockBackend alread exists. So, we want to change attached node= */ + blk =3D *ptr; + ctx =3D blk_get_aio_context(blk); + bs =3D bdrv_lookup_bs(NULL, str, errp); + if (!bs) { + return; + } + + if (ctx !=3D bdrv_get_aio_context(bs)) { + error_setg(errp, "Different aio context is not supported for n= ew " + "node"); + } + + aio_context_acquire(ctx); + blk_replace_bs(blk, bs, errp); + aio_context_release(ctx); return; } =20 @@ -114,7 +132,7 @@ static void set_drive_helper(Object *obj, Visitor *v, c= onst char *name, =20 blk =3D blk_by_name(str); if (!blk) { - BlockDriverState *bs =3D bdrv_lookup_bs(NULL, str, NULL); + bs =3D bdrv_lookup_bs(NULL, str, NULL); if (bs) { /* * If the device supports iothreads, it will make sure to move= the @@ -123,8 +141,7 @@ static void set_drive_helper(Object *obj, Visitor *v, c= onst char *name, * aware of iothreads require their BlockBackends to be in the= main * AioContext. */ - AioContext *ctx =3D iothread ? bdrv_get_aio_context(bs) : - qemu_get_aio_context(); + ctx =3D iothread ? bdrv_get_aio_context(bs) : qemu_get_aio_con= text(); blk =3D blk_new(ctx, 0, BLK_PERM_ALL); blk_created =3D true; =20 @@ -196,6 +213,7 @@ static void release_drive(Object *obj, const char *name= , void *opaque) const PropertyInfo qdev_prop_drive =3D { .name =3D "str", .description =3D "Node name or ID of a block device to use as a backen= d", + .realized_set_allowed =3D true, .get =3D get_drive, .set =3D set_drive, .release =3D release_drive, @@ -204,6 +222,7 @@ const PropertyInfo qdev_prop_drive =3D { const PropertyInfo qdev_prop_drive_iothread =3D { .name =3D "str", .description =3D "Node name or ID of a block device to use as a backen= d", + .realized_set_allowed =3D true, .get =3D get_drive, .set =3D set_drive_iothread, .release =3D release_drive, @@ -238,7 +257,7 @@ static void set_chr(Object *obj, Visitor *v, const char= *name, void *opaque, * TODO Should this really be an error? If no, the old value * needs to be released before we store the new one. */ - if (!check_prop_still_unset(obj, name, be->chr, str, errp)) { + if (!check_prop_still_unset(obj, name, be->chr, str, false, errp)) { return; } =20 @@ -408,7 +427,7 @@ static void set_netdev(Object *obj, Visitor *v, const c= har *name, * TODO Should this really be an error? If no, the old value * needs to be released before we store the new one. */ - if (!check_prop_still_unset(obj, name, ncs[i], str, errp)) { + if (!check_prop_still_unset(obj, name, ncs[i], str, false, errp)) { goto out; } =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795105; cv=pass; d=zohomail.com; s=zohoarc; b=j8/gnUqOMBwtJVJ9qICjUUiCvo3+SpA4NT3JCwmw1t5L5TnZcr1uEUXk5I2xInVJIpEtainjw3WlHK2D3DN0Hq6u3Z6zs4fyJnP1zAQ4H9HKuzeh65vDURlsXdz/jPgQdXVziPxbI6yn3DqMCFV/Yx1wUZaHqq589+u0NAThSBc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795105; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4UWqmIf4AvtJh12xDaKMPwgVVNXOvucUFiqwK3tqziM=; b=RUc4YMGBbH+L/N3Nx7niIi3aaSTsosx0BE4Fv681ifgdpYxGl/0VuoUwh0QrrZCAEhm9CoUi0qYN9JYgk51ZBqhr415OujsKJ/RqRo/ff94lvMAW/bOWLruegv2tbSCplnHOGOFhX8hDl7bzk9ivTu1gtTFPDXsFA//aO79U5so= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16297951057121022.9626186118688; Tue, 24 Aug 2021 01:51:45 -0700 (PDT) Received: from localhost ([::1]:60988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS9o-0004VW-G1 for importer@patchew.org; Tue, 24 Aug 2021 04:51:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyC-0002Y1-J3; Tue, 24 Aug 2021 04:39:44 -0400 Received: from mail-eopbgr130120.outbound.protection.outlook.com ([40.107.13.120]:56386 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy8-0007HX-4p; Tue, 24 Aug 2021 04:39:42 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB6533.eurprd08.prod.outlook.com (2603:10a6:20b:33e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:24 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:24 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=REVJOfBj4SrfGIVUtj0u8w84Y4CJhj9TQj21lkb4K+3TDjhx6o6OFvBmMRYf9UyugsdCX4sDMv6/+YIAXUn2tWcnj/KtpoF0wVVCXOoqv79pcCIfuNPyW0Mmy32R7jrRkWy+03Fy+Z8NbPbjTUKpRJ8SALV9lmP7U52bgZFCa/fGwJ0q0p0RcnF3d15NWseVN4mBVeG7X5M2ELXWkJyUfnVsP61cZ+emJE/oFkK+xCsif9KJcNixbtKrs3B/l8eSA5+6kKGheIXxRoo/HV8zSZIZaUvUJB69PE2n2fhdATht5IeP427kB6ew8rRxUQLpijsVSndCz0cNyRNedfZY9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4UWqmIf4AvtJh12xDaKMPwgVVNXOvucUFiqwK3tqziM=; b=NdAx6klMscX92UAwcrYbVKuRppFNeuDWuH6eG1M1UN3oKE97WVC7QE+3RPNlNU7R8OvcaCwa8zDzOBXGdqhVVVjh2KRbWy3PwX9WY1rlDO7+mqVFZZ8oQfsX8RpwvEt00DwN+RXpn7tiYg5tos9mC1tXNUM6AdbpW6kPeOVjYXdw4ZMO1U4idqymMOi3DpyufTdGVuiNZNSM/ILFfWV6y9toSnxsckQkrxUzO5+AoHnbSeBSQfnMmUsCAEdCrphzVaPDsb4Bz7M2txOGr92FGVyO6tjCjpBjsnRvgdCKTaBg4rgad/Ud3AYIaYullfBzjxOrF2mwqg/QRErO46Qu3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4UWqmIf4AvtJh12xDaKMPwgVVNXOvucUFiqwK3tqziM=; b=obvsJBnsuIwH6eWxWfCj9pyNpirkj+t6bUuKpsuuM4gDST/QbTvGjTrqPtBD792K4UDN7MohgbOLpUVYBv/9XMuFyvnZ8Wy8+KIotoYsFw3NkqEtNvZskbQTymg3DznnCC8LDLRv/EXmnUVQKcy/6gxQMCKOW/6fL5XHWKz7EW4= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 05/34] block: rename backup-top to copy-before-write Date: Tue, 24 Aug 2021 11:38:27 +0300 Message-Id: <20210824083856.17408-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 043e2fb3-ccc6-4a70-6b9e-08d966daad12 X-MS-TrafficTypeDiagnostic: AS8PR08MB6533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: et0an93fjc93VNELMEZTCFGhfaCyEBPT3m0I5Aq+zTnBjQ8NX+S4WgkYLCCbmIjyL7n5zKMcyg+GdcKWA3/lcIezIH3Ow6MdXk8Ktx84r3s3Gj1zfUrOR7qgiEGvZW9It+6FDWwTSCK0nwWaDJ36JDwOsXESHDAvr1uqNOo39eaSkue+gn8KT3QctD+VQTIB4RLtdgefdB9KMnGh+Mi8PlvUAPUf18HLZU4snRCcF/Y7oTwglyqUfAlkrdh8rGV5jStaXnEY2Gg9LBhjCEAm90p6Bz68dMxBWTZUxVitiizPxhKWwIsgrg4R6fq3fB9/7gVeyde/i7r/VbMvIQisTQavAMZOi4zcuAGltyybOaPNbIsCBPVQ/CGvbiE/G/UUPdWfmffd6XFi3LDlEnO3RgBHdTavOUtjdRaJSpAjxRbuCed25P2loU/TKZnA00vrdqgI76EgSnUzENJIA2xxw1KE1k+rMQiTdzPlqJsyTZ+MHqEZcaevfmzhSfu3I8gDVZGcBr+x7lHjeTGIm7uQOv0xsbwyCE591JWcFDKK4dJ+FlyBHQrdKQsLOPaD0CsVSQ4/PcUhIgmNwMmoh/xx/j+f2GxN9JgA9xdRsyS5ONvTnRalI5WprA6kSx9Avvw5BsmQ2xprRhzpKxrgteptSqFq4HwbHybzk1k45/ImvlFbLiKZZ2K8utVl4bHJMp20A29fx7qwbFfjk0imdDYCo3w0ImvN3Py91JjlOsPNzvNT6SbIc15QTXSiNVuAuozJ0XPu0bw3HARCXdz61fegPw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(376002)(136003)(39830400003)(346002)(316002)(83380400001)(86362001)(36756003)(4326008)(6512007)(186003)(6486002)(478600001)(1076003)(6506007)(26005)(38100700002)(30864003)(38350700002)(7416002)(52116002)(6916009)(2616005)(8676002)(66476007)(2906002)(5660300002)(66556008)(956004)(8936002)(66946007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MlZOYXZ2S1NzamRGS3BtVDg4ZnRUVE9adjVhb3l0a0lnNit5OG85Zm96SFFI?= =?utf-8?B?NmxYWDl5b09pQlk0bXdEbHVoaG9OOHNQSWJicFMzZ2UvWVBrcGRYZ09GMzEz?= =?utf-8?B?R2NySUp1NzRkU2Nlcm9nNVc5YWFjVHh1SVVkWi9DNDFRTFNwaWJOOUJWSGln?= =?utf-8?B?OStDZnlWVTF6V204MzFSQmxhYXV6SzUzWjBlclRGVStUMmV3b2Z2VXY5cEVs?= =?utf-8?B?ZEswY2VHbUFnTEc0WHRzM0ZuS3lVMllXaGxiOHBhbTZ0TDI5MGxtVk5NVXow?= =?utf-8?B?T2JKWjFKYnZ0a2xwOW5XQ1R0QkVsWEh5V01qZi9UandoM3czYzEybnRIWCtV?= =?utf-8?B?a2JzcXVIa2JWcGxPUEYxRWhmSG4yQmlzRk5COUh3SHlQZEo0NWI2R2hpZzJs?= =?utf-8?B?U1VYdVd0YWJaQThwbm5CTUxGaW1vUExWaHRvT0IxYi9qYWY0d3JrVWRTVEJs?= =?utf-8?B?ZzVqbVpVQ2RDenBLT3JQTmtzWnZjN2ZweEF2WDVVcTNLakI1MTlJSzF2NXMr?= =?utf-8?B?Q3FFbHROSGlmbnZ1Q1RoRW9NTnlWdkkyRXQ3NkM3VGFraGdheE0wSjNLZGdy?= =?utf-8?B?bklQelM2cmFLMzVhOWlDK0FMVUQ3R1ZScnN1QURHc1BpKzJNc243b0FpR1h6?= =?utf-8?B?bVQ4b1ZIbEFSeGV4aTlEYU9DM1QxT0pSTlVIVVcrOWQrY3RqUlhwYjZlYWFy?= =?utf-8?B?aHF0UmdBaXBiL2ptUzRuWFJDOFk2ZUJ1ZUNqWXpINkFDeHhGdXpkZjg4dUtr?= =?utf-8?B?enBVbEVGVEJMcVJsK056R0t2SzR0SzdJSUttS25ySkQ4V204SXhUV25rZnF6?= =?utf-8?B?bmFQMTN6aFdzSHpTTUFsa3RaNDNQdFB3WldDT1Z0alFGTlhyMGJlOFVnNU0w?= =?utf-8?B?QU55aHB1QmJOcHVCSTh6bmdrNS9aeDZ0QUJPUmJSeUxZMGhFeVZnK3Q2Q051?= =?utf-8?B?ZlNXZ01wcnBOWUtEZFNzZnBrWjhRVXBoclQ0NG1lZXIrd01tOVNSMmVRMThs?= =?utf-8?B?TnRLQmRXQlhRY2t3NkU2ekcvVXR5L0ZTYTFHU2NXNlhPdnpVYklrYmFkTFFo?= =?utf-8?B?enIySjFDQzF6eUY3VFZGWW5iTlN5bm9TOWhsU3FsRzh4NTlpTDJ1ZEVLSmRm?= =?utf-8?B?UzF4d3ZycDlRc3hyZVBnZTNvQVFUZ0dKN3hwYUxmZm1NMnRRMDJOMTRneklq?= =?utf-8?B?NEpnVFV1TU02VEpxK2cySzhyL3hKRFZnSm5lQXIxRHFPVnpOTzl2M2ZIT0ZQ?= =?utf-8?B?dVZyeisxeUVMUUtrVTk3UGE5dVFhWi9mTU80Y242ejBVZ3psTzcyM2VPTmpZ?= =?utf-8?B?L0tHTW5mV2MrQVFSL3JobTh1dE1rUXVxeEhaK0dQNndla2cvL0x0cUdkeS9z?= =?utf-8?B?VDREQm9ETjdVdmtoRFRSUUpoVVB5b0RMWWJqNll2YWVqYm9sd3VUREpMQmZP?= =?utf-8?B?R2dvMEl4cERML2JtWVVEaEVBcmdteHBFN1RRNXBjT1Flc2hLUUM3eTYyL1Jv?= =?utf-8?B?K2FMa3hibWU3c283T0lCbkhEK0o1MmhndGxBcHh5MTlIbVZwenExeXlvNUdR?= =?utf-8?B?VjBqZnllbEF2anZmUVZOOXZMZ3JUQVJrcXdWOGh5dmx3SzU3R0h6QWV1UVYz?= =?utf-8?B?TjZKOHJwZnd2dzZDUnlWNDBha0VvWXpKbkZtcnFMUnk2TERJbEJnQlpEMjV3?= =?utf-8?B?ejFYNkZQU1g1dGxYcThMaEdZL2lPRmdqenl1ZnJsK1JlbXVXZXVPdGFiNHFl?= =?utf-8?Q?RuXlxane9HEi8FX9PssMuPIr0zyK4T8FdSLS0/8?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 043e2fb3-ccc6-4a70-6b9e-08d966daad12 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:24.4455 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /sGFsXjzaHqs/J7IMjxShqVNkgXQ967ubD5GW92FJbN1xgzqiQWl5vR/tLpY3A1pdu/gnlPawDNvUCT0VlHYM1viLC20FL6Yem/HBPVz3RU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6533 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.120; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795106308100002 We are going to convert backup_top to full featured public filter, which can be used in separate of backup job. Start from renaming from "how it used" to "what it does". While updating comments in 283 iotest, drop and rephrase also things about ".active", as this field is now dropped, and filter doesn't have "inactive" mode. Note that this change may be considered as incompatible interface change, as backup-top filter format name was visible through query-block and query-named-block-nodes. Still, consider the following reasoning: 1. backup-top was never documented, so if someone depends on format name (for driver that can't be used other than it is automatically inserted on backup job start), it's a kind of "undocumented feature use". So I think we are free to change it. 2. There is a hope, that there is no such users: it's a lot more native to give a good node-name to backup-top filter if need to operate with it somehow, and don't touch format name. 3. Another "incompatible" change in further commit would be moving copy-before-write filter from using backing child to file child. And this is even more reasonable than renaming: for now all public filters are file-child based. So, it's a risky change, but risk seems small and good interface worth it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/{backup-top.h =3D> copy-before-write.h} | 28 +++--- block/backup.c | 22 ++--- block/{backup-top.c =3D> copy-before-write.c} | 100 ++++++++++---------- MAINTAINERS | 4 +- block/meson.build | 2 +- tests/qemu-iotests/283 | 35 +++---- tests/qemu-iotests/283.out | 4 +- 7 files changed, 95 insertions(+), 100 deletions(-) rename block/{backup-top.h =3D> copy-before-write.h} (56%) rename block/{backup-top.c =3D> copy-before-write.c} (62%) diff --git a/block/backup-top.h b/block/copy-before-write.h similarity index 56% rename from block/backup-top.h rename to block/copy-before-write.h index b28b0031c4..5977b7aa31 100644 --- a/block/backup-top.h +++ b/block/copy-before-write.h @@ -1,10 +1,10 @@ /* - * backup-top filter driver + * copy-before-write filter driver * * The driver performs Copy-Before-Write (CBW) operation: it is injected a= bove * some node, and before each write it copies _old_ data to the target nod= e. * - * Copyright (c) 2018-2019 Virtuozzo International GmbH. + * Copyright (c) 2018-2021 Virtuozzo International GmbH. * * Author: * Sementsov-Ogievskiy Vladimir @@ -23,20 +23,20 @@ * along with this program. If not, see . */ =20 -#ifndef BACKUP_TOP_H -#define BACKUP_TOP_H +#ifndef COPY_BEFORE_WRITE_H +#define COPY_BEFORE_WRITE_H =20 #include "block/block_int.h" #include "block/block-copy.h" =20 -BlockDriverState *bdrv_backup_top_append(BlockDriverState *source, - BlockDriverState *target, - const char *filter_node_name, - uint64_t cluster_size, - BackupPerf *perf, - BdrvRequestFlags write_flags, - BlockCopyState **bcs, - Error **errp); -void bdrv_backup_top_drop(BlockDriverState *bs); +BlockDriverState *bdrv_cbw_append(BlockDriverState *source, + BlockDriverState *target, + const char *filter_node_name, + uint64_t cluster_size, + BackupPerf *perf, + BdrvRequestFlags write_flags, + BlockCopyState **bcs, + Error **errp); +void bdrv_cbw_drop(BlockDriverState *bs); =20 -#endif /* BACKUP_TOP_H */ +#endif /* COPY_BEFORE_WRITE_H */ diff --git a/block/backup.c b/block/backup.c index bd3614ce70..ac91821b08 100644 --- a/block/backup.c +++ b/block/backup.c @@ -27,13 +27,13 @@ #include "qemu/bitmap.h" #include "qemu/error-report.h" =20 -#include "block/backup-top.h" +#include "block/copy-before-write.h" =20 #define BACKUP_CLUSTER_SIZE_DEFAULT (1 << 16) =20 typedef struct BackupBlockJob { BlockJob common; - BlockDriverState *backup_top; + BlockDriverState *cbw; BlockDriverState *source_bs; BlockDriverState *target_bs; =20 @@ -104,7 +104,7 @@ static void backup_clean(Job *job) { BackupBlockJob *s =3D container_of(job, BackupBlockJob, common.job); block_job_remove_all_bdrv(&s->common); - bdrv_backup_top_drop(s->backup_top); + bdrv_cbw_drop(s->cbw); } =20 void backup_do_checkpoint(BlockJob *job, Error **errp) @@ -408,7 +408,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, BackupBlockJob *job =3D NULL; int64_t cluster_size; BdrvRequestFlags write_flags; - BlockDriverState *backup_top =3D NULL; + BlockDriverState *cbw =3D NULL; BlockCopyState *bcs =3D NULL; =20 assert(bs); @@ -521,22 +521,22 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISIN= G : 0) | (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), =20 - backup_top =3D bdrv_backup_top_append(bs, target, filter_node_name, + cbw =3D bdrv_cbw_append(bs, target, filter_node_name, cluster_size, perf, write_flags, &bcs, errp); - if (!backup_top) { + if (!cbw) { goto error; } =20 /* job->len is fixed, so we can't allow resize */ - job =3D block_job_create(job_id, &backup_job_driver, txn, backup_top, + job =3D block_job_create(job_id, &backup_job_driver, txn, cbw, 0, BLK_PERM_ALL, speed, creation_flags, cb, opaque, errp); if (!job) { goto error; } =20 - job->backup_top =3D backup_top; + job->cbw =3D cbw; job->source_bs =3D bs; job->target_bs =3D target; job->on_source_error =3D on_source_error; @@ -552,7 +552,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, block_copy_set_progress_meter(bcs, &job->common.job.progress); block_copy_set_speed(bcs, speed); =20 - /* Required permissions are already taken by backup-top target */ + /* Required permissions are taken by copy-before-write filter target */ block_job_add_bdrv(&job->common, "target", target, 0, BLK_PERM_ALL, &error_abort); =20 @@ -562,8 +562,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, if (sync_bitmap) { bdrv_reclaim_dirty_bitmap(sync_bitmap, NULL); } - if (backup_top) { - bdrv_backup_top_drop(backup_top); + if (cbw) { + bdrv_cbw_drop(cbw); } =20 return NULL; diff --git a/block/backup-top.c b/block/copy-before-write.c similarity index 62% rename from block/backup-top.c rename to block/copy-before-write.c index 425e3778be..0dc5a107cf 100644 --- a/block/backup-top.c +++ b/block/copy-before-write.c @@ -1,10 +1,10 @@ /* - * backup-top filter driver + * copy-before-write filter driver * * The driver performs Copy-Before-Write (CBW) operation: it is injected a= bove * some node, and before each write it copies _old_ data to the target nod= e. * - * Copyright (c) 2018-2019 Virtuozzo International GmbH. + * Copyright (c) 2018-2021 Virtuozzo International GmbH. * * Author: * Sementsov-Ogievskiy Vladimir @@ -32,25 +32,25 @@ #include "block/qdict.h" #include "block/block-copy.h" =20 -#include "block/backup-top.h" +#include "block/copy-before-write.h" =20 -typedef struct BDRVBackupTopState { +typedef struct BDRVCopyBeforeWriteState { BlockCopyState *bcs; BdrvChild *target; int64_t cluster_size; -} BDRVBackupTopState; +} BDRVCopyBeforeWriteState; =20 -static coroutine_fn int backup_top_co_preadv( +static coroutine_fn int cbw_co_preadv( BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); } =20 -static coroutine_fn int backup_top_cbw(BlockDriverState *bs, uint64_t offs= et, - uint64_t bytes, BdrvRequestFlags fl= ags) +static coroutine_fn int cbw_do_copy_before_write(BlockDriverState *bs, + uint64_t offset, uint64_t bytes, BdrvRequestFlags flags) { - BDRVBackupTopState *s =3D bs->opaque; + BDRVCopyBeforeWriteState *s =3D bs->opaque; uint64_t off, end; =20 if (flags & BDRV_REQ_WRITE_UNCHANGED) { @@ -63,10 +63,10 @@ static coroutine_fn int backup_top_cbw(BlockDriverState= *bs, uint64_t offset, return block_copy(s->bcs, off, end - off, true); } =20 -static int coroutine_fn backup_top_co_pdiscard(BlockDriverState *bs, - int64_t offset, int bytes) +static int coroutine_fn cbw_co_pdiscard(BlockDriverState *bs, + int64_t offset, int bytes) { - int ret =3D backup_top_cbw(bs, offset, bytes, 0); + int ret =3D cbw_do_copy_before_write(bs, offset, bytes, 0); if (ret < 0) { return ret; } @@ -74,10 +74,10 @@ static int coroutine_fn backup_top_co_pdiscard(BlockDri= verState *bs, return bdrv_co_pdiscard(bs->backing, offset, bytes); } =20 -static int coroutine_fn backup_top_co_pwrite_zeroes(BlockDriverState *bs, +static int coroutine_fn cbw_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, int bytes, BdrvRequestFlags flags) { - int ret =3D backup_top_cbw(bs, offset, bytes, flags); + int ret =3D cbw_do_copy_before_write(bs, offset, bytes, flags); if (ret < 0) { return ret; } @@ -85,12 +85,12 @@ static int coroutine_fn backup_top_co_pwrite_zeroes(Blo= ckDriverState *bs, return bdrv_co_pwrite_zeroes(bs->backing, offset, bytes, flags); } =20 -static coroutine_fn int backup_top_co_pwritev(BlockDriverState *bs, - uint64_t offset, - uint64_t bytes, - QEMUIOVector *qiov, int flag= s) +static coroutine_fn int cbw_co_pwritev(BlockDriverState *bs, + uint64_t offset, + uint64_t bytes, + QEMUIOVector *qiov, int flags) { - int ret =3D backup_top_cbw(bs, offset, bytes, flags); + int ret =3D cbw_do_copy_before_write(bs, offset, bytes, flags); if (ret < 0) { return ret; } @@ -98,7 +98,7 @@ static coroutine_fn int backup_top_co_pwritev(BlockDriver= State *bs, return bdrv_co_pwritev(bs->backing, offset, bytes, qiov, flags); } =20 -static int coroutine_fn backup_top_co_flush(BlockDriverState *bs) +static int coroutine_fn cbw_co_flush(BlockDriverState *bs) { if (!bs->backing) { return 0; @@ -107,7 +107,7 @@ static int coroutine_fn backup_top_co_flush(BlockDriver= State *bs) return bdrv_co_flush(bs->backing->bs); } =20 -static void backup_top_refresh_filename(BlockDriverState *bs) +static void cbw_refresh_filename(BlockDriverState *bs) { if (bs->backing =3D=3D NULL) { /* @@ -120,11 +120,11 @@ static void backup_top_refresh_filename(BlockDriverSt= ate *bs) bs->backing->bs->filename); } =20 -static void backup_top_child_perm(BlockDriverState *bs, BdrvChild *c, - BdrvChildRole role, - BlockReopenQueue *reopen_queue, - uint64_t perm, uint64_t shared, - uint64_t *nperm, uint64_t *nshared) +static void cbw_child_perm(BlockDriverState *bs, BdrvChild *c, + BdrvChildRole role, + BlockReopenQueue *reopen_queue, + uint64_t perm, uint64_t shared, + uint64_t *nperm, uint64_t *nshared) { if (!(role & BDRV_CHILD_FILTERED)) { /* @@ -149,41 +149,41 @@ static void backup_top_child_perm(BlockDriverState *b= s, BdrvChild *c, } } =20 -BlockDriver bdrv_backup_top_filter =3D { - .format_name =3D "backup-top", - .instance_size =3D sizeof(BDRVBackupTopState), +BlockDriver bdrv_cbw_filter =3D { + .format_name =3D "copy-before-write", + .instance_size =3D sizeof(BDRVCopyBeforeWriteState), =20 - .bdrv_co_preadv =3D backup_top_co_preadv, - .bdrv_co_pwritev =3D backup_top_co_pwritev, - .bdrv_co_pwrite_zeroes =3D backup_top_co_pwrite_zeroes, - .bdrv_co_pdiscard =3D backup_top_co_pdiscard, - .bdrv_co_flush =3D backup_top_co_flush, + .bdrv_co_preadv =3D cbw_co_preadv, + .bdrv_co_pwritev =3D cbw_co_pwritev, + .bdrv_co_pwrite_zeroes =3D cbw_co_pwrite_zeroes, + .bdrv_co_pdiscard =3D cbw_co_pdiscard, + .bdrv_co_flush =3D cbw_co_flush, =20 - .bdrv_refresh_filename =3D backup_top_refresh_filename, + .bdrv_refresh_filename =3D cbw_refresh_filename, =20 - .bdrv_child_perm =3D backup_top_child_perm, + .bdrv_child_perm =3D cbw_child_perm, =20 .is_filter =3D true, }; =20 -BlockDriverState *bdrv_backup_top_append(BlockDriverState *source, - BlockDriverState *target, - const char *filter_node_name, - uint64_t cluster_size, - BackupPerf *perf, - BdrvRequestFlags write_flags, - BlockCopyState **bcs, - Error **errp) +BlockDriverState *bdrv_cbw_append(BlockDriverState *source, + BlockDriverState *target, + const char *filter_node_name, + uint64_t cluster_size, + BackupPerf *perf, + BdrvRequestFlags write_flags, + BlockCopyState **bcs, + Error **errp) { ERRP_GUARD(); int ret; - BDRVBackupTopState *state; + BDRVCopyBeforeWriteState *state; BlockDriverState *top; bool appended =3D false; =20 assert(source->total_sectors =3D=3D target->total_sectors); =20 - top =3D bdrv_new_open_driver(&bdrv_backup_top_filter, filter_node_name, + top =3D bdrv_new_open_driver(&bdrv_cbw_filter, filter_node_name, BDRV_O_RDWR, errp); if (!top) { return NULL; @@ -210,7 +210,7 @@ BlockDriverState *bdrv_backup_top_append(BlockDriverSta= te *source, =20 ret =3D bdrv_append(top, source, errp); if (ret < 0) { - error_prepend(errp, "Cannot append backup-top filter: "); + error_prepend(errp, "Cannot append copy-before-write filter: "); goto fail; } appended =3D true; @@ -231,7 +231,7 @@ BlockDriverState *bdrv_backup_top_append(BlockDriverSta= te *source, =20 fail: if (appended) { - bdrv_backup_top_drop(top); + bdrv_cbw_drop(top); } else { bdrv_unref(top); } @@ -241,9 +241,9 @@ fail: return NULL; } =20 -void bdrv_backup_top_drop(BlockDriverState *bs) +void bdrv_cbw_drop(BlockDriverState *bs) { - BDRVBackupTopState *s =3D bs->opaque; + BDRVCopyBeforeWriteState *s =3D bs->opaque; =20 bdrv_drop_filter(bs, &error_abort); =20 diff --git a/MAINTAINERS b/MAINTAINERS index 6b3697962c..ece044bd25 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2337,8 +2337,8 @@ F: block/mirror.c F: qapi/job.json F: block/block-copy.c F: include/block/block-copy.c -F: block/backup-top.h -F: block/backup-top.c +F: block/copy-before-write.h +F: block/copy-before-write.c F: include/block/aio_task.h F: block/aio_task.c F: util/qemu-co-shared-resource.c diff --git a/block/meson.build b/block/meson.build index 0450914c7a..66ee11e62c 100644 --- a/block/meson.build +++ b/block/meson.build @@ -4,7 +4,7 @@ block_ss.add(files( 'aio_task.c', 'amend.c', 'backup.c', - 'backup-top.c', + 'copy-before-write.c', 'blkdebug.c', 'blklogwrites.c', 'blkverify.c', diff --git a/tests/qemu-iotests/283 b/tests/qemu-iotests/283 index 010c22f0a2..a09e0183ae 100755 --- a/tests/qemu-iotests/283 +++ b/tests/qemu-iotests/283 @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # group: auto quick # -# Test for backup-top filter permission activation failure +# Test for copy-before-write filter permission conflict # # Copyright (c) 2019 Virtuozzo International GmbH. # @@ -31,13 +31,13 @@ size =3D 1024 * 1024 """ Test description =20 When performing a backup, all writes on the source subtree must go through= the -backup-top filter so it can copy all data to the target before it is chang= ed. -backup-top filter is appended above source node, to achieve this thing, so= all -parents of source node are handled. A configuration with side parents of s= ource -sub-tree with write permission is unsupported (we'd have append several -backup-top filter like nodes to handle such parents). The test create an -example of such configuration and checks that a backup is then not allowed -(blockdev-backup command should fail). +copy-before-write filter so it can copy all data to the target before it is +changed. copy-before-write filter is appended above source node, to achie= ve +this thing, so all parents of source node are handled. A configuration with +side parents of source sub-tree with write permission is unsupported (we'd= have +append several copy-before-write filter like nodes to handle such parents)= . The +test create an example of such configuration and checks that a backup is t= hen +not allowed (blockdev-backup command should fail). =20 The configuration: =20 @@ -57,11 +57,10 @@ The configuration: =E2=94=82 base =E2=94=82 =E2=97=80=E2=94=80= =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80 =E2=94=82 other =E2=94=82 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94= =80=E2=94=98 =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2= =94=80=E2=94=80=E2=94=80=E2=94=98 =20 -On activation (see .active field of backup-top state in block/backup-top.c= ), -backup-top is going to unshare write permission on its source child. Write -unsharing will be propagated to the "source->base" link and will conflict = with -other node write permission. So permission update will fail and backup job= will -not be started. +copy-before-write filter wants to unshare write permission on its source c= hild. +Write unsharing will be propagated to the "source->base" link and will con= flict +with other node write permission. So permission update will fail and backu= p job +will not be started. =20 Note, that the only thing which prevents backup of running on such configuration is default permission propagation scheme. It may be altered = by @@ -99,13 +98,9 @@ vm.qmp_log('blockdev-backup', sync=3D'full', device=3D's= ource', target=3D'target') vm.shutdown() =20 =20 -print('\n=3D=3D=3D backup-top should be gone after job-finalize =3D=3D=3D\= n') +print('\n=3D=3D=3D copy-before-write filter should be gone after job-final= ize =3D=3D=3D\n') =20 -# Check that the backup-top node is gone after job-finalize. -# -# During finalization, the node becomes inactive and can no longer -# function. If it is still present, new parents might be attached, and -# there would be no meaningful way to handle their I/O requests. +# Check that the copy-before-write node is gone after job-finalize. =20 vm =3D iotests.VM() vm.launch() @@ -131,7 +126,7 @@ vm.qmp_log('blockdev-backup', =20 vm.event_wait('BLOCK_JOB_PENDING', 5.0) =20 -# The backup-top filter should still be present prior to finalization +# The copy-before-write filter should still be present prior to finalizati= on assert vm.node_info('backup-filter') is not None =20 vm.qmp_log('job-finalize', id=3D'backup') diff --git a/tests/qemu-iotests/283.out b/tests/qemu-iotests/283.out index c6e12b15c5..f2b7219632 100644 --- a/tests/qemu-iotests/283.out +++ b/tests/qemu-iotests/283.out @@ -5,9 +5,9 @@ {"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": "= base", "node-name": "other", "take-child-perms": ["write"]}} {"return": {}} {"execute": "blockdev-backup", "arguments": {"device": "source", "sync": "= full", "target": "target"}} -{"error": {"class": "GenericError", "desc": "Cannot append backup-top filt= er: Permission conflict on node 'base': permissions 'write' are both requir= ed by node 'other' (uses node 'base' as 'image' child) and unshared by node= 'source' (uses node 'base' as 'image' child)."}} +{"error": {"class": "GenericError", "desc": "Cannot append copy-before-wri= te filter: Permission conflict on node 'base': permissions 'write' are both= required by node 'other' (uses node 'base' as 'image' child) and unshared = by node 'source' (uses node 'base' as 'image' child)."}} =20 -=3D=3D=3D backup-top should be gone after job-finalize =3D=3D=3D +=3D=3D=3D copy-before-write filter should be gone after job-finalize =3D= =3D=3D =20 {"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name"= : "source"}} {"return": {}} --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794500; cv=pass; d=zohomail.com; s=zohoarc; b=Mf4C4xVofkNM76zlw8AqNoqxfiEBBr11BiSi6b0+easoKF60KJKwRven0vFLzQ5GP8fq+SmeclCK7JmadntGzm5wZDpzn4sSzzQwxls8E6fDDItjKMFfQdc26BkhSo/hbVT1KFUSLK/GGzmRcM4gPjOho/QYRHdCE40NhhonGEk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794500; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LGFsR28a9SvCr+P+ded0x8efbgfwajDijpO2fyun2f8=; b=dMnEJVObzpypmUMVkCu+kLgdYfb8uD6nGbmJcTD1oS+NgTdsPaWDLAtwxItimRo6CfYKKwi54Yl6mWxDdhaP/6ZccbChUx+sPBhjr4flU81xmgi+7fOefe7jYq67eo1WTYTLT1+EwrU9KoTgBpSxMRbqeK7M0A2F7bHVa6hSWec= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794500370521.0542331334175; Tue, 24 Aug 2021 01:41:40 -0700 (PDT) Received: from localhost ([::1]:54638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS03-0006a6-67 for importer@patchew.org; Tue, 24 Aug 2021 04:41:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy1-0002QI-EK; Tue, 24 Aug 2021 04:39:34 -0400 Received: from mail-eopbgr70101.outbound.protection.outlook.com ([40.107.7.101]:20612 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRxx-0007OJ-Pq; Tue, 24 Aug 2021 04:39:33 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0801MB1780.eurprd08.prod.outlook.com (2603:10a6:203:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:25 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:25 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oDiH8hMjO98xbgFDuIkkK0A/vlknoTt2hhqfhgaGJZ592kh9SNOOFtCjjW2mIfyTk6fyFuq+grNhEFx6NLxQK4Gipl43P2XS9kqYkjpN0Aqw+2T2BCPat8O+7K+yAyIgjqe69Qp/nebKSKvUHpyMwdKlVWeW6nkGqOlgfLzCLT5QpfJ+Cgt9EwUHXZOg29/EBzx8AokIzgqOBnsAoXuIhT/i10kBkX+fRGr0DIurgRYYwvzTujeWh3wG/qUEUyLusEhgwih0S1k0qcsT6lr/Ui6Wrn20riVgFnSEsliydi+tgtP0ZQwc3s2jJviCR36iWNMrvzmWbi5hOAZ8+NU/8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LGFsR28a9SvCr+P+ded0x8efbgfwajDijpO2fyun2f8=; b=FOlEgqThbMw0fs+tiYuayhNU6pVbxwsTW/+Tt+0AxGalOXRit/uNRNtay43hTL0KAfSWa2zUffqZPWsCWlQoLUMxHUiSKfmtFZuXyE2lUFfc1CxNgvdwuUNt0Mr4Rz6FvhPn74boXnQxhTGBMyL3BdA1ytrtRgz75b8zqBjv3L0f2xgBIxa2NnLGJ4UaYVQ4fYNRdkpkCCpaKHhidfJvdi9KeD+OiVbOASDClw7iPhh53FpX2VvZlgUWhlhRbm9ARDWDO8yTHqAsMStK6q0y/e3FrSnprbcL37TyD+K0JM1g5MOMxkHyFA6DNfhsYFtFwxRnys9coaIcIvxBhQuOBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LGFsR28a9SvCr+P+ded0x8efbgfwajDijpO2fyun2f8=; b=HmTZMe27t0w+gQobIWKivhRXczA4x109kbYdYUrniPUE/lODx1kyojcWTJ2R2C18qPeDdKJ6coACWk0fugvhtqI7yWyulCtlLsHn1AqhrsFUpDou+4o5uu67xFPhr5j1UvOxjpmZpWbJDZYgMyr6IRdKXCsqDn2zYKCZwctOHsI= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 06/34] block-copy: move detecting fleecing scheme to block-copy Date: Tue, 24 Aug 2021 11:38:28 +0300 Message-Id: <20210824083856.17408-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd152022-a0a5-43c8-db9b-08d966daadee X-MS-TrafficTypeDiagnostic: AM5PR0801MB1780: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:53; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: utY6Uvb7bbY7n0JE2/L49BgyWAAVWnkFbXNPPmzkrwmIKJBuaWGt0rP3Mmc0/+snxBWS4tAdMZySIA8nyW6gJqNIBil3T68D2NTgYlE4aUv/+vWlkddl0SXEefV675QZmyo7/bLm/m2H+wJN5+WjWwiaFHyRuJPygHu4j4KimNaYKvikFbzjFTqbXFpXmBrj6frWrh0O1KmuJzPEdhsuMxYrioro8gcq6kosEpQRcFVhTAcUWCOeqmygLEDY5me7MtBjHGvM3irYdYhTwDVnVRaAHhKf5Sq/0mTv5b0bDzpUMr/4MAdYF8kxqn7jkwYIKys/MN94+pZaiaihcUcTxUNIxNXIPQy08VtIpW9lFPIkzMU6km2FFWpo3tD1rkA36y2GoMNXuy7WLOv6ZhRToRsLAk3iv1Ryc3X3X99prq++6KoKBuZlqPntCylxeDwNgzZk/nx34z4UwcKfOoSaHoaA929EhCk1XBaqKCvZ2XFX4cJXk1//470C2mfwqGPVwPrGGdbPEWCcuCfd0NKay+HnuQj5oGwygbqFTHL4u0Z8hGidTzsNyUgoycYdRmoC/EHBli81+5D0sb7rcFVlrjI1k3vtOlT+coSSGmKLCLd/wjrtOTr5tchtJt4a9uxarGLKACi/ePROQfVJF5p3QySkbalMeDijQwljd+4VTX6Qw0xALB80y5n0e3NcJn9WzqGtphvaRzqPW5F43uDddA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6512007)(83380400001)(4326008)(66556008)(66476007)(186003)(86362001)(38100700002)(38350700002)(36756003)(316002)(7416002)(478600001)(1076003)(52116002)(8676002)(2906002)(26005)(66946007)(2616005)(956004)(5660300002)(6486002)(6916009)(6506007)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jczJwBQlIRJXzPYycMnrv/QDTK+vbo2lQznnd/1CW2tIWEd6AcmhyJlqU976?= =?us-ascii?Q?j2qyK23Un8VdLus7VP9hb5x7IP9gycv3reGHQHNqlZG3SayUhUrQ7GjpTklF?= =?us-ascii?Q?8AoNN+n4UQkYDDc4pk4jU1DkbJZWIRPVmayTHNaYEqqpF/Yz0HFLiYcddNZv?= =?us-ascii?Q?SvFZflwGtfzW0p+Khen/wnLX1r/7cu1z4Sr84REb9QTVLgxRmP/cMxRlY3/b?= =?us-ascii?Q?wK4dFw0oUEj1xr4CwKjNoLpHOmoD/VrGYEqqyTlaA0MiE3z5vCVQNxn+58UR?= =?us-ascii?Q?1fIm3+mP5aHXpWE5xUSImWJ7nVKqxqmUfSeKanb598dqSJSEHBXX3IEvupH7?= =?us-ascii?Q?+//y+Ga5pZHrf7MZIOFG8pBxeZH2XMvaPKtNE7DRG2140d5qbWhwdV6XxLQo?= =?us-ascii?Q?xFoyFR9J1ZG7ayFH8LEotXOxCY+U/8/GcG0386DolF1gSzFGliLvNZ2kIw/z?= =?us-ascii?Q?/Y+9dhK4o2mYXqC+VeMFLKjhdnCRxzaS61Y1b8quJz80txMwSSn+hHRqhKTw?= =?us-ascii?Q?+p0R00ck/F2BTyXI48dhfY9JnzO/T1L2zVBmvERJk+B4nWy6QMOnxgu1IX5L?= =?us-ascii?Q?d4zC2zg1ek5xjQZkrZDWdZbuXd3kwkt2BGkOZOyhojczic4fYbhMIWtyAZD8?= =?us-ascii?Q?qoAGR1Rn3HzPWonwkVbjmrWDEwOGFqyzHslN20gJZxV05BPtPBIBOF7MNVjm?= =?us-ascii?Q?8UPZCZtikOH7ZngVz5tsI1cvEjkcOv0wwKhFQ3dCa7GUNHZzgM4fjHMUbPyt?= =?us-ascii?Q?SK1qzsje03ukapD8g7tg9x9jRFHCkSfIBRIEpiGOHHoR7rdu5PDoItxmi7z1?= =?us-ascii?Q?CosfwIyYXJIDPFxkLQirPOaQOBx4z1tRPr+6LYUVbJt17uY/iB09vkNtS+1M?= =?us-ascii?Q?dtW0E0PfokYUdzqsa/bQ8tpTanVuwUZ7Dj8qQwsHRL82zaGf7I6TvTgtbQ5j?= =?us-ascii?Q?acnhkuwfScfvFMQd74qnIGMKKNkLZiJDn0Vxc/HV0ZFr+8dJ2ghQ10X+Lqim?= =?us-ascii?Q?zLim9uZjpY49Giz+XHtambR4t388TwCoqd/RvTZ1IyGh+op5NWAlEg7+g+gK?= =?us-ascii?Q?swS1UA4U10Uum7JjOOcOLsVrInjBTE2EprvcF7y5Ypp97Xs5OfgElrBpDG8v?= =?us-ascii?Q?UArDWO+y3C7kUKHkvPXQxdZqbzpLpt9/t6hpgPJnOtWKwTQoN2HlNbDGGkj5?= =?us-ascii?Q?WfZvYhCs9aGqodoa1gGlq0AsxoGBeYROyyKQm9SOaACA2OUTEf3LphOJI+mK?= =?us-ascii?Q?CpdcBZdE2HqmVvXpiBjl/YLLC4YrSYfiM3N2aFIURJPk/zNe7HfEcWd5qLGK?= =?us-ascii?Q?ZCeED9iFRkIAkbawPFMQ+7pk?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd152022-a0a5-43c8-db9b-08d966daadee X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:25.7846 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QMtd74pfeeWFjLpEv6T6a4+RPlinYKH3cfhVjwl9YDhgRkcjOvNZEGdF+Rhv8yFGTOQzHTNuPC40KUkhB7vST2gNaVToVXn1JHBXayp/qJk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1780 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.101; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794502358100001 Content-Type: text/plain; charset="utf-8" We want to simplify initialization interface of copy-before-write filter as we are going to make it public. So, let's detect fleecing scheme exactly in block-copy code, to not pass this information through extra levels. Why not just set BDRV_REQ_SERIALISING unconditionally: because we are going to implement new more efficient fleecing scheme which will not rely on backing feature. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.h | 2 +- include/block/block-copy.h | 3 +-- block/backup.c | 21 +-------------------- block/block-copy.c | 24 +++++++++++++++++++++--- block/copy-before-write.c | 4 ++-- 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index 5977b7aa31..f37e2249ae 100644 --- a/block/copy-before-write.h +++ b/block/copy-before-write.h @@ -34,7 +34,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sourc= e, const char *filter_node_name, uint64_t cluster_size, BackupPerf *perf, - BdrvRequestFlags write_flags, + bool compress, BlockCopyState **bcs, Error **errp); void bdrv_cbw_drop(BlockDriverState *bs); diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 5c8278895c..734389d32a 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -26,8 +26,7 @@ typedef struct BlockCopyCallState BlockCopyCallState; =20 BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, int64_t cluster_size, bool use_copy_r= ange, - BdrvRequestFlags write_flags, - Error **errp); + bool compress, Error **errp); =20 void block_copy_set_progress_meter(BlockCopyState *s, ProgressMeter *pm); =20 diff --git a/block/backup.c b/block/backup.c index ac91821b08..84f9a5f02c 100644 --- a/block/backup.c +++ b/block/backup.c @@ -407,7 +407,6 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, int64_t len, target_len; BackupBlockJob *job =3D NULL; int64_t cluster_size; - BdrvRequestFlags write_flags; BlockDriverState *cbw =3D NULL; BlockCopyState *bcs =3D NULL; =20 @@ -504,26 +503,8 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, goto error; } =20 - /* - * If source is in backing chain of target assume that target is going= to be - * used for "image fleecing", i.e. it should represent a kind of snaps= hot of - * source at backup-start point in time. And target is going to be rea= d by - * somebody (for example, used as NBD export) during backup job. - * - * In this case, we need to add BDRV_REQ_SERIALISING write flag to avo= id - * intersection of backup writes and third party reads from target, - * otherwise reading from target we may occasionally read already upda= ted by - * guest data. - * - * For more information see commit f8d59dfb40bb and test - * tests/qemu-iotests/222 - */ - write_flags =3D (bdrv_chain_contains(target, bs) ? BDRV_REQ_SERIALISIN= G : 0) | - (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), - cbw =3D bdrv_cbw_append(bs, target, filter_node_name, - cluster_size, perf, - write_flags, &bcs, errp); + cluster_size, perf, compress, &bcs, errp); if (!cbw) { goto error; } diff --git a/block/block-copy.c b/block/block-copy.c index 0becad52da..58b4345a5a 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -317,10 +317,11 @@ static uint32_t block_copy_max_transfer(BdrvChild *so= urce, BdrvChild *target) =20 BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, int64_t cluster_size, bool use_copy_r= ange, - BdrvRequestFlags write_flags, Error *= *errp) + bool compress, Error **errp) { BlockCopyState *s; BdrvDirtyBitmap *copy_bitmap; + bool is_fleecing; =20 copy_bitmap =3D bdrv_create_dirty_bitmap(source->bs, cluster_size, NUL= L, errp); @@ -329,6 +330,22 @@ BlockCopyState *block_copy_state_new(BdrvChild *source= , BdrvChild *target, } bdrv_disable_dirty_bitmap(copy_bitmap); =20 + /* + * If source is in backing chain of target assume that target is going= to be + * used for "image fleecing", i.e. it should represent a kind of snaps= hot of + * source at backup-start point in time. And target is going to be rea= d by + * somebody (for example, used as NBD export) during backup job. + * + * In this case, we need to add BDRV_REQ_SERIALISING write flag to avo= id + * intersection of backup writes and third party reads from target, + * otherwise reading from target we may occasionally read already upda= ted by + * guest data. + * + * For more information see commit f8d59dfb40bb and test + * tests/qemu-iotests/222 + */ + is_fleecing =3D bdrv_chain_contains(target->bs, source->bs); + s =3D g_new(BlockCopyState, 1); *s =3D (BlockCopyState) { .source =3D source, @@ -336,7 +353,8 @@ BlockCopyState *block_copy_state_new(BdrvChild *source,= BdrvChild *target, .copy_bitmap =3D copy_bitmap, .cluster_size =3D cluster_size, .len =3D bdrv_dirty_bitmap_size(copy_bitmap), - .write_flags =3D write_flags, + .write_flags =3D (is_fleecing ? BDRV_REQ_SERIALISING : 0) | + (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), .mem =3D shres_create(BLOCK_COPY_MAX_MEM), .max_transfer =3D QEMU_ALIGN_DOWN( block_copy_max_transfer(source, target= ), @@ -351,7 +369,7 @@ BlockCopyState *block_copy_state_new(BdrvChild *source,= BdrvChild *target, * behalf). */ s->method =3D COPY_READ_WRITE_CLUSTER; - } else if (write_flags & BDRV_REQ_WRITE_COMPRESSED) { + } else if (compress) { /* Compression supports only cluster-size writes and no copy-range= . */ s->method =3D COPY_READ_WRITE_CLUSTER; } else { diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 0dc5a107cf..4337076c1c 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -171,7 +171,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, const char *filter_node_name, uint64_t cluster_size, BackupPerf *perf, - BdrvRequestFlags write_flags, + bool compress, BlockCopyState **bcs, Error **errp) { @@ -218,7 +218,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, state->cluster_size =3D cluster_size; state->bcs =3D block_copy_state_new(top->backing, state->target, cluster_size, perf->use_copy_range, - write_flags, errp); + compress, errp); if (!state->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); goto fail; --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794640; cv=pass; d=zohomail.com; s=zohoarc; b=HaW1D8JQAQHbL946oDapSPKvjN4qyULjQ4tzlKDgFD8H9MP8cekmS83ssk/NusEoQ4IYWzSQ/wr2M7V8+R/V/FoFFbbIUkFVn+xA82TCGgIqfvsqUn1eE1lGXUvMMO5okO42sfyzuAwPrKiAvC36HCxOtwEYoHyVP51M0WUCWck= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794640; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xj4QwWVEAI0SFQXolIGfYTJdaECXiNjdZSmeNhl3FKo=; b=HrPyCQCs+oMMBrJHGzGR8vcj/0XtuugVeOqvpBY+EXiD4Dqisq6wB+VslHDtR0SVsrBj3DYlbd8NtqJQ0ixT6RpwNGWBjXC8QY0/9F2rcz8dxqOVQj5mXhpfuqgHqEvGgzj5c7m8gfHfEaVhbrBiAZh0xHEv16ck0L+vb0wl/9E= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794640285538.8008845210472; Tue, 24 Aug 2021 01:44:00 -0700 (PDT) Received: from localhost ([::1]:34958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS2I-0003p5-Mg for importer@patchew.org; Tue, 24 Aug 2021 04:43:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy3-0002RO-T8; Tue, 24 Aug 2021 04:39:36 -0400 Received: from mail-eopbgr70101.outbound.protection.outlook.com ([40.107.7.101]:20612 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy2-0007OJ-43; Tue, 24 Aug 2021 04:39:35 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0801MB1780.eurprd08.prod.outlook.com (2603:10a6:203:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:27 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:27 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gAwAbZ3i7whHUPVbQXfsa6Gs3sdi3wZO4aa6J0fmQozQLdOg1iUZPYA9XoMacjXT1oMts5TKKaaHcvV71kvaeCn5OYR0Fi50LGIuiScbciSHFYeXL/Z2dMg5JfS5fbwg/ErfKhTDBCd+KO02KGeGvqD2y5AIO7XstSZWyAn0Z3JgtJ7o+hgsgjU7ScI5DeRhr063p0lQLTr3kWeXTuRKS6jKtYb2ct0KFGC7E2hxTMBsJnOPwd8qepdSUuNLaiqPPoxY18PIMjNiiuDPA/XTF6RjOzRQ32GXh1WUmufsh7RTl/LrmKn1nPWujN1V7F80ybWujhr7/wRLUnbJNnhyRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xj4QwWVEAI0SFQXolIGfYTJdaECXiNjdZSmeNhl3FKo=; b=YEtf09AC9+JSN+OcR6KHdaZgdtdwfg1A2aso5Qm7jMb6G4kEeUqyU3iPALTUfSfFtxyPh09paZBPVReYfTgo/kJud1ms+Zburpz9dfiXJ/35LIS+lTCl9e/6ypHRNd5cSHc36dZo60ygLC8hHHTVOK6ZjNc5hbO9qtVKbmhmlogfDzPB1HXSM5Boybez5kgVztKEOa0gjIOQR2bERceHZQpHGxtu7ulLvf4CSPmx+UrEwGIS6vPKCVJ5Ri+QMipyia9lJz1TmWy0KCeXJOie5ZIRFUTan5Cjg1UY3t/B2I5GejQvBSFa+j3v6WbedLJqLS8hNLaG4f2bbNryHb6z5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xj4QwWVEAI0SFQXolIGfYTJdaECXiNjdZSmeNhl3FKo=; b=R2PWmouDBNsIpwTuM8XUIrAXcS1Ed2ycPaFkPPLJ1XpVqNiqfRDW8NSmxmcQM0f9ABEueQwZp2yEozHkfUKTBrQuHxva73MgdOuZu7b6nYzQMtiNTR+Y5bpIlENXn5QK5Jb4OzJcGdZLm2qIRde8vOl2qUes+7k43i4uBK4Ylh8= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 07/34] block/block-copy: introduce block_copy_set_copy_opts() Date: Tue, 24 Aug 2021 11:38:29 +0300 Message-Id: <20210824083856.17408-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1b7e8228-a465-489e-8bb3-08d966daaeb7 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1780: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:71; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 50SPKZSQUpYOr4D41N0IRyG5e1VzermUe6cqi/VHQzfpf+PnOFdejY+WvY8ANkXYeWcXzZfS9sv0WeiYOGbXNPPC7swrM/zuzq6reiM1eulZ32ZhNbWz5+B5UtJwH6VL3aEyJt0cM6PrEcLrGRVRLCzEvxG0LdbY43sMswudlmlvGmgT+j5Va0Lrw7yBrgGyZXRAvdI8sjjBbOWkWQmgYYxZq2UyoCCpidF7OT8+yR7ERq3DZH6sDGogSLynpixk3cLLR1tKCrynF84Ech+9C44ArMdZNUp0ypJ4TH3D9jBg16U0/ggxwsxabJArjytTcON924bm7b5TIqkQEUv1IF+a5utrGuDgR7KLOMJER2knO6jCxvG4Gt8OwFkOyJjeYZAz13Ei8qJFurlKpWYMtK6TppHTyrC9r3tRX0ouyg/E1fBevgTfm+g3fUfgE/JvUhNfly1IAkvWM/MU2yLkGwRw96/B/zicD5iHYWgHTneWVoQHOLIkXo/e/xMLhDg33D/4V3wHG0qTJvaga7TLHG9rYTMxZyFqSG+1/e2AwIntuXIuE6tfdy8z16unsKl1X5cKIbyaJkrT5CrrJbrGPCJ5XUkymD8K/TrdV5lbxLjaCuuyp4aqF9rTl7+QyIYPqP+Pib2k2WzysBw52eQs2KqeMVoOGI0dl+F/x4QBmjBfEwbExZ1XyFr0WJDCN57as+qL0P35yt9JvGQZQFnS1Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6512007)(83380400001)(4326008)(66556008)(66476007)(186003)(86362001)(38100700002)(38350700002)(36756003)(316002)(7416002)(478600001)(1076003)(52116002)(8676002)(2906002)(26005)(66946007)(2616005)(956004)(5660300002)(6486002)(6916009)(6506007)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ak6WaiQ5OnPSJvOujVj2tue41k00bRaZgZXgr+lBXjysL4/WQ+eo1J11ayZP?= =?us-ascii?Q?EdcX7Z0kLo+KePyVTpdxsS6I1CoBLPfmb4NFTMt/WoQDGDnYjbdD/RseA+Wn?= =?us-ascii?Q?q+4SRKpMMp7jsWsvyVDl0w6kwi7QI5FTXtN26pGZaT70BNTJ5/+CeBQcF7DN?= =?us-ascii?Q?Icislk+XwAG1ZjQYwI0RXRrQWWaQbIgxzevWfvVPbWrznuAX5TWosplhgwFz?= =?us-ascii?Q?WszWHbSncBzddCKANOlVe1nwbmSsGG+BCR6e9aGNEHn21yxdQENWH9SJujsO?= =?us-ascii?Q?gioCkg2I2+MifiJkg/XHbx2Lpd6x2srif6xeHt+5Q/ZTmH/813yZXDJENf/+?= =?us-ascii?Q?S0bdzniIMol6i63/Df2D7iGx6Rl5vj0qDpdEkHkgS19BY+G9RjzgdBfSrOjE?= =?us-ascii?Q?xA6fJ1PuYCNzwO/hcTMX5sqwixhtWjNb3NqDb0sdGc11mVZ63JiY+sl4nAbo?= =?us-ascii?Q?6TTv0vPVBNJyS1t50XttcxCGjSMzQ7GHoxUDHdwRtY8pPy9h/5T2m4cmr2gk?= =?us-ascii?Q?wW8ktZ8FSwt/O5GepmUMVDnN5nayWcPZsQLXhJzUGnLYmirVI63q1+MLpG4q?= =?us-ascii?Q?q/enStLtGvREBQGm/VTA6FwwCsvZ/Ok6d+uDgYzq1i4dbipPxQxwZYFUVmlz?= =?us-ascii?Q?hJ0Rc7oRh+vPzYrU3RkUATTYvyYOfIRC52LS0UpNafJFHlC7Q3y7oGkeyFiN?= =?us-ascii?Q?5GTXBJZJddezmMYYN/lm+bzfzMvP0FYTnzi8zl0c2QO0O6SZKBKRS2SUQUzQ?= =?us-ascii?Q?KPyQpqr682fVhQvnjrhYCayi1D0OquGDMVrdVePsRLRqXfcDniyqPPVihcNd?= =?us-ascii?Q?PEmOs2ax6MgN8em9FznHH+mAITHaCkvRFyOsVR88CcJL0pNd7e26Mo+0E/ox?= =?us-ascii?Q?cqI4XEuxDqlhs7vZyieqnXn8QRYyM5m5UKRhUCn+FRAMd5pEc5AziQVhYm+n?= =?us-ascii?Q?ZrdjOLknXlfE2V3zUuBK11mDSIg00zrcaTgq5zkoOARq5a/B4Ir/8jNdJW7V?= =?us-ascii?Q?cVmpTTrGIfkHCij9d0kXAVk7iOLmSTEdIK7KRbKCd3+S7s62LV1LxSn5kbrD?= =?us-ascii?Q?Ag/up/Zg52eiapvw1dgqi0t5HfaY2Uw6G2nWRwz60UgtOTwXymNvpe9ITxzd?= =?us-ascii?Q?4kPadTkHiNPqKZQ/+qUOgiXBz0B5Lr2doOj+rx5oIqFiDjtv88Jh+ql2366M?= =?us-ascii?Q?QhYg45gxJUwXTYDQFUw3Ek16Nl9JJRf3VQzbGcqlrxI3C3ml5bw/8/BzvT+j?= =?us-ascii?Q?qMQPOPwIywWuEVp8Va7+hpcJdvSBB7/2/Mzomaz3djyka98DScP8Bhv94YX3?= =?us-ascii?Q?ztbPdp3R9vG95MIfHJneglZ3?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b7e8228-a465-489e-8bb3-08d966daaeb7 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:27.1187 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LO//bScb7H31L1GQY0ELwZsvYV7oKLvBVsPwsz6Jo252XMscYXykYTFLXqSgsAj2BEEiuJNl93yCMgnVwUr9reoBktRY6Py5vwy7S8pNIGY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1780 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.101; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794641517100001 Content-Type: text/plain; charset="utf-8" We'll need a possibility to set compress and use_copy_range options after initialization of the state. So make corresponding part of block_copy_state_new() separate and public. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- include/block/block-copy.h | 3 +++ block/block-copy.c | 49 ++++++++++++++++++++++---------------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 734389d32a..dca6c4ce36 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -28,6 +28,9 @@ BlockCopyState *block_copy_state_new(BdrvChild *source, B= drvChild *target, int64_t cluster_size, bool use_copy_r= ange, bool compress, Error **errp); =20 +/* Function should be called prior any actual copy request */ +void block_copy_set_copy_opts(BlockCopyState *s, bool use_copy_range, + bool compress); void block_copy_set_progress_meter(BlockCopyState *s, ProgressMeter *pm); =20 void block_copy_state_free(BlockCopyState *s); diff --git a/block/block-copy.c b/block/block-copy.c index 58b4345a5a..e83870ff81 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -315,6 +315,33 @@ static uint32_t block_copy_max_transfer(BdrvChild *sou= rce, BdrvChild *target) target->bs->bl.max_transfer)); } =20 +void block_copy_set_copy_opts(BlockCopyState *s, bool use_copy_range, + bool compress) +{ + /* Keep BDRV_REQ_SERIALISING set (or not set) in block_copy_state_new(= ) */ + s->write_flags =3D (s->write_flags & BDRV_REQ_SERIALISING) | + (compress ? BDRV_REQ_WRITE_COMPRESSED : 0); + + if (s->max_transfer < s->cluster_size) { + /* + * copy_range does not respect max_transfer. We don't want to both= er + * with requests smaller than block-copy cluster size, so fallback= to + * buffered copying (read and write respect max_transfer on their + * behalf). + */ + s->method =3D COPY_READ_WRITE_CLUSTER; + } else if (compress) { + /* Compression supports only cluster-size writes and no copy-range= . */ + s->method =3D COPY_READ_WRITE_CLUSTER; + } else { + /* + * If copy range enabled, start with COPY_RANGE_SMALL, until first + * successful copy_range (look at block_copy_do_copy). + */ + s->method =3D use_copy_range ? COPY_RANGE_SMALL : COPY_READ_WRITE; + } +} + BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, int64_t cluster_size, bool use_copy_r= ange, bool compress, Error **errp) @@ -353,32 +380,14 @@ BlockCopyState *block_copy_state_new(BdrvChild *sourc= e, BdrvChild *target, .copy_bitmap =3D copy_bitmap, .cluster_size =3D cluster_size, .len =3D bdrv_dirty_bitmap_size(copy_bitmap), - .write_flags =3D (is_fleecing ? BDRV_REQ_SERIALISING : 0) | - (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), + .write_flags =3D (is_fleecing ? BDRV_REQ_SERIALISING : 0), .mem =3D shres_create(BLOCK_COPY_MAX_MEM), .max_transfer =3D QEMU_ALIGN_DOWN( block_copy_max_transfer(source, target= ), cluster_size), }; =20 - if (s->max_transfer < cluster_size) { - /* - * copy_range does not respect max_transfer. We don't want to both= er - * with requests smaller than block-copy cluster size, so fallback= to - * buffered copying (read and write respect max_transfer on their - * behalf). - */ - s->method =3D COPY_READ_WRITE_CLUSTER; - } else if (compress) { - /* Compression supports only cluster-size writes and no copy-range= . */ - s->method =3D COPY_READ_WRITE_CLUSTER; - } else { - /* - * If copy range enabled, start with COPY_RANGE_SMALL, until first - * successful copy_range (look at block_copy_do_copy). - */ - s->method =3D use_copy_range ? COPY_RANGE_SMALL : COPY_READ_WRITE; - } + block_copy_set_copy_opts(s, use_copy_range, compress); =20 ratelimit_init(&s->rate_limit); qemu_co_mutex_init(&s->lock); --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794504; cv=pass; d=zohomail.com; s=zohoarc; b=lkDYwtah5cyOieYDpWbMxg/bN1UGIf/Gl0gZhhpwAbWWCUF7K5vg0OTlu7BBkgC7QH1DJS9T0teuyfM6dIOAsRe0iAaipDSHF4Ee6glt1fuBCprhJbSa6E0TtajZ5WqEju73hX4yQmS6vnvHKhCN+lF14eZ/ohLi2OUDexQ162U= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794504; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1gufYc6dZp7TrdpREwKrNu2x663dQRVh7KV1g/HXFB4=; b=caCRHxvq1BN8WP3H4l61HOC9sntDHF7ub3JmKnNep9+/NuKlIp/bUrYmjxCBeJdLx+ZdyWK8AS9FLuXZ1nrWf0VQUROGWFsCXnxGbQcCRqYfqrmG5vjSyN05qulXGbQx4u3JyykFQfEErA/AhXmjQMAQqfkwnIJC4Uo0+4bw25I= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794504926329.0198485972902; Tue, 24 Aug 2021 01:41:44 -0700 (PDT) Received: from localhost ([::1]:54664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS03-0006c5-Rk for importer@patchew.org; Tue, 24 Aug 2021 04:41:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy6-0002TT-HO; Tue, 24 Aug 2021 04:39:38 -0400 Received: from mail-eopbgr70101.outbound.protection.outlook.com ([40.107.7.101]:20612 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy4-0007OJ-Lx; Tue, 24 Aug 2021 04:39:38 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0801MB1780.eurprd08.prod.outlook.com (2603:10a6:203:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:28 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:28 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGznxNnNZVnKE7YrRjoxuZiUTc/ROCp89bt+0o0TtJ2uGIXZWAcjfaZ4vcLkuy5XIaIGvnsY9+m9eq9BYkMKbjr8CgKvyqu6uQ0CeHRYEVEENXlagfs+X8F2ElyWkO16vKBfhGTZ7V+WBdR9MWDMnF9fRGbtVCrPMiJnWCm6o2GPslWKgBf/Cob6YYPRbxM6PADRfsDDEpVsLMSHytG1tU1aCSQx/7vdFRukKjAB7INL5P5HCOucOOMGqWlbqgmXnlWvrroWNtaKBxgYvmbefZv72qM8c9Pw1vXUeejfnqD59uJ4s3Fj9wXusBNN980SWPv4A4tnIs1HNgMvZsiqoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1gufYc6dZp7TrdpREwKrNu2x663dQRVh7KV1g/HXFB4=; b=bzsacVtQzkIMqtJjnHW4ZM8HtFSleF3f1a5r+XIL2Mq8fxeeH658w5MkC28zrDoOmh+91w3bk5iEbhBh6qm1NcSkDYPjZWWG7iDYVCTJHKlJrv2j3cYyi3I/JD7uaTtztNqjNEBA83F6jBfj2NHfruu69prIig9fFPsotsbxDCywSDHuaigTG5fUrnLZC0gR7vBTimqymylGaPz3YM9e0723vUBiwCyXd9Rf7o1o/BbcEbgO7llHkLBOWo6JWvTJqgJcxizT/i7yrGb2SmvSpoSQti67viZ+uIgtRIrwY1omuRuDGvw4XOncyEUVMizeRGPXaEJHtw14hfbD0CEN4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1gufYc6dZp7TrdpREwKrNu2x663dQRVh7KV1g/HXFB4=; b=hCNuZJ2hsdRkq+WZY8YOxTPbdqIOmZbcF5eNK0wBE2AP6TEEEHs3P0dO3wo8SNClRUpNS+swA+QlqNfOG+zLic/EsLbfers+tyMdxjNPhIukNzqvVdGFKmNQXpY6iM2F4iBXgC4KzRYZWqzSvWroqE1cuGo+EZX62Zz+bmv1hLw= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 08/34] block/backup: set copy_range and compress after filter insertion Date: Tue, 24 Aug 2021 11:38:30 +0300 Message-Id: <20210824083856.17408-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 904bf58e-094a-4420-f7d9-08d966daaf82 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1780: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WMovkDCPb9ER3xJPeJXCgRYtUTHTqDqoIq/HW5ShbZvMCxYPVV4A+x/4XiPIqCRoDPNgzSAU0tVkXHltKcIzM59hThkDbTCsgYp809cHRciX4B+Kc7paO+QXWSFxZ6XDjMuSKYEDnr/pRUSJ2WFCpfMq0pp3tfokoamv6q8zm5T9RulBKDu545qC2yxmSfy8WLoaMI9Y3OaugCrnkrN+bxJiAoCdz30XaOqWMx/0ftM1+E4KajWPxAS5LdhEww81xLz+YI9AagTSXPyFg+C4DWwUvFmexrmTk7UW3l+M2TFJ1DzRajbiujIt2pWBrYjaGkCo8v7M96FMgaBKCDaVArlCzOkupPf+3uibwwjYwDhDDdW3oSuvmVaXXiXARPHEzb3nDdYb9dHDXjhC6BxCKvDAoJEyhYIAWVL9us5X8JoF3i0MdZvf9+QRHhHDn73T34AxJglOvn3U6BBzelgoPqTiP2cGe24OeO0EnOuU1Xqfi2OwclhlNa5+lZ1XBcuhhSm8PikCpHpokLaNc9JZUepPYHIL9zFM/KXi4l2vqKezhFfmdHVbWtGgQ2eS4UZtB2msWTAq0lJLVhXViEDI9Owo/6KbZDG/fanFbZnCK33WoUPzPM2aQx+rdOTF8YoD++HZDkrXKUd4Arhqr9Mt4NNWIrZbovo2eu4bfFGRUsutuZ2Oidea7sbc/s/CpXseYx+g2dunNtkI1Clo2EgonQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6512007)(83380400001)(4326008)(66556008)(66476007)(186003)(86362001)(38100700002)(38350700002)(36756003)(316002)(7416002)(478600001)(1076003)(52116002)(8676002)(2906002)(26005)(66946007)(2616005)(956004)(6666004)(5660300002)(6486002)(6916009)(6506007)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?seTSAECyEw0NGQGfXiD/m9GPJXZhxudiQsL4+jb+V4u7u/AE7D7Jn72Wf+bN?= =?us-ascii?Q?ZZyJLxcpndpOJheTsmh40sp7Xska8VRj0ZeMZxsDUpmwYZAoIrX1j3VRpTjF?= =?us-ascii?Q?HJ2jkrv5yQUcmnYo8dHebg1ooEjdv2B4Zv+Z1stiBMKhUC/PsiU0B7cb7PA1?= =?us-ascii?Q?TBUqYbdK3oNmSu/h6RvkEJPZJbtaosieYl+4kj5+tSD2CfvaOi7efvH4M0Tk?= =?us-ascii?Q?dWe9cjK/1WTjUgNM9Ua50N8UZayn4QAjS1wGJrlzEKf8ikK5OHnPLqo+QSgR?= =?us-ascii?Q?jPlryd945bj15gTRmPdQU4CLq/gdm4mIJXTJMhXzxDr8qtJ+iC+CZN7qDTXY?= =?us-ascii?Q?U3lKvbrKvuqLgPDQh96XxkC9oJsv2PrkVoag3Sd9yXekunZVa/AW6m/J9qKU?= =?us-ascii?Q?6pemD2dqoUOTPzO+3dV5jI2ctgpLUG9OClx3RK+CNjxTd1iN7mYM/2CVd62o?= =?us-ascii?Q?OaZmFOw/trluWQ6DDfMpzZCXuEUUz4LzB3C7yVOLbEMdyPqSugkPY8FjYiPU?= =?us-ascii?Q?6vFN/KQIaClsbGyjRGxlJSs8NWD6pHS0lPON8bFh6GG8zbY7v448qMsNsrSP?= =?us-ascii?Q?cNNntP+AGqVrcVviMSc+7lGgI0/vbprVY5Kt+Zks8C9MmNa/txml2ZoJ8W94?= =?us-ascii?Q?UAVjJocIprdlY9IXvh1xdZCPp0HZrMUu3nrru8AFZIJYEkRvwbN62rvK8N+r?= =?us-ascii?Q?vWOdiKYNU15nCt46U5IZ+dzBKHVJbJ3mHPQBbW/lcvk8JYe9nBA6ozOdTfrn?= =?us-ascii?Q?xgZh4dAgGSyjI+OJPFCHkJv5qg3fY0VD/xhSXQ/Wy/POEvGm5VPQIxzlsit3?= =?us-ascii?Q?6qV90olOzKtf3wKTCqJDUUoofFuaBDDPR6HV/6XfuIpt+5Vvj5E153MxYqSO?= =?us-ascii?Q?9o5i5VL+HNUtflgZhwzvuI6gxIHi56PT9B06kqyg1uGBrQ0l2Jznc+NBkzaX?= =?us-ascii?Q?X0FG9+DfoZn6UhfroIaMcvucZtBKzVnDQmPp4+ZlXkfV4a2gpGahh6yMV+K/?= =?us-ascii?Q?7OOfQLJ1EqFlmi545i/XwRjq8MIp5Zf1MWQh7jksAUrX9kXXL66A2w0FPobl?= =?us-ascii?Q?Kt4aJRDqI5uFyL57RrMxN2vl9495PN24/A2A1WRti94PaIxcR5qqhoHW+S+V?= =?us-ascii?Q?tsnRpkxEqDRfGCE7eA9Ygc99SDJjou+dxCMBmr9Vyf1DMn2DF2UM6Z5V69yC?= =?us-ascii?Q?tN50nEWya7gHbxF5D+1lWNWUSayC03z5KenPbjZ0zUFpNRPoCblwtvRBNsWs?= =?us-ascii?Q?tZ5RDfDK5z38O+gfzJBR5wVyhlHHbADGrDgwIM37xPM+LZhvlk8hRSHChWSn?= =?us-ascii?Q?FsF5TeeHbje8Lk7MyXS6VUh5?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 904bf58e-094a-4420-f7d9-08d966daaf82 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:28.4489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: VjcldHEP4QSuGSnMhkgpDaIjclGi9+ZV9oU+TfU5wFnagg6CFj9sRU/dfNPSRIWi2Qmj+N9Et4pXnXKx4RMdb78rXjs7qZtOyiui6ftuWOw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1780 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.101; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794506158100001 Content-Type: text/plain; charset="utf-8" We are going to publish copy-before-write filter, so it would be initialized through options. Still we don't want to publish compress and copy-range options, as 1. Modern way to enable compression is to use compress filter. 2. For copy-range it's unclean how to make proper interface: - it's has experimental prefix for backup job anyway - the whole BackupPerf structure doesn't make sense for the filter So, let's just add copy-range possibility to the filter later if needed. Still, we are going to continue support for compression and experimental copy-range in backup job. So, set these options after filter creation. Note, that we can drop "compress" argument of bdrv_cbw_append() now, as well as "perf". The only reason not doing so is that now, when I prepare this patch the big series around it is already reviewed and I want to avoid extra rebase conflicts to simplify review of the following version. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.h | 1 - block/backup.c | 3 ++- block/copy-before-write.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index f37e2249ae..538aab8bdb 100644 --- a/block/copy-before-write.h +++ b/block/copy-before-write.h @@ -33,7 +33,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sourc= e, BlockDriverState *target, const char *filter_node_name, uint64_t cluster_size, - BackupPerf *perf, bool compress, BlockCopyState **bcs, Error **errp); diff --git a/block/backup.c b/block/backup.c index 84f9a5f02c..b31fd99ab3 100644 --- a/block/backup.c +++ b/block/backup.c @@ -504,7 +504,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, } =20 cbw =3D bdrv_cbw_append(bs, target, filter_node_name, - cluster_size, perf, compress, &bcs, errp); + cluster_size, false, &bcs, errp); if (!cbw) { goto error; } @@ -530,6 +530,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, job->len =3D len; job->perf =3D *perf; =20 + block_copy_set_copy_opts(bcs, perf->use_copy_range, compress); block_copy_set_progress_meter(bcs, &job->common.job.progress); block_copy_set_speed(bcs, speed); =20 diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 4337076c1c..235251a640 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -170,7 +170,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, BlockDriverState *target, const char *filter_node_name, uint64_t cluster_size, - BackupPerf *perf, bool compress, BlockCopyState **bcs, Error **errp) @@ -217,8 +216,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, =20 state->cluster_size =3D cluster_size; state->bcs =3D block_copy_state_new(top->backing, state->target, - cluster_size, perf->use_copy_range, - compress, errp); + cluster_size, false, compress, errp); if (!state->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); goto fail; --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794983; cv=pass; d=zohomail.com; s=zohoarc; b=QSdDWM/ECk+OMz0Q+HKxBR/dgRsSh04Yrvv1kd8gyk6ZCyJX8ewmgoVKxvMxluArzaXCGKb3mM/2GjnWn0Ty7uSUY3n4dustiJgN8LS0RPhhDyot5ZrrQtewhdhkYnY2vr/W/FfqK4dQtpzBxD2gJVeye+y8sdVmXKVGifMuMqQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794983; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Itn2jvbeCkQbfrin3hCEsXd1QreO2666QKbEzX1b420=; b=givPcBtnZ7jDa2QAc94TunxxWI7PZjrCVoPnZ26mOpAOPKB0TfUp/xkKZFVJxtMRCsSq1OlmjNI5tdh7BxmU8hz0/NYPAxOxNeAqYtsiG/V3dT6wW23Zjs1jgp2FZbBvWn60wKta/hq7Mn7V8Oy05Td4HOZ2NJKf8tIN2QUE0b0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794982998541.6373763111851; Tue, 24 Aug 2021 01:49:42 -0700 (PDT) Received: from localhost ([::1]:53562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS7p-0007tW-Qb for importer@patchew.org; Tue, 24 Aug 2021 04:49:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyA-0002X5-Kt; Tue, 24 Aug 2021 04:39:44 -0400 Received: from mail-eopbgr70101.outbound.protection.outlook.com ([40.107.7.101]:20612 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy7-0007OJ-A9; Tue, 24 Aug 2021 04:39:41 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0801MB1780.eurprd08.prod.outlook.com (2603:10a6:203:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:29 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:29 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P56KppJV5qljwhBPm9UI8YNvnLNGt0aLhZ8yKCquhnN5ESoOmBzKNi2snHiHKFoNKSxrMbbWGd7Kr7ZohtNrEl716FoyM9ImTc4M/OmgcMB1Ocs2AOiN1OwjyqO6ICw56O4QqttRaZHcQH3PQkpQJGgvqR5hF6I6EVRwtV4DD0T0o/zRqfAexZ+akBBP53KpQ4dKwIxPWerpKOQxyP/Dt0mrSS8Nw91bP27ZLcxYw6pS8Lg0WDS/m1R+r/yok9ydiciCuOaxhew/q8uCl6+NMQfvboewypBkVJe4ZH25n0PJGvfLQxg2R7b3tBZgZsORi/n4TdwOj4Vsdg6KnYFQZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Itn2jvbeCkQbfrin3hCEsXd1QreO2666QKbEzX1b420=; b=UsqeXxNeHszBbFHFR8Eoi9XkSR9t8Yyv0U/hnoED3RM0uA/5D8HxgJtJeu/z/kaDEQS/XSfpKwDxFwm8vzDfZbpHzIj9r7dbFOwKP8z7dx5DA67W8jl0TWpePVXyXiPeqyTyfs4HvULU9gFofq4aV6t2Ly58tpk5RGOmX7H7I0lXLrJLAcGgNZxe6VcpmRFzM2hb7/euQUAF7EzJScb3i+icHJewecHEIqeCTTiuMIsB+vXV3sSVwAIws3/TUF6Pw510FHKmSM7Cd52GItn4YJY5HoA7NEXQfWhEP14dSYsiey3W1TGG7oX6IXnA4rpXxZYC/WrkE2L2XYfRREjh/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Itn2jvbeCkQbfrin3hCEsXd1QreO2666QKbEzX1b420=; b=pHLmM/Zrjrf14JX8mKRE4ysHBnVzV9F1JUyrA59C2oOtWd9mCzgROuQXc+rct0qf4KtIY9/lwivuuFetQ3uk3ImR1vnABijeOQAPmTXL92Ifn02seO1Ht/kvy8OY9BkpHPl9rO5TAXjQbS2Ow2U7Hy/w0loCGL60Ckuwlzr5Y5A= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 09/34] block/backup: move cluster size calculation to block-copy Date: Tue, 24 Aug 2021 11:38:31 +0300 Message-Id: <20210824083856.17408-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0d863b0b-4017-4a2c-c8d4-08d966dab059 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1780: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:102; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NJ29j2OqHvpESbLSTjYLbSY9dudFrHPh6eZL+hyeEKrB9Nr7cknWAx4eiX769pEIFzZwAblzUCk+IwVwhb+ouCfHujIoIpD3oZ0zML5UcPYig5sHxPZ+AVV1aUoV9JrTc7KyO0thAYC9dRStqclkl4cObkw0sGj5O46a1lwx6rbpHKnb0nyG001/1yO7v+Jvt/Dme7ilvKpDnFt41kI0v7oC4bepMBxrBv7bqfQp915GcC0ENVyH/NH0QxnEU1pvN2Z0uc/F8EfJlSy/GZkWZmK+HfP+B+Qqan8aDrp94i9HcJu1acG97gpkcAKU+8uDZyRY4p+cbyVB6aIdxELLHi0sga5qG1SucFCEZBNijb5zRbO4I/1Zue7qEGQlpz4TuikmjCLXP4gzoBIMZrwTvqO7F9JufJUX29lCDnkMZDLsKDb9X1XJ5RYYpjcO9p19ZeMpiowqjXmZhHw32aHbOaBtRPN0p4houojV3ZEGtsAAgH9yqaCprCMwCHlkz7PMTpVlOSue8nWjYrex8ZfQlmtOfdh0kVFwuZS71hrhNrMtICYkk3J//mmwK4cQbbOdqsAMZ3iKzlUBAwYvsL7cJxHiBmx1IR2hUZyTulYy1YbFwMXHU9SOtNzNEEGYXltoLjwvQSMLzDzxNxhv5jV/ZQtzuz8YILpmqpNTQc86jUcSjQnVSdAzALQzFr0jjjayysjQqFpJmQsUUCjBQDWwhg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6512007)(83380400001)(4326008)(66556008)(66476007)(186003)(86362001)(38100700002)(38350700002)(36756003)(316002)(7416002)(478600001)(1076003)(52116002)(8676002)(2906002)(26005)(66946007)(2616005)(956004)(6666004)(5660300002)(6486002)(6916009)(6506007)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?nWG9ibigwdsVg9ZzGR9qtCS2G6aQCNX1gG5egi2lPLl7No4tZsMZ8d1TFSZM?= =?us-ascii?Q?UfCG3bNdhh4492OR54urqbTFEFA9eTb5jT5MjDJlkvM6U3fmd1pIyYQxKsqg?= =?us-ascii?Q?TNBnngym95MuCO9DObsXSnsfh6SIF4lKFVkVA8v3wVjSPmTbnVI2OlyJ6grK?= =?us-ascii?Q?Fw49yyvO+o9Cbh/2V/LVh+pqtYpWQs6NUrtYE8aJazRmQ3SlVydvcTsF433B?= =?us-ascii?Q?3RXKwoUTC7z4j7NGCbTG09iHRqDJm+Ac1ijDvfSQCM8r4Xef2jU/RswXNf4o?= =?us-ascii?Q?hR5+uklAd25rnBWYP41sM5RhS5mX/A/F5s/7TcEYFpQdh8RMSMjV/N5MDsjH?= =?us-ascii?Q?oXOVRLQl7NTnuSo1OeTnBZ+eVKHsODoAqZNDAbDZ/z95YJlveprHw1rfOB5Z?= =?us-ascii?Q?mc9XiFtjVVuWBoDtNCs44bSWyDVUy+6Or2Ch+Fugx090J/lTqnLfB9YeTxM9?= =?us-ascii?Q?4a92qcHxQhEMQUuUhQ/xCde7gNWhFc/SpjSWCjdpXPXfRnzdB0QJeMWCvJL0?= =?us-ascii?Q?7BUlBtDeL1xAQocB6aE0av3C+pTt+xhIU0HWX7iQzr+vg99qBfOFPPF5MgeA?= =?us-ascii?Q?gVsod3YkFzUbLUzg+oxAhHTSH2gNZ0bq16H7y+x0rbTgSfOxXk/OJtARAXCM?= =?us-ascii?Q?gwqQqKXFYc8zftqcA84T3rUXWVWDz1GjPXG2LHuV5KJ0wukAtFWMwcRvPMYx?= =?us-ascii?Q?nYDPRoVNKFcgYQRJ6djI1zys0fSM/lxW9/iJ8X62WWq+DdfEd54G8nSyPwVo?= =?us-ascii?Q?T22bIjF5w7YZFYoZ/xb4hpOi75wWhIc9pIQyjWVxWB0XcSCVKewnuuZYw4+8?= =?us-ascii?Q?XYN4+vvyBc1jumSLFp1fPkzByEY3NBsghLWif9E7Y9aL7l6GtKmBCcQz/7Cy?= =?us-ascii?Q?IhnHNLH/V1M+EO8C6ZGAbqRZLXqombX+tk/p0JiKRyunoMZd5l+iz22TEZUs?= =?us-ascii?Q?MVdiv2dzTnQp0Dsn5CdJ50Og/l7Jt58TCNH4FO2fL5IojB00kF03Mp3GutHy?= =?us-ascii?Q?qThjy2c+0nnyLGwKXIx4GIFcNC0XTWYBCAjzWvM8ACljULLJv+9hiRrQWZPh?= =?us-ascii?Q?7ybjTBJrW+h7nDgrLPCdeE1SrU7lGo2hwCWv7iACOatKXHmTGKwTIqzdkF/y?= =?us-ascii?Q?rRJxMgiEWT1o+6RJ8Ex5sET7ESAJzPcOQ+xC7kgelGIEvf8SXKEGmVtJpXOY?= =?us-ascii?Q?wU1jsRmyC+EpGI+EllnOga3OR3rLecwa1iqn2AT+UMyC/nld/+uHEUdpsgex?= =?us-ascii?Q?0IqTxIhLcVZUSdRcH2nCp8cdSWhtaP2hBkxcP2AjdlhKqFV/C8NLLdGRwLHq?= =?us-ascii?Q?o68Hnf8eeIVa/+kjkdfJk4hY?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d863b0b-4017-4a2c-c8d4-08d966dab059 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:29.8796 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ou0T/gW19wAJz+uc7AMbtKePdEyA+f24scXlD6C5d072USKjSuEKqBU9lLHyF6TyZsm5ZGcW0OAA4rlGcZYnYUpvJ8dT8wqzzsfWvcjXB60= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1780 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.101; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794985244100005 Content-Type: text/plain; charset="utf-8" The main consumer of cluster-size is block-copy. Let's calculate it here instead of passing through backup-top. We are going to publish copy-before-write filter soon, so it will be created through options. But we don't want for now to make explicit option for cluster-size, let's continue to calculate it automatically. So, now is the time to get rid of cluster_size argument for bdrv_cbw_append(). Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.h | 1 - include/block/block-copy.h | 5 +-- block/backup.c | 62 ++++++-------------------------------- block/block-copy.c | 51 ++++++++++++++++++++++++++++++- block/copy-before-write.c | 10 +++--- 5 files changed, 66 insertions(+), 63 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index 538aab8bdb..b386fd8f01 100644 --- a/block/copy-before-write.h +++ b/block/copy-before-write.h @@ -32,7 +32,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source, BlockDriverState *target, const char *filter_node_name, - uint64_t cluster_size, bool compress, BlockCopyState **bcs, Error **errp); diff --git a/include/block/block-copy.h b/include/block/block-copy.h index dca6c4ce36..b8a2d63545 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -25,8 +25,8 @@ typedef struct BlockCopyState BlockCopyState; typedef struct BlockCopyCallState BlockCopyCallState; =20 BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, - int64_t cluster_size, bool use_copy_r= ange, - bool compress, Error **errp); + bool use_copy_range, bool compress, + Error **errp); =20 /* Function should be called prior any actual copy request */ void block_copy_set_copy_opts(BlockCopyState *s, bool use_copy_range, @@ -91,6 +91,7 @@ void block_copy_kick(BlockCopyCallState *call_state); void block_copy_call_cancel(BlockCopyCallState *call_state); =20 BdrvDirtyBitmap *block_copy_dirty_bitmap(BlockCopyState *s); +int64_t block_copy_cluster_size(BlockCopyState *s); void block_copy_set_skip_unallocated(BlockCopyState *s, bool skip); =20 #endif /* BLOCK_COPY_H */ diff --git a/block/backup.c b/block/backup.c index b31fd99ab3..83516297cb 100644 --- a/block/backup.c +++ b/block/backup.c @@ -29,8 +29,6 @@ =20 #include "block/copy-before-write.h" =20 -#define BACKUP_CLUSTER_SIZE_DEFAULT (1 << 16) - typedef struct BackupBlockJob { BlockJob common; BlockDriverState *cbw; @@ -354,43 +352,6 @@ static const BlockJobDriver backup_job_driver =3D { .set_speed =3D backup_set_speed, }; =20 -static int64_t backup_calculate_cluster_size(BlockDriverState *target, - Error **errp) -{ - int ret; - BlockDriverInfo bdi; - bool target_does_cow =3D bdrv_backing_chain_next(target); - - /* - * If there is no backing file on the target, we cannot rely on COW if= our - * backup cluster size is smaller than the target cluster size. Even f= or - * targets with a backing file, try to avoid COW if possible. - */ - ret =3D bdrv_get_info(target, &bdi); - if (ret =3D=3D -ENOTSUP && !target_does_cow) { - /* Cluster size is not defined */ - warn_report("The target block device doesn't provide " - "information about the block size and it doesn't have = a " - "backing file. The default block size of %u bytes is " - "used. If the actual block size of the target exceeds " - "this default, the backup may be unusable", - BACKUP_CLUSTER_SIZE_DEFAULT); - return BACKUP_CLUSTER_SIZE_DEFAULT; - } else if (ret < 0 && !target_does_cow) { - error_setg_errno(errp, -ret, - "Couldn't determine the cluster size of the target image, " - "which has no backing file"); - error_append_hint(errp, - "Aborting, since this may create an unusable destination image= \n"); - return ret; - } else if (ret < 0 && target_does_cow) { - /* Not fatal; just trudge on ahead. */ - return BACKUP_CLUSTER_SIZE_DEFAULT; - } - - return MAX(BACKUP_CLUSTER_SIZE_DEFAULT, bdi.cluster_size); -} - BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs, BlockDriverState *target, int64_t speed, MirrorSyncMode sync_mode, BdrvDirtyBitmap *sync_bitmap, @@ -448,11 +409,6 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, return NULL; } =20 - cluster_size =3D backup_calculate_cluster_size(target, errp); - if (cluster_size < 0) { - goto error; - } - if (perf->max_workers < 1) { error_setg(errp, "max-workers must be greater than zero"); return NULL; @@ -464,13 +420,6 @@ BlockJob *backup_job_create(const char *job_id, BlockD= riverState *bs, return NULL; } =20 - if (perf->max_chunk && perf->max_chunk < cluster_size) { - error_setg(errp, "Required max-chunk (%" PRIi64 ") is less than ba= ckup " - "cluster size (%" PRIi64 ")", perf->max_chunk, cluster_= size); - return NULL; - } - - if (sync_bitmap) { /* If we need to write to this bitmap, check that we can: */ if (bitmap_mode !=3D BITMAP_SYNC_MODE_NEVER && @@ -503,12 +452,19 @@ BlockJob *backup_job_create(const char *job_id, Block= DriverState *bs, goto error; } =20 - cbw =3D bdrv_cbw_append(bs, target, filter_node_name, - cluster_size, false, &bcs, errp); + cbw =3D bdrv_cbw_append(bs, target, filter_node_name, false, &bcs, err= p); if (!cbw) { goto error; } =20 + cluster_size =3D block_copy_cluster_size(bcs); + + if (perf->max_chunk && perf->max_chunk < cluster_size) { + error_setg(errp, "Required max-chunk (%" PRIi64 ") is less than ba= ckup " + "cluster size (%" PRIi64 ")", perf->max_chunk, cluster_= size); + goto error; + } + /* job->len is fixed, so we can't allow resize */ job =3D block_job_create(job_id, &backup_job_driver, txn, cbw, 0, BLK_PERM_ALL, diff --git a/block/block-copy.c b/block/block-copy.c index e83870ff81..b0e0a38330 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -27,6 +27,7 @@ #define BLOCK_COPY_MAX_MEM (128 * MiB) #define BLOCK_COPY_MAX_WORKERS 64 #define BLOCK_COPY_SLICE_TIME 100000000ULL /* ns */ +#define BLOCK_COPY_CLUSTER_SIZE_DEFAULT (1 << 16) =20 typedef enum { COPY_READ_WRITE_CLUSTER, @@ -342,14 +343,57 @@ void block_copy_set_copy_opts(BlockCopyState *s, bool= use_copy_range, } } =20 +static int64_t block_copy_calculate_cluster_size(BlockDriverState *target, + Error **errp) +{ + int ret; + BlockDriverInfo bdi; + bool target_does_cow =3D bdrv_backing_chain_next(target); + + /* + * If there is no backing file on the target, we cannot rely on COW if= our + * backup cluster size is smaller than the target cluster size. Even f= or + * targets with a backing file, try to avoid COW if possible. + */ + ret =3D bdrv_get_info(target, &bdi); + if (ret =3D=3D -ENOTSUP && !target_does_cow) { + /* Cluster size is not defined */ + warn_report("The target block device doesn't provide " + "information about the block size and it doesn't have = a " + "backing file. The default block size of %u bytes is " + "used. If the actual block size of the target exceeds " + "this default, the backup may be unusable", + BLOCK_COPY_CLUSTER_SIZE_DEFAULT); + return BLOCK_COPY_CLUSTER_SIZE_DEFAULT; + } else if (ret < 0 && !target_does_cow) { + error_setg_errno(errp, -ret, + "Couldn't determine the cluster size of the target image, " + "which has no backing file"); + error_append_hint(errp, + "Aborting, since this may create an unusable destination image= \n"); + return ret; + } else if (ret < 0 && target_does_cow) { + /* Not fatal; just trudge on ahead. */ + return BLOCK_COPY_CLUSTER_SIZE_DEFAULT; + } + + return MAX(BLOCK_COPY_CLUSTER_SIZE_DEFAULT, bdi.cluster_size); +} + BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, - int64_t cluster_size, bool use_copy_r= ange, + bool use_copy_range, bool compress, Error **errp) { BlockCopyState *s; + int64_t cluster_size; BdrvDirtyBitmap *copy_bitmap; bool is_fleecing; =20 + cluster_size =3D block_copy_calculate_cluster_size(target->bs, errp); + if (cluster_size < 0) { + return NULL; + } + copy_bitmap =3D bdrv_create_dirty_bitmap(source->bs, cluster_size, NUL= L, errp); if (!copy_bitmap) { @@ -960,6 +1004,11 @@ BdrvDirtyBitmap *block_copy_dirty_bitmap(BlockCopySta= te *s) return s->copy_bitmap; } =20 +int64_t block_copy_cluster_size(BlockCopyState *s) +{ + return s->cluster_size; +} + void block_copy_set_skip_unallocated(BlockCopyState *s, bool skip) { qatomic_set(&s->skip_unallocated, skip); diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 235251a640..a7996d54db 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -37,7 +37,6 @@ typedef struct BDRVCopyBeforeWriteState { BlockCopyState *bcs; BdrvChild *target; - int64_t cluster_size; } BDRVCopyBeforeWriteState; =20 static coroutine_fn int cbw_co_preadv( @@ -52,13 +51,14 @@ static coroutine_fn int cbw_do_copy_before_write(BlockD= riverState *bs, { BDRVCopyBeforeWriteState *s =3D bs->opaque; uint64_t off, end; + int64_t cluster_size =3D block_copy_cluster_size(s->bcs); =20 if (flags & BDRV_REQ_WRITE_UNCHANGED) { return 0; } =20 - off =3D QEMU_ALIGN_DOWN(offset, s->cluster_size); - end =3D QEMU_ALIGN_UP(offset + bytes, s->cluster_size); + off =3D QEMU_ALIGN_DOWN(offset, cluster_size); + end =3D QEMU_ALIGN_UP(offset + bytes, cluster_size); =20 return block_copy(s->bcs, off, end - off, true); } @@ -169,7 +169,6 @@ BlockDriver bdrv_cbw_filter =3D { BlockDriverState *bdrv_cbw_append(BlockDriverState *source, BlockDriverState *target, const char *filter_node_name, - uint64_t cluster_size, bool compress, BlockCopyState **bcs, Error **errp) @@ -214,9 +213,8 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, } appended =3D true; =20 - state->cluster_size =3D cluster_size; state->bcs =3D block_copy_state_new(top->backing, state->target, - cluster_size, false, compress, errp); + false, compress, errp); if (!state->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); goto fail; --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795227; cv=pass; d=zohomail.com; s=zohoarc; b=I+6rwmVjy73JSb7zIdSb245rv6/2koAtRZRRZbBSk+1Mk826xLmtcbIAFkX78jDonPVNjNsyA5vGbAFNn3tStJ5/MobzbU4YOvmcW0Jb7LNH4wFzHPYie3nDTH2pYNMtCIT0/axBK1Xq7ZpWWnC3Nsp+ttiKbqOUQumqO2bamq4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795227; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bInQE/uHeOJXFSRvTK95+xxJ8i89selJqzUmDfHwl4k=; b=X5aW1HVxvjX2MMyvzm2HQBrU/2L3+gybNHK0GHyl6G+S35pgP1+4rD6T2k/LAxacy38hdwsg24q46eVFZXLwuHj/u6KaMzjj4GCYe/UouOZGPqpqK3Y4J4CVQ7aC7jaouyx3alBUmaLhsNXzO3Jf91wNKkKSrNT3IiQ0afRgdeY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795227701429.78196674054493; Tue, 24 Aug 2021 01:53:47 -0700 (PDT) Received: from localhost ([::1]:41344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISBm-0001p5-FS for importer@patchew.org; Tue, 24 Aug 2021 04:53:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyH-0002f5-12; Tue, 24 Aug 2021 04:39:49 -0400 Received: from mail-eopbgr70101.outbound.protection.outlook.com ([40.107.7.101]:20612 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyC-0007OJ-MS; Tue, 24 Aug 2021 04:39:47 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0801MB1780.eurprd08.prod.outlook.com (2603:10a6:203:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:31 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:31 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YQzkMeD4sAdVxR00xrCW+/TSYy58IGfHQTR2XreQhgJGk0W+GhzHgZDNqRXS6ghIEj1FFb/WyEXj6LkqZc7iCjDN6OO6F+Ap9LWRBl55RoLO2r2j1QSG1y6fUt2/ddSdxTzYszgzwKERLrXLxzaLI62jQfnDwU+TL1hj6s7YXgvz4VTN4M+9yqMLzf2TZ9f/fHZ5fAQN3q1u38CWMzzlIca7F466CBqUsW0v0NVKGiQ9n8+vhjFUgx0TuyMg36UijxXqMyei+8D2SQLbT450DhYRULwRCBuuNh+beQT84RW7bJDtLI6FnPON9mVWuoY7IA3md66sTogUDD97zpxvDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bInQE/uHeOJXFSRvTK95+xxJ8i89selJqzUmDfHwl4k=; b=eY7FMzrbQf329Zi6+uCwlR4VbD8Y5GlGpT92N2qF6zsZK8a19P4ueXSD5FNOwuADMfVLzEbBgNoWopTd9Tm7WsAohC4qgvzBjJjD7oM6C9ctJMQm+WgPtq6WwNfNtCrztJ398QmO3u4dulN0+N838MJJokoy3kDfLerZFyO0Dtg2ZII7hqetHWnKnKxMABtB+8Bby+686HU9jwpoNZV9XyzRDCmkGP95kHG7C0CT5KiehLGnwaGvz1R3g+oGVVJfcPKG4Y/1Jma7lfDimv/wzpuB96hQaDYVWxyWd/FnD1yLO8/LW7msRYQHfPBGZAs5MEZirkY1xpXJ8u4oHfMNMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bInQE/uHeOJXFSRvTK95+xxJ8i89selJqzUmDfHwl4k=; b=jRKR51bUxiYY7zx8KyMsHv6gE2DM1IpwQQMRLSO/P9NB9s38bGqwu6BjENhfXHS6XOAExFfz7ZmqQev+bPa0myOIOSN3hAU3zhsjOZgOJMtssHCDlSLMGRLmUfwnRBv+QgEPC6UqRpMSf2eqj/9TD2A/pEhxUG3bz9pv2kGCErQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 10/34] block/copy-before-write: relax permission requirements when no parents Date: Tue, 24 Aug 2021 11:38:32 +0300 Message-Id: <20210824083856.17408-11-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 291a3f49-8fbe-487e-223c-08d966dab137 X-MS-TrafficTypeDiagnostic: AM5PR0801MB1780: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n39OvZPNA7Vw85pOeonq7tRoKoCgTDU3R0B8LJi+8+iJ+9jfBP0LAuOYyFsSrx5x6Gq7yaPGupaN/Rh1xkdLhuuFwy7ESpkfAVRFBVvDbjGa/WIvR/MI6DRLA4Zj7mat3uZ/h7MzGYIMjxt+Q7asNaUZVHhxWhl6ig1hR/WwppeizVDvBiYy24pqqhO+CNTr4G7cQHzeVPJW2PCtpY85dMW+AZ10GtkQXHlYaCcImVpTq7LsBRVGmqFZNN8d59XMKLypqXTmVm+Y88Vdapn65wFhR9XPlzZfCZIlkWFhcOjOlTddO+BgCSsPsa0g61KJa9Q/jOzMKxMa9t/7sOW2zx1XQWWxBYLs8kXlEaDcoc9kGizCb200rTasUJwI2ZoT5weg4HhDwgu09omzu52bACWrTCEtboFne1y0e4E+VBeGoGduA6KCHTHyqnWl+pqtsIclAAuD0VRnm7wV6MjKMyZSE4vqR4LzBKC1jNzwxCScLL2ZS0sKwaOp2ADIgVKAAtGvRQTN8lgHO9a5ObRDQnEF1QsD5fiFiNvxTYUL5VcsCeWeRlutir9kbB3oK3bgLUT9cgGGA6bTdb2Vb7l7ovEe5MNSn5Sok/3JzlZPNAupw9cP8par/Iw0y70jC2ZHVNWmKXcpqYiPugjab+Dg2/MAjZmgFxVatiNQ/IPCqVMT6Y1CVMvMfWnyqxjypwBlfQ7yO1+cdBk5marfWlTjuQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6512007)(83380400001)(4326008)(66556008)(66476007)(186003)(86362001)(38100700002)(38350700002)(36756003)(316002)(7416002)(478600001)(1076003)(52116002)(8676002)(2906002)(26005)(66946007)(2616005)(956004)(5660300002)(6486002)(6916009)(6506007)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?1x6ZLOl4bh985vhLLMGjhjoRGuwCTy0445nBrkO6ZFrsRvSkLNXo9mfo4o5x?= =?us-ascii?Q?4He9zVq2tV9Q80BbblYqrgZ3+ZZzWg119m3TijbI3Y2INIB4bEPo5M1eef+9?= =?us-ascii?Q?YSivC0JGovVWkF2RsurvDcW4g07VOwEFYUHko+PVKAP3kPmQWs/h8M4YUazF?= =?us-ascii?Q?rfsvK5/H9m2t73uSXz1dJmlrRNoKaYzbNHyaQwK931/PPMTWVYxZlTd/32/M?= =?us-ascii?Q?NyVpP6mWzlGhq0lf/2oLLV5jXDI9pwMEfJ71+H1O4V27Uw/NiuJBgBJS3wba?= =?us-ascii?Q?KDzAn66IHNpCwNE6P8QlVqjXrIJJf3pt2dXzsW2uf4WRAVG0Law/GLl9YUde?= =?us-ascii?Q?twb/r0nm91TVL+OHhT91a/lubjAhR/kyjBKjO7viZL2/HwlXwCqqMg/iXrxG?= =?us-ascii?Q?6AoeR9ajqr7ERZiE0yttaeWbI5MsWsneqq7kb4wkxB5P6Rq73vZvxR10TNqp?= =?us-ascii?Q?McTw6OXkFTJc+wqZxAbp7/yibQ+JxpS1WhHIw1lDZsBl3dcNGFOL3Jd+qdqP?= =?us-ascii?Q?Qtwe9LNeXBtJymxmD7zFWa6d2sTDB8USKKI4sbufkT5ooLSZVqxcUjw0TiYH?= =?us-ascii?Q?sQPhCSCOzfcgl+LbvtTyGj3ZQdELZIZA2JZpZN4PbK+/FvhDpMTBaSBof+Cu?= =?us-ascii?Q?WIXAGxZGLorlmrP+dNbHE4P1IK1ZmAvyMHL1lC9TqOp1q2oyKXEqj0PoCS7D?= =?us-ascii?Q?mjmTIPR23Io+dzpFOY6KzUKfaXS8/7kiTNT97PjUviPTdEhB/ClRTWJJgE5W?= =?us-ascii?Q?IMZw4MJJ/nxOgVZ5S4nbPQp8qZ8Pr+7tHpxR9eiWYqpy999b6IYFvjit9Wf7?= =?us-ascii?Q?LuwiDquCK24nX5ZtkYY/8ZRao57BUUQO4VD/KmifImldkszCzWUJiQULSn57?= =?us-ascii?Q?lrEjI3KniM63qkHPr53drTOxrNSqmCErT5qpxb0Y4h2ViIWwv5Aw99/G/3B4?= =?us-ascii?Q?DX0wO34tbyQ7FXo2tACazlHQpp8XelWGNvi4b1zOghoX9OtgAvWVvrG/9D+6?= =?us-ascii?Q?izHdc3pVGe8Q/ZlfhWlUPNPmqHKFNEcoUrQRKQjjdytQDxOAB4xzCps7Myif?= =?us-ascii?Q?wF9DX0yDD7cZPwQA4W0mTmxBN21joK2KOBXVgsQKjJ1WQICIBNfmk+iC34/S?= =?us-ascii?Q?CfaWpfssva0iPIQWUktxCOg0LzgR0eCsJfKvzaBzotBP0bwGJpx1GN23Lnx9?= =?us-ascii?Q?gu8ZW1Aa2EsoZBJYqnSnk91mjQ8l7hTvzS2qSPScSXdwDCn/+nAAzC7jY+pa?= =?us-ascii?Q?o7+N9+Uq03j7Yndtbd06P953Yxt7Up+RZEb6P8KjsRLQ15ugPHX5I4EMXrJt?= =?us-ascii?Q?dRkE+F6zYnu0MU3yn1MZEJ1o?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 291a3f49-8fbe-487e-223c-08d966dab137 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:31.3203 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4u+YIqjYaRlf/QrU1/uLh5J99Hqi7PBU7TdMJHyjhRdV1a0bkbP2YMdKNYDYclSV6iqV/yXR3wHUWb2VbZQCUIV2f7V5rCk9koTGlML23XQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1780 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.101; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795228145100001 Content-Type: text/plain; charset="utf-8" We are going to publish copy-before-write filter. So, user should be able to create it with blockdev-add first, specifying both filtered and target children. And then do blockdev-reopen, to actually insert the filter where needed. Currently, filter unshares write permission unconditionally on source node. It's good, but it will not allow to do blockdev-add. So, let's relax restrictions when filter doesn't have any parent. Test output is modified, as now permission conflict happens only when job creates a blk parent for filter node. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 8 +++++--- tests/qemu-iotests/283.out | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index a7996d54db..2a51cc64e4 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -142,10 +142,12 @@ static void cbw_child_perm(BlockDriverState *bs, Bdrv= Child *c, bdrv_default_perms(bs, c, role, reopen_queue, perm, shared, nperm, nshared); =20 - if (perm & BLK_PERM_WRITE) { - *nperm =3D *nperm | BLK_PERM_CONSISTENT_READ; + if (!QLIST_EMPTY(&bs->parents)) { + if (perm & BLK_PERM_WRITE) { + *nperm =3D *nperm | BLK_PERM_CONSISTENT_READ; + } + *nshared &=3D ~(BLK_PERM_WRITE | BLK_PERM_RESIZE); } - *nshared &=3D ~(BLK_PERM_WRITE | BLK_PERM_RESIZE); } } =20 diff --git a/tests/qemu-iotests/283.out b/tests/qemu-iotests/283.out index f2b7219632..5bb75952ef 100644 --- a/tests/qemu-iotests/283.out +++ b/tests/qemu-iotests/283.out @@ -5,7 +5,7 @@ {"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": "= base", "node-name": "other", "take-child-perms": ["write"]}} {"return": {}} {"execute": "blockdev-backup", "arguments": {"device": "source", "sync": "= full", "target": "target"}} -{"error": {"class": "GenericError", "desc": "Cannot append copy-before-wri= te filter: Permission conflict on node 'base': permissions 'write' are both= required by node 'other' (uses node 'base' as 'image' child) and unshared = by node 'source' (uses node 'base' as 'image' child)."}} +{"error": {"class": "GenericError", "desc": "Permission conflict on node '= base': permissions 'write' are both required by node 'other' (uses node 'ba= se' as 'image' child) and unshared by node 'source' (uses node 'base' as 'i= mage' child)."}} =20 =3D=3D=3D copy-before-write filter should be gone after job-finalize =3D= =3D=3D =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794981; cv=pass; d=zohomail.com; s=zohoarc; b=RDxJhBXv82GmxQKGTbDKwslY6Ig8LC4JpLT2zwcAP9wd4ZfRNsTL8ikgegB1M9KPCW5J1nU7AdmBomet2HMJrHG7g2nvpPDiqliR3/ZLQMip+txvgeFCCxNND5h6o/j7ZFueJCW6jOMFWuXIDsgzQZMuleiCy/SBfJudiNXBSvM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794981; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1N2uiVLFU5ZMtznDXUsWnweG+NBu3A9QkTphI8xiDcg=; b=cqfpfycRRrpnxbgT6tSZ6t5cineDgOhqcIiLUqiE/T3aExy8NpDrs0axi77XsrLhh+LeQ7p8h7l8FzEG1EU2/K8hkr/EedzIDOQBwxWTrgoeO/rizGOUaa22+Ekh42f+0RJir3IBKD6C51SR40IFuEFfYHsox1E15h6NsiakrnM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794981696175.3738012815278; Tue, 24 Aug 2021 01:49:41 -0700 (PDT) Received: from localhost ([::1]:53418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS7o-0007nw-NO for importer@patchew.org; Tue, 24 Aug 2021 04:49:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyK-0002ku-Rr; Tue, 24 Aug 2021 04:39:52 -0400 Received: from mail-eopbgr70101.outbound.protection.outlook.com ([40.107.7.101]:20612 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyI-0007OJ-41; Tue, 24 Aug 2021 04:39:52 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM5PR0801MB1780.eurprd08.prod.outlook.com (2603:10a6:203:39::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:32 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:32 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UP2tTsMG6D/bUZkOs/QN48KuZoO6+yjcuHYaGBx2QmWi+e/q6q4b8OhJe20PTiiak62HXPENh+4v3CtdD4PNRiSF5uavDg8Y/eZZJ4CzpG4MNHp+rDAk4E+M57nosTX0HmUmB+Z0Xi/kgC6I2P9QSdlUfPpMVOWLvU5JFIyZ3zl6pgrrQ2kLHG/8Y8vgpmfB5/uNgz9JklqkMChgfCsD9SRK/TJtcDwT39IfNPxT+1CZWNQBbVHzCD55BHfQWby/Y6J8YU5SOUVbmpSYXL8oDpR5Irz6B3x+zYsot7QnX1UBfckOcK4Z9tKub0ig6zQZXBiYBTUixcuQJI1LVUf8Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1N2uiVLFU5ZMtznDXUsWnweG+NBu3A9QkTphI8xiDcg=; b=in7bcr4TwYtjMJXJMWa0WhQTzjcC5narGHuN3YBEj53JVwzgMDPDza8tKMqcsHGA2OV4dYLi+iMuTthDm7OrMdiyhpYHMoOMyzQyOiUowuRa40J8OlHzLfEZT4gpgjGty2OogEfYLOTsxbS3/hIzCWnNiF87itjNojB92EtuOEliMSwxbToNVSuM4iPgoxR5QNJJkkZaOobe5ICPx1iCpkHNikIi1+bVFP2hcvASanrbvHSqmhs+s+KdNJ10jnvb41Q++4nGya8ZWIYmChx/yXhwxvlCDR2n4A6S/1nDG2FaUBqjNlU9nE8Bw696Bza/4yo3ZDM/fXiSZT7oDi+Whg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1N2uiVLFU5ZMtznDXUsWnweG+NBu3A9QkTphI8xiDcg=; b=OJzSVlK+3goGihXVBjuz5RqwcSc1brO4FVbRZi61eCHttFgXeN+pLtTaclJbbV/h28JP0cK+n0ZIecVTwyIkgFqRwiSt3jSXDlXPxb60YfQ51KzW0/xgJeqj3++5bQ3m1iraFRNMB/1Sz6oXzftR0qTy1OEj6RsTMjBdlQdm8xM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 11/34] block/copy-before-write: drop extra bdrv_unref on failure path Date: Tue, 24 Aug 2021 11:38:33 +0300 Message-Id: <20210824083856.17408-12-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4d268a4-f200-4534-09e1-08d966dab20d X-MS-TrafficTypeDiagnostic: AM5PR0801MB1780: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:243; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AJkDn2KL6LCB9SSsD1xDxpkp5PORitfuX+eGrw450FB5xaXNzoivCZ41NDx8vRyHbi+rTLZR50bxg9XFYlpwCetu+fX72/pdB6qcjU6E/3Xyq5yJH8a98xR8YzIhyHgDPf2EXXjdcyyGi25iNeekJHzp4I/SubMtshtlsRu3YDma0+xQnXBLoiqCyYyceOIaGbpOflU59kR672BgcEiUDBSsgaHSQK3//uwuT3egQOzDeVevgCeAHT0nZ/Wx95ez5GEOUGmsUmAnZLRM0vcOuWP5G5iVgkK7mJveze/Rf9CyXr/zYgv4xfXjBYNDzyQLGT47PkIRWdLfZhaJxcPkS82n6i1pz+0tOOJ438rVFVMjxGvgp3f2a6Ym0BY+FgAFdPyXSk+OGiwcD7xjdsJ3l+UxxYFepjY8qkhWWbE4tNRM0BpXrbSjgEI9ZvabTJM6T3VblloHIsjuPfDssXDNwAMUxbwvzAmNAp2nKpn9YOAIn4PlaBjs0Of4jPuO0t3RHDVZA0igsWEfz33Edj75PZsFklsQSl7j4LMPCy1r544aKUrz8iRCa6tu3tGi52wPZcdhQSwldEXBvPSbOoGqOtaduiTIYfuuoKHvfeSjFfSD4+G3zbvDtRM6XhMlMA/qkV5v6ea24JjH+vVdCYwTBRDA+fB+lQ1/Icyu8RyGpdWYTD/nQ/d1V34KF34xy53ONfMeEyJ4gNEhxSqL0gNMcA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(376002)(346002)(366004)(396003)(6512007)(83380400001)(4744005)(4326008)(66556008)(66476007)(186003)(86362001)(38100700002)(38350700002)(36756003)(316002)(7416002)(478600001)(1076003)(52116002)(8676002)(2906002)(26005)(66946007)(2616005)(956004)(5660300002)(6486002)(6916009)(6506007)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?tSKrk1Q0M+DR/TXiFRhmUxZTwLUe9dSL5fRx38Gn3AfN4o6WPE5wTRwRYYeN?= =?us-ascii?Q?6wlDzyfD8Jc5qcuJg5bqswk2tGeD7QvNVdPXZZ7bv9xcC7ruhpkn9MUCahPv?= =?us-ascii?Q?X8PXEtklkFgp75nc3nq4MGhYKffnxAFTHJOysTEXkRhH0vcKtvgvlkwkofQb?= =?us-ascii?Q?W0fj4T3XIjjaiuaqmFp8iwf76MTMxQKtFy4/fQdWoSd68VtdVICokRF9k4BL?= =?us-ascii?Q?v0QM1/xAADsrmpSPDAkaG+12NjtT9tZLArb8WIy6o/rPNigJ0xTfhzQjearB?= =?us-ascii?Q?yxPtHOjFABA5hwLhCaSlEOTONcntX1fWWwpoxJmaltp2p7Q3jz0MWTrS8AlP?= =?us-ascii?Q?ldp0uaGXxc0V/2/lYL9UYI9YPJ9SkLMiEIiguQ8vIbIdvv3h7fLkA3Vjrfiy?= =?us-ascii?Q?FTGpWDAUnybb02LQp1Kd4iGAzT/bBNnAHFYxixyX9rKe6EhOXMi7+vkljDtw?= =?us-ascii?Q?LUtbc7qtIwcCshWWKqitYjTp9PvlDLx7fmY1hWa9kzLGLPpMNiEFMbbhMQjc?= =?us-ascii?Q?uygt9zlZ1zVQnjB+sn9pII7/rDk3076q7brf82BmNlJeJ56o0OkHYLgYpBI/?= =?us-ascii?Q?tVA7JRebAB5KhaNpXZIX28ihhBpvfOeoCFwND80zwm+joH8HKqBpkXvqKx5Z?= =?us-ascii?Q?cLf/oNRPcVsB9nUHBAhcUStg8KgpvR6zlByqlAFHaA/Hb83ONXRa3VbjwvNJ?= =?us-ascii?Q?KbO7KQQ8WXyB/fd1RBH//zrDTGQKeH8cJucfTr+GvO4J81Kn++0jIwqH3Duj?= =?us-ascii?Q?f7STZkD/uLeaaQFBDh8BUzmM5ziN6D0Rs3Ao7WVM642Hn9Oik5vR2fRi8ruY?= =?us-ascii?Q?fvwsUML9nBDwjhNMuZHW9nrkCWYi8DLMutz3/Xuvt0rpUpJmJj0RJ2HzAnqk?= =?us-ascii?Q?R6IQ0tQOXEtlhW8XLtquVkqNE7mlDF0sO2E4/z7uuWv+nPaeEeg4595BMNyp?= =?us-ascii?Q?AZZfJnaTeIaRvrlS5NVUzD54OKSDABkNQt/ytghxl6iuEpi5PSO+YkSkBK61?= =?us-ascii?Q?qxAKW0h+PVOeFTcTdXbPcUz+t4B1MnSHcCavcy4cE8Gxxe53FLFGy1ILYsZ9?= =?us-ascii?Q?jt9Ca9X65C0T6XzEiPgEbJXs7zc+fgUyS0U8GM7Gdmhyz1FlECYVhhVBOs8n?= =?us-ascii?Q?gqL/HiI9sfVePK/yJGDo+SXwjoEtTqBKcgIOxoryXPCR8MUvhBqHHTN28tBy?= =?us-ascii?Q?e2j39UQm+zn0bk5wsl3lA+6gxkMrmvENkX6554K2OaMLRo10Exgc45c20E9i?= =?us-ascii?Q?husXJkmSUBg5lA0nEwiRRxWfp57IU/+x479MB2yB53ySB+qUJUKki2w6pGMJ?= =?us-ascii?Q?LF3+QgKlS+xZM6VkYbQcGHaD?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4d268a4-f200-4534-09e1-08d966dab20d X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:32.7092 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /HfGIjUYgdiC+01+YK/xepmSI2O+PSVFR9Sp9OxLDaD9T4LyR/M7newSXUtQ/kfgWc03nooeseJp4V1uc7Z3uhBRI/xxRLZ7lRYtYIAi4hA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1780 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.101; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794983341100003 Content-Type: text/plain; charset="utf-8" bdrv_attach_child() do bdrv_unref() on failure, so we shouldn't do it by hand here. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 2a51cc64e4..945d9340f4 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -201,7 +201,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, state->target =3D bdrv_attach_child(top, target, "target", &child_of_b= ds, BDRV_CHILD_DATA, errp); if (!state->target) { - bdrv_unref(target); bdrv_unref(top); return NULL; } --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794962; cv=pass; d=zohomail.com; s=zohoarc; b=OGfNCU+Lx5Rz8Avi1oB43EeP4K48vlgToPUi9tNadoGysSQXeJ6lr5998oownxoabhzVgzV36njjkIA18NGEFbVjx57CZqXTtPjJNDx/Eb0DZR0fqh/TQu0n6j6HDKF+Ccl9BjX4K+doh0SkmnZdM3bhcbvsOCi69qHHZy4wLzY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794962; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IAZ8w5qdaPUsW8UWJ6qFAmiuctXcyXUw7XJ0bYfnYHg=; b=DlLRQDH3kUdJQ5+gYyItneFzvFNwz7nA+KD/kpxG1m/uloK56qYdLLQsm6q97xTtZK+qzQzEoNpp7WxCWiroE/ULQL4rCcyu36X1WsK2ogzu7vjISDL8s8WRrhTYcv3eBgZy20i/5GHBpE8Z8i3/iLLnczH9IuB686s16agFtnY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794962395572.7976169783818; Tue, 24 Aug 2021 01:49:22 -0700 (PDT) Received: from localhost ([::1]:52312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS7V-00073x-Cs for importer@patchew.org; Tue, 24 Aug 2021 04:49:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy8-0002WM-K1; Tue, 24 Aug 2021 04:39:42 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy5-0007US-FJ; Tue, 24 Aug 2021 04:39:40 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:34 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:34 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z40Yvm6YvhNkdjej+Sg3NkxzdWvzScd85f26qZM+NPuIF9esUVBVcN2UBVYrU7F6HvKtPI7tmNLw7jGbjuMpvIroDucmHTS7gDdDAYHLhdgmueC26lOC4ju5HyeBaHxrFonvElKVvpFuLC4ydLlcHCXqDeE+4GAYlqy8me4PSJrvxTw1QoMcwT6v7y1CMagL+K9pAqOXyyIwq4pmR3vgLvSQJXmI6vNP4sd4hzSp4pBTmmR4sAXXOw9AZ+ta7vXD2Sc3LvWVSZnIi4LhpapO/F1i08icPybGuMq/Dd1G4W+y2X4VGw1f3lcGEIgsb9I2DYHBXEZcLnInjn0gmow7Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IAZ8w5qdaPUsW8UWJ6qFAmiuctXcyXUw7XJ0bYfnYHg=; b=TkErza99WMaJi7hbmrFJ4SMo0PidZqYg15eMNt9hzsHTQY8zTCpreO7GoO6OAh/rNyFBGSUQE2++w6IR2Dco4WtaCsgIH214x24zb5ys9ICe6tf6X6gJr7NFPvygVRs5Ibdog42JVHTzPhIK/676uHtRRZBE3XLtOKgNlylJRTIoF+klJTAr2de+mVJdMHAMJL3X2xJKM4OIBoEfs/8R3h61y+cyREX56XGXNf5RHZvVJ6/GOXuJq4bgoRKMqW5A///nNc0uJ3EKGD1eOQJzEm7YgOBjF90eBLoAtuV51VuIhk72otnF8K4VAmzrNcFkmIYBoATd6AmdZl4JjO4P5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IAZ8w5qdaPUsW8UWJ6qFAmiuctXcyXUw7XJ0bYfnYHg=; b=eN6FBRaMdpjkZ3BUk8xV4+9QXd24OVNBmX9QkwIKVIKYTw5ehSMEU+d7jB91n3nfFl7RXS8nf59Cw7Etgzf4xF/E3jr28MO3YIE5mvuSHdBA+WBt6S2ue5fl/7P8oX1q/LG9QhYSswQlz9MMPJQBF7O2/YBwghkQDqfxkXD26pA= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 12/34] block/copy-before-write: use file child instead of backing Date: Tue, 24 Aug 2021 11:38:34 +0300 Message-Id: <20210824083856.17408-13-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6fd2a9f7-4230-4248-833f-08d966dab2e0 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EQdIl8izL+ReFujLUTzZX0EXrGuM+H6Rrrlpd1H7Ux/cz0JjBx1nM0gLkY935X7fAn3UGZeJS6aLDlAgXcwYb9e9BqTKbt0Qh4T9w+esW8wUquWtwjND+gDHs4mjgoKJ3S9H5AuPJVDbF18lBVOLZmyNHX1xcOPcSMS9nDBvmLq6GbCa42AfhqeYqTsoDTVPMn5VmRZ388J/x7VSt6sLiyDh/Tnzw6aGXmrP2x9fBIXhRsaUKeYuKTSdQLWDI+Z/2iHMEXoa9a09mCAr0jcxxtoTRMirTSiGV/2XlaDvvcOyAWGV8to4B5f9OyOWBUFDaVaZ4CTXHvHAjXM9DixPywUuicsCAKfUDL/uT5mQIgmELs920mCfvqUlHEyZBgjw+y8QLD2Nm6DWY38n+fNUudeUeRITrDKIQ8VvGkqlT5fb+pKdCzM6Dj7JkYYZ9r+2FleN4jkq/nR+lM4W86IGKBuRRhI2VOZSk1FUGZX4gfIOEE1TqpixnSU730BndJb6CatdqgzSs0GgqeMst72+6Yld7kEieUOuHobXSlAQSdZRJqLLM9inl2sKILg7QjLH0vwimDB6IywTYnGWw3CYExJTBIwFbTEZPq8qu8/61yLybUaHEiJbVJQf/ZsnMhXk8PkgOMrHBNgA4Rp5lnnZhzA8OJ/GlpwO9pKhNx7JmT+766SZM78eAPioHRs+D5zswJn9VQRiLS5EPTfai4a6IA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?qcWN2IpJgaC6qeipCSXunwK8p20zTR804pfl8b3v9IVaD9JUS+GS1bR+Lx1t?= =?us-ascii?Q?oM1au8+4vzw9Ol3RTBWyWY1VlGQ5JET8Nr4UU107labjBcdQVT10u3Lm13Oi?= =?us-ascii?Q?q+CDNd797eIq1EhEjCu/uSzaHTgzxSdUddBMp34lJG6oIiemLsoNTvG14o/w?= =?us-ascii?Q?nhVEUs7Va1iSArXO+OJbrwJNsYevaVAOMjMYKbDuCM96RNo/RHCgqP9dbYO1?= =?us-ascii?Q?sQ9QGUkQopZTnEacMO+3lThrDyL/6VBWuOxlByIVE9nKYWZym/eFzCd7Fd0m?= =?us-ascii?Q?ghrSiBL+ZaEpSIeY6Mu+68pIhJMzUwJ4kn2xUBvH6PJcc/aLVx40ErJa+ONE?= =?us-ascii?Q?/mmaDe3+l0owCt7P5pfNih7T1+ZkwC0Kcr5wMcuOpsP0p1x2mbFBko9HDozh?= =?us-ascii?Q?zzy7qw6y2fWIuWL6+FmtL8JKW8lzYlNVJ6u3qLYQkFg8M5up53nsQCFsGuVM?= =?us-ascii?Q?laJ6QtWUHDNM/y2nvdfqGl+rZjaB4s8r1FM1KbFyFTvtp8ZtaccJAyGIaMbJ?= =?us-ascii?Q?LFRmFxPZzWEiZ8mHAxVLiDNBCgWif79TFUB1FNhTkPSSP74plK+rkFkIXvSs?= =?us-ascii?Q?xbOtAP0POgBWdfJE+RSSC1DNHKRLTmjZhn1ggV/zJHZkDJ9PpSNrQPKemC8V?= =?us-ascii?Q?UvyYAN0TYQ+Xh9jJmYeu4CfMQ2m+QzyNX3wmYISQNa5Dc5xfzS2+SdL8Kt1S?= =?us-ascii?Q?rOoO0yt87ekVXbUQhqvQiZio26N3rTux24TknDJWv7ehwPShjtirPIEzCFSX?= =?us-ascii?Q?6OyW2u4+JLGAvjQzFGj6MX93HPmNY2MUkQu/u4mFlajdrx8qIwTGHgabMUs7?= =?us-ascii?Q?pdqNVW+zGchSAFms8GqKqB7KLhY7oa7beaJ7CCy7/vWlYF5QrXQF+b3pGwNm?= =?us-ascii?Q?U98CUFjfiQq5YkvKvr0TyVV2Mm6jSOnkqlKWRcNYQQRDIOVibpuLxOpV1yNv?= =?us-ascii?Q?QhJaCL5bcYlFkBSZ9t6psjfwPe28MBN6y9Vms8e5UpaZtNW4Y1ivqoQk9WF7?= =?us-ascii?Q?R/WSxoOcTcadWPmjNNBxu4I0UIeW/J4H9GfTSdrOv+NdAwcGGfFhOQVdjIS6?= =?us-ascii?Q?NQD7nFX8TX0ScFSHPj5lODGLeGqzZW05jqNTGRmK+lYvpab67ugM3v7mRnHs?= =?us-ascii?Q?dQKILjb04YfTm8lDxXZWn7c1UAbdEnwfcy5D6G0LTXF6T9vISOew/bkZDQyT?= =?us-ascii?Q?wbgai3aIJc0uoy9KGu3J+2Nj0Ip467huQStl2RtjLjac3P4S/uqOxqWrecIM?= =?us-ascii?Q?5PqHxFLTYmYBGYEekgCW2Ua4p3vH0nXqMCywUNetDCK+FctuXcF3AZXDNTAk?= =?us-ascii?Q?ooLbMHcR91NIfM1peted0TdX?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fd2a9f7-4230-4248-833f-08d966dab2e0 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:34.1011 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZgAi0Bu8TUCEyYrhZDwskfvJ9sBDUOHzhKM2ncPdJ65AeZCxgWFlj6MdX+tKzLo43BQjZ+lUKYDm0qkn5ZbOkxXVAlsu7M6BHGEwpRCif3c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794964353100001 Content-Type: text/plain; charset="utf-8" We are going to publish copy-before-write filter, and there no public backing-child-based filter in Qemu. No reason to create a precedent, so let's refactor copy-before-write filter instead. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 945d9340f4..7a6c15f141 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -43,7 +43,7 @@ static coroutine_fn int cbw_co_preadv( BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) { - return bdrv_co_preadv(bs->backing, offset, bytes, qiov, flags); + return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); } =20 static coroutine_fn int cbw_do_copy_before_write(BlockDriverState *bs, @@ -71,7 +71,7 @@ static int coroutine_fn cbw_co_pdiscard(BlockDriverState = *bs, return ret; } =20 - return bdrv_co_pdiscard(bs->backing, offset, bytes); + return bdrv_co_pdiscard(bs->file, offset, bytes); } =20 static int coroutine_fn cbw_co_pwrite_zeroes(BlockDriverState *bs, @@ -82,7 +82,7 @@ static int coroutine_fn cbw_co_pwrite_zeroes(BlockDriverS= tate *bs, return ret; } =20 - return bdrv_co_pwrite_zeroes(bs->backing, offset, bytes, flags); + return bdrv_co_pwrite_zeroes(bs->file, offset, bytes, flags); } =20 static coroutine_fn int cbw_co_pwritev(BlockDriverState *bs, @@ -95,29 +95,22 @@ static coroutine_fn int cbw_co_pwritev(BlockDriverState= *bs, return ret; } =20 - return bdrv_co_pwritev(bs->backing, offset, bytes, qiov, flags); + return bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags); } =20 static int coroutine_fn cbw_co_flush(BlockDriverState *bs) { - if (!bs->backing) { + if (!bs->file) { return 0; } =20 - return bdrv_co_flush(bs->backing->bs); + return bdrv_co_flush(bs->file->bs); } =20 static void cbw_refresh_filename(BlockDriverState *bs) { - if (bs->backing =3D=3D NULL) { - /* - * we can be here after failed bdrv_attach_child in - * bdrv_set_backing_hd - */ - return; - } pstrcpy(bs->exact_filename, sizeof(bs->exact_filename), - bs->backing->bs->filename); + bs->file->bs->filename); } =20 static void cbw_child_perm(BlockDriverState *bs, BdrvChild *c, @@ -186,6 +179,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, top =3D bdrv_new_open_driver(&bdrv_cbw_filter, filter_node_name, BDRV_O_RDWR, errp); if (!top) { + error_prepend(errp, "Cannot open driver: "); return NULL; } =20 @@ -201,21 +195,32 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *s= ource, state->target =3D bdrv_attach_child(top, target, "target", &child_of_b= ds, BDRV_CHILD_DATA, errp); if (!state->target) { + error_prepend(errp, "Cannot attach target child: "); + bdrv_unref(top); + return NULL; + } + + bdrv_ref(source); + top->file =3D bdrv_attach_child(top, source, "file", &child_of_bds, + BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, + errp); + if (!top->file) { + error_prepend(errp, "Cannot attach file child: "); bdrv_unref(top); return NULL; } =20 bdrv_drained_begin(source); =20 - ret =3D bdrv_append(top, source, errp); + ret =3D bdrv_replace_node(source, top, errp); if (ret < 0) { error_prepend(errp, "Cannot append copy-before-write filter: "); goto fail; } appended =3D true; =20 - state->bcs =3D block_copy_state_new(top->backing, state->target, - false, compress, errp); + state->bcs =3D block_copy_state_new(top->file, state->target, false, c= ompress, + errp); if (!state->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); goto fail; --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794689; cv=pass; d=zohomail.com; s=zohoarc; b=abZNQ5AQshONse8TkFVPPU9m9J09DZgy1jk9VH7LULTl+kmjnYs7DS+ZnizuO3JIN3GiFv7FRJvM5RMwrIffm/uFCrhDOcX/Ix2FLb5/HlVX9JQX5J9ie+jN9LJnSmyUKy1jnX1blro4CxBZLn5xBMFPnsirc9wriuoaTGsgya4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794689; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+Y9zwZ4FG3jmKMdQhuvSmetg9/t2U2WeUmbUBzVXQuA=; b=kvrkBNmvrDY+5GcpYooakqnL7Sexzo75q/6sw31eVA5tkhZpCd/dZ3p9smqHND7NWUjbKUfyOaw0DcZEVtsyDh5eX35/WbSoOu03tWnFq/uxMnw3cKYdgINZVEm2f/rcrg5OvHD+vJtwHoIHrBT6HKxQvwAOf+652h3Acx6IkSI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794689141463.20271462130245; Tue, 24 Aug 2021 01:44:49 -0700 (PDT) Received: from localhost ([::1]:36538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS35-0004sZ-CU for importer@patchew.org; Tue, 24 Aug 2021 04:44:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyF-0002dO-4T; Tue, 24 Aug 2021 04:39:47 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRy9-0007US-8g; Tue, 24 Aug 2021 04:39:45 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:35 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:35 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fsaZg3t+B398tfCi+/4p7ygIIgKv1m1Wcd0uoGXvMuFGyyIGGUWevQAi70wM+6ZR+un8xwmyfNfCeNzZ/1tTlulMpa/fPJgkW0BZo+DF4k9MbzCMVbaniVg7NDr5BVcK+FKp19mAU+FzUg0lDXkcwmE+u411xCk2JhErFbeIuJDBfcYIPglgfKMzO+yQCRUnme5KbFrJ7MZso3DtJGljil8IxAM6Jkw8dhF4hK0A7ZibIW2f6PJtapnvhs0w/9SejtZZ4iHt+w8MJSOVwDeVV+pYc6xBp0PdyeWCToq4SnwH8v5OWZs0YKwGN1QVft5ZZJxMiYlVi0edfxrR1rBpaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Y9zwZ4FG3jmKMdQhuvSmetg9/t2U2WeUmbUBzVXQuA=; b=H7N1rdJBat2VC1z4tqDEhKipEHQ3+jp45JJdaiH6E3Tw+rtgyhFyP1LxZqg4eN2WeXec1zQMEmKef4Hu3jZQoxC6T8i7MsdzTIOyMyuUCp+/mnyoV+iR/+jypMQnFXQPVfAC0pKgIUwuEIBMb+B3fRPZLX0ad/GvJhsP9LJahCz51YchWlu/Sg0QDb5dyWvhd/MXxwxr9FYDbJ+fCocyIrvo0LYTMT75IB0BbBPjjIM+5oftv78tpUn/j5YVeLj1mVtHsOz0bp9DA0g+yqsXXTCKZoJimC6lCk2w5M4ucsH8TmdR42WCrbzihawEWH3sI0OYrLL+0SrjDkipqS2LBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+Y9zwZ4FG3jmKMdQhuvSmetg9/t2U2WeUmbUBzVXQuA=; b=BbrvYLHTgzHjp9CMYstjDFFNgO9TkDAXKnmgW+a86pNU1TQpMM0M3p69e1cYrShMetgm6M2DCPFAgPKitVE2Ljo/s5Dv66FIYUb48NlMAilhlFcY0QK6UtsqxuByaS28d+SA6t4zrF1HXBsHjlk3FTVsvY66obxVw5MV57nb6fM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 13/34] block/copy-before-write: bdrv_cbw_append(): replace child at last Date: Tue, 24 Aug 2021 11:38:35 +0300 Message-Id: <20210824083856.17408-14-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d947d736-f8c4-4a10-b24e-08d966dab3b8 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1013; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h0pS1bzV4dsXj66Xfg3jWRYXmY3swgL/4AvzVzOZ9+nP414AKfm13i+EwX1oLfC/BqeApJiJdM/1tBbb0b5s3FFvXUXgQbxAFeHdAR/MRCmD2Gu9kvt4nqbagEqPwYDJqmw08LVWjV7sbiSUxXH37mZwxXELillX7Vd92hK4MNHKuH5snWS4IDIcovecTMlk+qEM3nr6UqxogeMpoxwWqD3oEfSEG91xMUoWRKwUn4hTBswh8zfOtduigwG6Kk0FlUv8jw21fuZRU/gJDkGccWGe2Rxw7MaLQLrmVTJ7/q7DFx4nM0WFAiw+is3Qfd8pCRJU2E6crfONI8lW044qvrsm4HTZ0IPvbIkVePS3qyuqB7E6Hb3WTdVoTAI3VNJ2RlSOat+ayFPgYrwTN67muHn3OcXLHpcVsDeX6/TkyZeV4kWaQxbOGh3eq/ZdwF8MuYl4D5uxVnpHEVNJhHMLFe9wO6XxT33IdRz5Wgds4tlgnrxCpWugycbhRenzQNQewJEevw4zb+j3l7GFTQ1dPqF1ddhP4G6GA8ezn5gi678lrxCYWd+gCdBuNqkAAerAssI4BpRMRYfcb8O7IdlyOl+Hpz6QjFaSs1017tv1dqTxex3kdXE4vaW9jNslOKPostMYDGyjIhbnYzCZqFaAK2hVXA+0Tja32DOir4kmgQWe+eKSt/QE9OzCysW9e1OYhzIZQ9chswblt9VE/i+a/Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?x3PzPwI1wQZ/1SrJ/+EWmtUOKTZckz454Ie7588rATQ/zzDbqR7ANM/IP5HO?= =?us-ascii?Q?S+HEVnYaf6gHwfx7tikiquQXKeOV6/EGZaZhpPWN6NpFg0JMpsfY/4piouXq?= =?us-ascii?Q?1j2cOGN1KjE8fkwPbRm54jr2Tx5LdsNDzhP2u7zsqfGK1EZNMp1tIokn40L8?= =?us-ascii?Q?Bx1f56IJ/mWcJ6CEya9WZouw8j+/Wn9Q59soR3UaBFGnZL4+gzAZyrWPpFzW?= =?us-ascii?Q?6GM66/60MsrReYXwlXlvbcy+ANYcorHeBFTXFqWDxr5qzsJau1Rchh4Jaibh?= =?us-ascii?Q?cOz7Ak5tPa3gf7ju5BxjchcXH9A4LcmDXEYhdIK1XenSZJIvcz5rg9W+nNUZ?= =?us-ascii?Q?aNOvNgvMsQuCciwbIxsRnsJvcIUr5hwYHaI/uuS3kYqnW16Svo3HNeYP99lq?= =?us-ascii?Q?/ttAQ+Xcv7Sdt5d94dPDLMiKeueDRD+J+oRAdC+OlyZqorekbUvgvWCJ1Ujr?= =?us-ascii?Q?JCN9ux5AzwKMJdcpWiux5i3+0lDRS42PVRE98f72cEQIatGyS2fM+eyek8eM?= =?us-ascii?Q?liHJd41kCbRgKKauaIpMSWA4p18iZLVp3ZMAbj/YRBJppJHiBRtm4MnrmJaM?= =?us-ascii?Q?tdWmaT9y/FF0FVMZJCXMTY7DrbzC2Q1PkTy53nt4Pkz0IM5nIC2lm3xerQdT?= =?us-ascii?Q?TjIjZqGHmy06U+yV1Ig/OqgmCPoepbDRlQiEv9GMOD/5V3vZjhmYmud4bBXw?= =?us-ascii?Q?Gc0Tykdm8ToxWC/61GTudXzMAwCdbnD9yKWe/RMRJc/DmAEkZ3h1d1lfzwx0?= =?us-ascii?Q?kozZd+E8Rlnu+RGzfUPmTWYI49aN+H59r8JHUua2Mqj7Xp0F+aIcNC+nkhZi?= =?us-ascii?Q?+c7nl0kDyyL2MVnSBfr9OyTgm0bORSRMsMkmfM8BcfhRzErUfLgP34oGRpMm?= =?us-ascii?Q?EemKxd4w6GpbA6vhLrSUPE7RUzG6qkvGssqbJRQcUvK/RFGGCa790NrIejyM?= =?us-ascii?Q?zrP0tp9IFc+mAKsX8YrJJncyMQcCxuz9kuePp1NxD3JG811o2T5/qZHWbnnB?= =?us-ascii?Q?hxep1nlf5zfHWlkyBVO9uizWpoT8Py07ym1VK8TPJBUienm9G40qFYyNY/J3?= =?us-ascii?Q?drul2ntoNAyj94NsaH1SqCf7hAEx1gxFd+nZ4Br2WK/5BwbwH86cSj0k3UZP?= =?us-ascii?Q?0kKa7Fq/nqw8UhUZ3LFLdjAaBCZDY8IEyt829TlVEWLe2EOdtZD1j1E+KRDA?= =?us-ascii?Q?oz4dwXKEL1v4lqrLTP61ZADhc5HS5dM+x1iA3l/HuX8lKMLF1fFBpgqLVk14?= =?us-ascii?Q?fY2pe2P75naElcGmLLBVViSuW3NME3S29eRqANer/7iYvmizgBGss+zPUeDM?= =?us-ascii?Q?uNsXhCaTgv5vVlVM8TBVfb/E?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d947d736-f8c4-4a10-b24e-08d966dab3b8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:35.5248 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cvb8/XkE70Y6mN0WdoEBk56k1bYfPi4D6z78rw3sktCMbJTU/nAWVPFXJoZGgR5jQFbzV1Gfqr+m1e+R6Zh0e017PWd1whUg1VqoDeSYJ48= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794689611100001 Content-Type: text/plain; charset="utf-8" Refactor the function to replace child at last. Thus we don't need to revert it and code is simplified. block-copy state initialization being done before replacing the child doesn't need any drained section. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 7a6c15f141..adbbc64aa9 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -172,7 +172,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, int ret; BDRVCopyBeforeWriteState *state; BlockDriverState *top; - bool appended =3D false; =20 assert(source->total_sectors =3D=3D target->total_sectors); =20 @@ -196,8 +195,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, BDRV_CHILD_DATA, errp); if (!state->target) { error_prepend(errp, "Cannot attach target child: "); - bdrv_unref(top); - return NULL; + goto fail; } =20 bdrv_ref(source); @@ -206,18 +204,8 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *so= urce, errp); if (!top->file) { error_prepend(errp, "Cannot attach file child: "); - bdrv_unref(top); - return NULL; - } - - bdrv_drained_begin(source); - - ret =3D bdrv_replace_node(source, top, errp); - if (ret < 0) { - error_prepend(errp, "Cannot append copy-before-write filter: "); goto fail; } - appended =3D true; =20 state->bcs =3D block_copy_state_new(top->file, state->target, false, c= ompress, errp); @@ -225,21 +213,22 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *s= ource, error_prepend(errp, "Cannot create block-copy-state: "); goto fail; } - *bcs =3D state->bcs; =20 + bdrv_drained_begin(source); + ret =3D bdrv_replace_node(source, top, errp); bdrv_drained_end(source); + if (ret < 0) { + error_prepend(errp, "Cannot append copy-before-write filter: "); + goto fail; + } + + *bcs =3D state->bcs; =20 return top; =20 fail: - if (appended) { - bdrv_cbw_drop(top); - } else { - bdrv_unref(top); - } - - bdrv_drained_end(source); - + block_copy_state_free(state->bcs); + bdrv_unref(top); return NULL; } =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795119; cv=pass; d=zohomail.com; s=zohoarc; b=FlOHK2LqujVQL6pzGxKE9ElCXvc3f9VMW6Q2Ql83EG6ln+XHI/aCMpSryryz18k59vcbOBuCFjkTumx+tOt0bTPvSLb0XeCz9sE+ok9wvuUVyDyN6QdF1UUYAGgtXOp6CLYsIrPgEMFC1s4DrZyZJxiwlfKmXZ8/AzuBwF+WIYk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795119; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2CxcOwZdKNFNzBx0wXYgJ5RkseoqLR9SUNfi8XYqszo=; b=lrHkymwFXitL1hV969ynMXG3Gq7nKZDdwDYVo1ujByDOVoT7kbnBVYhVQul+ViPoqB4rUKX5y2rdV4jOW0HZypYFaiiOTg9MD6EmzbkEUtC34GQ83+gS6xjmSppswdr4xD8J0GBipOSpRkQlwmzF3aMmzmvsp0ur59ks+7r09iM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795119002131.48976603399376; Tue, 24 Aug 2021 01:51:59 -0700 (PDT) Received: from localhost ([::1]:33648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISA1-00054w-Pg for importer@patchew.org; Tue, 24 Aug 2021 04:51:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyL-0002lg-0b; Tue, 24 Aug 2021 04:39:53 -0400 Received: from mail-eopbgr50092.outbound.protection.outlook.com ([40.107.5.92]:39447 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyH-0007cr-E3; Tue, 24 Aug 2021 04:39:52 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:36 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:36 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eeg4laHNdiUsqaPd+74ab6OYfcIEWFyC2VZz/hZHuUUL6/GlumyeYwdYMPP6eQQz3holb36yHfombF66lzXUYL0/0UktUAbkdDIiNRXoCOChNGCUFBrY7IiDuRc5TXveKuK87vj+C7f5udZfsj9/KgO45t+PKnZlD8sivMLNf+6Y2Twf52fg+2F97R8mW1iC5hnV9OTPLacTcRRJQPbzShDtMku7AszvHYhJl0ddoOf+NysczTFd1j5p9AyEq/4ZizNPUiMvIs+SxpaOYyMnRAi9Pe/KOaFKRb19bOprfbHKYzwfUluu7llzp0N2fk4pfQMXJjOW1Hfs5TzO8+eRLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2CxcOwZdKNFNzBx0wXYgJ5RkseoqLR9SUNfi8XYqszo=; b=Y66j9xu5dzCVXGYJfEhMpOdmJn7xtKsHQPr1ArWWTF2sgm2dGjjzlbAC6iaELjpCA2FJ0IKcr483YKjBVIZKswebKFwoN1o8MPJ2isad8L96eGM/l3ajaJQoJk6IPIerUibW9mecxKAaGlAC34kH9jiIQT9A2YWyUg16f8zMlGPWvkGbY7cyZjKpg1ndmFPi3TGRoMvGdWOOhJ+dxMd/SfcbKUp5tHJDBW65WWF+JtNIAg+vNHeVAgQebNOH+b8pDGNkXEKiMF01amwRgc0vJT8IIWAMK/ngYeqlQ1FMRGdyEnJRvS5X4OE9CGX7pcCCv5IvmrP/jRjuEZVr/tMw0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2CxcOwZdKNFNzBx0wXYgJ5RkseoqLR9SUNfi8XYqszo=; b=NeRyf1q932WBtlMT+CAgNarTlsJijm3Fomf6QqxBXnlAoN2ryVYS4uZSixILRHfTvQCuKfh+GsgnHf+TJKa9iTgHIC4klgHNwzo3Ipz0ZnJ9bfB1xrttetQS4gKvP+toSBgLjiy0KTEOYIUhS6Xdxlm79et7qiu0jdVLxusluAs= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 14/34] block/copy-before-write: introduce cbw_init() Date: Tue, 24 Aug 2021 11:38:36 +0300 Message-Id: <20210824083856.17408-15-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95d70fdc-e7c1-473f-cab8-08d966dab491 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y7RoUbhPwaOYH7LBRBmfT5naJkT5nhnM6YC7sLUfqolPMpcGwgz1f12AdbPAzXnhlR+z5rZtEENnsZPqeaLJxt3r9Vxnnb2msHD4d6C/7QuvNw7iMNbF0yrx8MbOyCG1KgO167T7WzB9YODX9CRhaTxvrCiWPbXouwy4A3hx8C77Aepth2WAAXosxZLCcJ7cjOQ8Tzy5D1mhIotLaubbaYBV+UCmoT6mFrEHMy9s2ETJTd6QAcYJK0tPqqfPKj7OkaV9mte9wJmfZ1lgTHIIsl/NFvIxaHF0YYFZkZIzm2+sCc9wG/z8bdauZKNdCkBLyLpq+V13oM/TPLdl0lDU9irD/YNflnEEugYpuqBNBejHSp7ha2Vp9uSqA9C2PJZyAlQKoGr3gBMTJlmRJdIvsxcXTlphOo9+IJzKJljRzF/NhjlMPI+5VL9EG2hTW4w7enoWA75ebaqhwQfl26HtaUziZrfZ3LnRRLIU/UyiwzH8JsVZnjiUCYl6oVOWM4Vk394BB3zm/ogKodJQnvJfHlmta8tML+dIrQ3/6fDf613Z2PVFJJBjqSRuD/1xR6dIQVuITR4UMN/eUBhkKJI6P0E/CBboO4oBtEF1gdR0ooNCx/98vm0+X4RABH9T5Pe3vWEk2eyRL0xw5oSIU+axoOVzDkjFukBGxcszrdDqw50e5WpFTLL/gPYHyK03DRP5HXjKUncKT35IpKMHWgCOqg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZYFF1wXXAmEuX8BEjFkSEmBVPZpifa2tV5suHJRojDwsD1UpPVC2fb6dNHvb?= =?us-ascii?Q?wytze9k7T+uuJvvZSfcnwP9Mc5vi1Be2V3utn+4W31P0hpwuRGsXJrVppREy?= =?us-ascii?Q?Qlw/m7td6cBepiSbluTQYUg5Lcl7D2b3VKv+X4j6D/uYubpa1PrN5hOAI/3m?= =?us-ascii?Q?EOUR1V+W2XRHMDJHCqpORAN1QLv9I5w70bcmCN6dCA5zlJaJEyS/D/1APV70?= =?us-ascii?Q?Xi+X0H/5+IU7WgCp03x0xHWp7fhrZ+NM6zgvCEGKsLPRlCkjbB9zhe4+YI1C?= =?us-ascii?Q?7tHvzBjIHNoW8pYJUl2rt5G3Wr+gnz1os58A308+MxD1YzmUPfE4ZMb4er9V?= =?us-ascii?Q?unKiTnuzhhbMClBgg2oYb5CGKhvUyts5w7ox0OwqZpNfm2xbLWNfiYZHsYP1?= =?us-ascii?Q?7uMTk3JYSgGqaCpXENULCz6j1IVxtof3AJoC3CXrrwMyCRO+k2MvrOdPVIQt?= =?us-ascii?Q?aCH2fO25WHXsR2W7zlh2J0TuIZrB44yZ+1k41oVgoYCcK70SJ2vZdhLOjpzP?= =?us-ascii?Q?eCM1wKUEi78k5537JrrCT/Qf1EhP1DJSi7wdBZVMCg2xNxVCJBxOZGCa5/fH?= =?us-ascii?Q?b6G5COFv0/+zzNRsXcSd9/NHG0Y4NWIfkLUy7GwZTWPAKJ5lPb5aWvNhAbqe?= =?us-ascii?Q?sa96i6jq6186x0bdRUo256T3MH9SDRYFUhN+nt4MuAQqwH+U1MMQwHbzl8rc?= =?us-ascii?Q?Rz995oSrqnRSx+G/NclJTKVvhrRfNFhNOy2L6SH0JDQfJdsliiKW8YhivUg/?= =?us-ascii?Q?ZuFRbnvvt9RTozAAiYftmRNeCXKcSWB0lYiQ+MVHdkgGXe4+0B/P4ie0aOnn?= =?us-ascii?Q?3ynBqCAaICk4xUA8pMfcWh00xWN+/GogNhoPIAziWQVtRwPtlExKr6VGljE8?= =?us-ascii?Q?+BK4QcdnwS5rKFPbmu5rUq1VWGTS+Sobt75OXZVSLQEYBjH306DXQLSG4Jlb?= =?us-ascii?Q?HExnWI7n010eS7rMsSfQuwsusSB+W1BvpPDQ0R/q1eFPlHOqeXCH+iQHoMAY?= =?us-ascii?Q?ZVWmHgvNru7UuUVReqBhGRxu67i1yTdY6vgODEjrcotM3DQ1ZAsp5yn+4vDy?= =?us-ascii?Q?n4oJXRHvHNcNlgFw6/w2DokK3guQ+/pAwymROgrvLbTgDwHgKABkkO387vQz?= =?us-ascii?Q?bt81KmdEu9yRZePQgm4X0Ufh6vx94i8ihg4TYDGOJQdxIPpLr3MkvXVrPk5a?= =?us-ascii?Q?qFGLHGLmnDmqMV9cSUjiwX+ntGkwbJdYeAf0Y9Eu0zNd0+E8galcZdhVLwYD?= =?us-ascii?Q?89jdznPnKc/3dqulW83nT2yb0MVJqw2kQfSatF6oOc9qWIC+3scLyw1O/GWE?= =?us-ascii?Q?+3+98zV+wqqXiaWaAAD8ANfX?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95d70fdc-e7c1-473f-cab8-08d966dab491 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:36.9237 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wkmtqbDOS5MVfzEwPWK32cOAvT7kNz3uO+4PsWH30ya8kMbXAVMFwcTyrN/vfSnBF3+kD/JrONLrALhK72z3txf8+gdOZzK+32qEt4PkxfQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.5.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795124344100003 Content-Type: text/plain; charset="utf-8" Move part of bdrv_cbw_append() to new function cbw_open(). It's an intermediate step for adding normal .bdrv_open() handler to the filter. With this commit no logic is changed, but we have a function which will be turned into .bdrv_open() handler in future commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 69 +++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 28 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index adbbc64aa9..a4fee645fd 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -144,6 +144,45 @@ static void cbw_child_perm(BlockDriverState *bs, BdrvC= hild *c, } } =20 +static int cbw_init(BlockDriverState *top, BlockDriverState *source, + BlockDriverState *target, bool compress, Error **errp) +{ + BDRVCopyBeforeWriteState *state =3D top->opaque; + + top->total_sectors =3D source->total_sectors; + top->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | + (BDRV_REQ_FUA & source->supported_write_flags); + top->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & + source->supported_zero_flags); + + bdrv_ref(target); + state->target =3D bdrv_attach_child(top, target, "target", &child_of_b= ds, + BDRV_CHILD_DATA, errp); + if (!state->target) { + error_prepend(errp, "Cannot attach target child: "); + return -EINVAL; + } + + bdrv_ref(source); + top->file =3D bdrv_attach_child(top, source, "file", &child_of_bds, + BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, + errp); + if (!top->file) { + error_prepend(errp, "Cannot attach file child: "); + return -EINVAL; + } + + state->bcs =3D block_copy_state_new(top->file, state->target, false, c= ompress, + errp); + if (!state->bcs) { + error_prepend(errp, "Cannot create block-copy-state: "); + return -EINVAL; + } + + return 0; +} + BlockDriver bdrv_cbw_filter =3D { .format_name =3D "copy-before-write", .instance_size =3D sizeof(BDRVCopyBeforeWriteState), @@ -181,36 +220,10 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *s= ource, error_prepend(errp, "Cannot open driver: "); return NULL; } - state =3D top->opaque; - top->total_sectors =3D source->total_sectors; - top->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | - (BDRV_REQ_FUA & source->supported_write_flags); - top->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & - source->supported_zero_flags); - - bdrv_ref(target); - state->target =3D bdrv_attach_child(top, target, "target", &child_of_b= ds, - BDRV_CHILD_DATA, errp); - if (!state->target) { - error_prepend(errp, "Cannot attach target child: "); - goto fail; - } =20 - bdrv_ref(source); - top->file =3D bdrv_attach_child(top, source, "file", &child_of_bds, - BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, - errp); - if (!top->file) { - error_prepend(errp, "Cannot attach file child: "); - goto fail; - } - - state->bcs =3D block_copy_state_new(top->file, state->target, false, c= ompress, - errp); - if (!state->bcs) { - error_prepend(errp, "Cannot create block-copy-state: "); + ret =3D cbw_init(top, source, target, compress, errp); + if (ret < 0) { goto fail; } =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794812; cv=pass; d=zohomail.com; s=zohoarc; b=NWTtSwoMIbzZxwNjli8JqASIUwWa5OcDWLSDfp1qNmU3v2mgGwuqKoxyoAKerSz4ZosINPQX6tnG1/L8EJpo+j5GGMjD3BP3jo0QN0Lb4I50+DeLDyuN2iXq0NSKQBCSrJom7Dn/4rhDGhZ1DskAxLP5nSX3snKSJvt/jlJ6HGM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794812; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s6nSqQ8glRSbCauI3uUt4rS18W8WqtO0o2GDIenmgro=; b=L5JHEzya9VGBJ6X/f2r5Cgdr0RJjOtv4PquI1mMlXVM0iHOjXoXrbeVoWepICnhPwHYxZW2QTGId2Bh7VInKG9lH7Gv1VgQC4JGye8AkNAM+rqfFjKhtpHKJrjbw0HBBNKzcMVzdA70vzcT4mnfREWtkXUcfwcdxk/7yjC6RCpU= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794812809598.9360654835185; Tue, 24 Aug 2021 01:46:52 -0700 (PDT) Received: from localhost ([::1]:44960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS55-00024E-ON for importer@patchew.org; Tue, 24 Aug 2021 04:46:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58848) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyJ-0002jN-0u; Tue, 24 Aug 2021 04:39:52 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyG-0007US-Ly; Tue, 24 Aug 2021 04:39:50 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:38 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:38 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eFK7SX+SlLQe+k8EObuUOSt2XUdwnuMBPNun1Fc3qvNeni1eOaev4NlItr7TrXd7lGyDmBB505KvlhCcBKW7oVroDBjOEdH4kLTAZuXBpS6o2u8KiMVjVAuwrkeEEa2X1vUtfrDT62wp0btai1crFiairBM0kmcC67jTRfc92MxsCCp1sR/TmSUhjVu9JsT2AHa85JHmJpVKeGuVSlBbOJrSoOKcoR3Ydjk6njMHf8neJlpylJbrdG5RwnqYZDa28R9hkKSTHyfNiQs9g4sUgiGtzGaTqz23xVkNdp9tMnpWNpPSQwq+sRXw02rjE0NU2JRKj5UgGjCfg0WlRUL4Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s6nSqQ8glRSbCauI3uUt4rS18W8WqtO0o2GDIenmgro=; b=U4Jzz8ObaoCWURnEKGZS0VgD+lgIXjHMFqlK628mISnsycgWuglt6Eqa6qjWKlXRSMIRntGPbrBNidnXBc6iSBIn1d3MhS+wuVx0cOvgFsOXhdy9/eGqPHOUR6id3eeg7vQ13MHS9egD0Rqzqx62Gjd7WVABlRIuWwgub1l/5TY0/l6w66ldnLPoNJHNA1j74Dqa06tIjyICzEvzBqnbtlgqcWTiQs4yXURLRtrgoogCjTzO8PsHaNriVvIGm6LoiZgK+9PVI/RS483Alb3ZWMhmYqoW0v8mi+gzPRRUoRvOiKQ7mS6IAeX31eqYI62MJ5Gj08V/nqSq0bZw8toeng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s6nSqQ8glRSbCauI3uUt4rS18W8WqtO0o2GDIenmgro=; b=YzJ4FLpxo4yw2XaNuqdvdaRlX9ZPs3JEsRj1ZNrmWVLdPdy2GoPzuq7+LSsVESqt2Duk2+v+SJ1V1RktAmEog4zut+WNG9j2eFkKQI53DmjMZ4iWEwXcXsJB0aLZg+mq9ALlrhzI0ZocxLHOGMI1Cpec33GRT0jc2GPa7q9R9Kc= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 15/34] block/copy-before-write: cbw_init(): rename variables Date: Tue, 24 Aug 2021 11:38:37 +0300 Message-Id: <20210824083856.17408-16-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95c5e15c-973e-44dd-fcb3-08d966dab562 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:186; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JL+/KSaX5LQRqBkTAXIO2CoS7fe6yCTf0cv5wi10VPMF0xcge6dnhIKi/eZsg1BVcqjqe6XB/szV1/sl2IkeC2aryAr5tXaPCzRkwVs9v8M76lVOJq/sQ/2I3m3j45/fo/d9qdcnNrra1miOLpwh/jCB8H/wM2dyAI2mJRoJLsKbNrKrgUOV4bYaIL4/O6BTGfN6w/rPYiHXs57bCq3s9bPudbkcdYsO98faDDQNnh9CDjQ06apDWuZUSUavGh5PFuZLox/VgFCOKW6y7N69+vhxN0p6bRjFAK9ujykLL4mfoTEBGeL5q8GpqNGst7cd+u7GryCvrFH8iPewLZfaDRJYNZlEIVjl8KA5B60hhDrdOr/beSgzce4PWbzWMeFDtNoIaL6iyp8lGJB+hto21OI+uwmvZOw4th8OgtBIAIzx+6AJj2CQmlcLa0zGfsGtbdDGS2oTRsbZeDDP3QMxEmH4USqAs+iUpb2Ihut6+EL0iOBodIh8J4U9QwgYNCZVe5cy8S98E9t/lbiQ7mAw0WVWfv3EKNT8+O/hJrJWitjJJqPvGmzHgDVP7yM+2TVtpjh1z6p3yUaqtq6/8kNWicIMg/CEEakJi6iK/1NHBpyv+yRWvitVTeMlNAjLNiV/hhEobybLostxpFs6I36u577mWtX0xdgHRNTcwUaFlQbYroQphROjeqwuGA9SXWSOUJnxhU3jO0CpLEPfY23O1w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YuCBZAH3fEoH22kd4FHjLP5ig2q4iN21zYYJam0JZxHI+DipiH8pAoBNVTYJ?= =?us-ascii?Q?OW6J7UzZDs35FyrbTYG+Q2RERH2chm1PKBvtAj1kCPF7eLKt/2tnOTTI0mu7?= =?us-ascii?Q?ZcaXe6UKWuRIPhBHZTq/Ut97V4DOjpT1jcLzwPWCRSAuDgYOlzUJNzvUMbxC?= =?us-ascii?Q?WBSgHta2aHJ6rqoXEh7w8WGvmygik9qpRWqBGMHi995SosT8d91e0DgjXC3j?= =?us-ascii?Q?UGoUrc/8fTzyyIXkVZXmANQdnfA52wgf68AkIInIqg/sWQl/bqZsZQ4TxEzv?= =?us-ascii?Q?aPiY0/w7VVAGpA/q6VFxYNtOHf4hTSozYJMoEQJY6DYDZdAYn8+aq3D8acyF?= =?us-ascii?Q?b7j8K0f2tyDo+NH6V8NDYeBLtYpsxKglhKdfeTNAe91ywSujR5HKPMC86g1z?= =?us-ascii?Q?Du8NCirFaE4o1THu6f1i1x+exc30qMpQPlCu6mSBqlOWnb1qkngpm3hbl7KD?= =?us-ascii?Q?dX8o6QqL4ODNHk4cBbUEJdlxTSPfarjqgDT+E+PnQhpVD9bYGSsF1h4H6MW8?= =?us-ascii?Q?OIfZQFCwZX46hQ22ConHz7qeOJ6gCgNSMaxvLjoKvDARrXzSitMloBFYiLIr?= =?us-ascii?Q?mYLCUkpmt68ZaL5pbzb35wIMmHCo14PlCV25veCmA8ovfwwwTr9+s/uc5xhn?= =?us-ascii?Q?+SIlirishAmuaGJHJmlHxvq1y602mL/VGkYNvbOXmairMFY2kyeRPR41gN6L?= =?us-ascii?Q?2OqUIkYPMe8PAEQCGyMpvLWJh8Bo00Xeucdiwl3ANCkzK/O06+6fFiI1bbzA?= =?us-ascii?Q?1IdflqgUWjsBMvPu0tKSd/CAs4p04xaNuWtvoWPK3HJxoWSL0CoheYBK8jU5?= =?us-ascii?Q?kXztPGiQAAi0dHV4U2lajnDJUKJp0v0lM4NKlJEwUpLJNEEV9e8e5tNxPkFn?= =?us-ascii?Q?ZTwniNBKzanMrgIo17Eo5KKBvE1HfpIktRtwKJEd5FHuyV/DvSZXcYFb3YFR?= =?us-ascii?Q?3yYgKY67tdvwSSZxWwmxbV/lYx/hqS8RFqlR8qy3qkjodv6W2bTP4OcTj6Y7?= =?us-ascii?Q?ZdyrfE2c6kD17Uj26JabxN1IdA3F0DUlfsrHMuf8eKnJWyNJtXNk+y+MCLP8?= =?us-ascii?Q?9z1hDK8gmFPfRbWy953qhlmx77nTBMQKar9pgKf6V+xj3M7e/Mfpn9OsBIVj?= =?us-ascii?Q?jhkpkXSwgFRlCOjzannr1kS0HttExAZUr9kJhDZ1EN2JYzBtItgbZEOhiNng?= =?us-ascii?Q?zwxrabkY392AiXWkG0Vmwko5JGqkIzN/fRrnsOnXlMarjq/rv7tjPYWAiLfR?= =?us-ascii?Q?7BylfbMxqPJ8a3HzdS13PQIMxQc/gs9LqPwBGMoQuLIg/zShIjnT/WqeA32T?= =?us-ascii?Q?ALl0fwXarr1hcrcTwJsu/ZRC?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95c5e15c-973e-44dd-fcb3-08d966dab562 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:38.2987 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: msHvr9dC0a8XMbJACgJKVNFXm3ZniJfb9mvfxpbnddiRvbGBBeRH/EKCkLOp29n4J4q6xB+zj5oAcvMzHzjmXfzhR5skHvcdccMaQXP/jnE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794818720100001 Content-Type: text/plain; charset="utf-8" One more step closer to real .bdrv_open() handler: use more usual names for bs being initialized and its state. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index a4fee645fd..d7f1833efa 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -144,38 +144,37 @@ static void cbw_child_perm(BlockDriverState *bs, Bdrv= Child *c, } } =20 -static int cbw_init(BlockDriverState *top, BlockDriverState *source, +static int cbw_init(BlockDriverState *bs, BlockDriverState *source, BlockDriverState *target, bool compress, Error **errp) { - BDRVCopyBeforeWriteState *state =3D top->opaque; + BDRVCopyBeforeWriteState *s =3D bs->opaque; =20 - top->total_sectors =3D source->total_sectors; - top->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | + bs->total_sectors =3D source->total_sectors; + bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | (BDRV_REQ_FUA & source->supported_write_flags); - top->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | + bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & source->supported_zero_flags); =20 bdrv_ref(target); - state->target =3D bdrv_attach_child(top, target, "target", &child_of_b= ds, - BDRV_CHILD_DATA, errp); - if (!state->target) { + s->target =3D bdrv_attach_child(bs, target, "target", &child_of_bds, + BDRV_CHILD_DATA, errp); + if (!s->target) { error_prepend(errp, "Cannot attach target child: "); return -EINVAL; } =20 bdrv_ref(source); - top->file =3D bdrv_attach_child(top, source, "file", &child_of_bds, - BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, - errp); - if (!top->file) { + bs->file =3D bdrv_attach_child(bs, source, "file", &child_of_bds, + BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, + errp); + if (!bs->file) { error_prepend(errp, "Cannot attach file child: "); return -EINVAL; } =20 - state->bcs =3D block_copy_state_new(top->file, state->target, false, c= ompress, - errp); - if (!state->bcs) { + s->bcs =3D block_copy_state_new(bs->file, s->target, false, compress, = errp); + if (!s->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); return -EINVAL; } --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795235; cv=pass; d=zohomail.com; s=zohoarc; b=InaDVBMuubqAFwgVmeL8Id++5072e/30Uj5SN9SjzZuG7V93l+ccRqkVRSNMi5UsEuIqITGm+D5G6Ap1zUJaeRXM3E20l7nsNQaJJ9LLWDD77D0S6pvLWFUeZqB/gR38XFWt+DIkgeBcyxXIWP+4iEVC0dda4t2AupZ2vUIBo6M= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795235; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/q9xcd+/7Yq7hQ6FYf2psORRuWQaXyG4dc0/KfIYO+4=; b=bV+jJ/ogzjimhRY0OI0MzqPa9riaF6Myy5nw1PJe1ww2gir2UWH5CMTHudmj6tBsqr19CDsXYS41ilw0eHZpKxpgfLmTysGNpslbIbd6dByojCmtSlm0iPvOGOLGNfyAAZ8HyaRdY8Y9234okQdEt54FI5rTiad0AaG+ZebGxHw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795235496462.7786577906337; Tue, 24 Aug 2021 01:53:55 -0700 (PDT) Received: from localhost ([::1]:42052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISBu-0002Il-A4 for importer@patchew.org; Tue, 24 Aug 2021 04:53:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyM-0002qc-8l; Tue, 24 Aug 2021 04:39:54 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyJ-0007US-Jc; Tue, 24 Aug 2021 04:39:53 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:39 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:39 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZfN0/6XlVpOeJf98BOnCuMAX3HqXKm9jeMxhnbZk+U6kRSNu0T24VwkVP8O1wjP8AKYG9UtNs1sltaFejq4+O6k473EuLX6Uqt9L7+4/3QsVYfwMOCgk7fdQ+mCwGr8oImAW1XbBQAZwywOitTSK2b4UoAaEh2orEB4mYH4eOqcnzDqKHdQ7c7JI15UDjlNpI1fTgVOzYyaceeehusbjRYExcJHmkJfS6ufQsTTlmOz25qQvSUEU0gTKZpsbM1qLJk5+MJCpw0m+52GwIxjg4X40+RB6tXJ7CMIInRxmx853R291N9PLPzG5iIEY+kR93HdVAlixc8TC6hESkFmFgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/q9xcd+/7Yq7hQ6FYf2psORRuWQaXyG4dc0/KfIYO+4=; b=Buy9W5Puw0ZoI75yVKpx4duHxe1f8Z7YVJQvfmtibnqcPF1PiTtm/dGdMnETOuspSQMrj1+KPfAPkrIJhumEv2ct+YzL6IDebbS+SMJ7NE5VeuU+vjZ3Sa8TSdFCIFXQg6Gy6DUQ658xEDllPDQOYAVynK1lVHOVDvdQDsnTlKsw8bPiVluJmd3fvz1FSzEcY98nJtU2KCRnNfpAzQWIOEu31nN7B1m2+xBEM6YsvRNC3RC2ezjpBGc9uBFrlAURz6QSF1RD5I9AgTeLQv6KPjlQxZnHAQYecx2vewTMtzYb+ADcIQu/mRrPfaHZdwoWmjS86AWe2/ee0d9GdETJdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/q9xcd+/7Yq7hQ6FYf2psORRuWQaXyG4dc0/KfIYO+4=; b=Zeaw2U02bS12aDoBJwJQq4JrEURU+U9yIWuFNqcrAaaCoNEsuVGXLRyNJDBxW+I3R1STdjUfjrBGUDWACMb1V1Q4Fx0giWVehBP8uZjiGd3HI0hrp22+FLl+easCp3egbvQ46OwT9kGF72MBfVahI+3gfwIC/bN7M4d1KOPQ5NM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 16/34] block/copy-before-write: cbw_init(): use file child after attaching Date: Tue, 24 Aug 2021 11:38:38 +0300 Message-Id: <20210824083856.17408-17-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24e88b88-087b-42b6-0eb6-08d966dab63e X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:40; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Z7mk1FQFA5//cLNvjeVKKXPInvUiUF1A7WqF1eU8NbiZ50Ehgul2cPUKC//PaGGwYODYvoS87L6piQIHtZ+sBciK+Jr7t6NWsCsUw5Zc+qm0IUH0Rg0I/KQoYHWAY480yAApOcg6GcW20H2zO+XpIGRpwrVZkgVSCz2ngHKTOgbuP0fePa+FNXrAkGB8ZtFKBIscI+WnnkI53kHOOCGG2/OsMT5VuhTHf1G1/l4nfpiu8Ypyj3CmS9G+ZQ+pzMxFKbs9Q663K2G6IMMZqfW878F7Oghk0yCpgeJMmMay99nYICvjc8bE3BFXfho+qcNS/Y4E17wP8ebzADNw8Lly5V5oLUO/dswlGq9Bsl1gp9k4PvlUSUkWH1g/IyDVpRRqSO7G5pwMttjhj+ZqQr9SdqpzpG7XXfEOO9ojwk7rQ575SUzftMgpKdn2Gs6N/2fO9tSqM+0icMxNbpy/MJ5JQV4gg70gQ6W0v9969xIDFt5+aPuFtkv/bm2Q4wO9Cl3JmUc1NBOWhWTWKOcE6G7Ivp7OCEGD/hdR2pQmf7iic19q6bR16maYMQpid72XhBaKmVlrg6xVDVsW2Xc9Q2aVATI98tibDcGv4xrZiN2eOkPBaa1pA+p+h4W3l9RullH7qIqyFpRuSPFRpEV4c87w28BTw9v7JNnWincTQLReol2a1efPczX5kZ0lRdfkRA2UuuINPZoTSHTm08q8w1pSPg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?aYxu7/uCo8aAGy53AivZ3bk2d2OKHpOcgOimc9WjteSwLZmiZSmk9PdcpxGp?= =?us-ascii?Q?HnAVXbDCNXyi9Ng50XfW0DdO9xizxn9ORWYCX/Dj/S8TKzfAQwdmnxTGhFFv?= =?us-ascii?Q?je9vdE27gGDeaSMFttmhSPS0vJScpRKJDCHZ2KI5N11jgwj3IXmkTLJ3wiqJ?= =?us-ascii?Q?igAPAFkiPzRSH4+byz4S4IreXHYPzWf3jTTCbw//htWh5pqG0Y2hUYZYHBhS?= =?us-ascii?Q?Z7bZrHVNk02pwRGfdA/4su5bI/NZQ8hsqeF9gcO9PvorV01i8r+HwD5Ho9jZ?= =?us-ascii?Q?qI3f6fhBI2R4oX87I2pKcNwF98oZ65FOZha8PkkCHi9pk7Kff+tPMAOp5skn?= =?us-ascii?Q?wYUiFgm2nGR5oARZRs1KEZ2XfNMIVuABLfrgS68JPs0G6FKfpQVjfBLWmqNj?= =?us-ascii?Q?9bOVdRqibNkzJmvsqCzMfPYJJqKW/ppFPvOwF/LX1BtCxYGkALw7LD3oNrv2?= =?us-ascii?Q?GhFCBtOkxP9fixG4sY2i8ctgaq9DbAIXd8bvBBDBncj0gb0rS1l9wu5KLWwS?= =?us-ascii?Q?ztEzdmR+dvcWZNVRQmTr1Zpwdfkzu5s85Re3m0lgmWG6bZpO0MBlbKglf8ZK?= =?us-ascii?Q?alsJnLnYm81yvxRRin7dYmrWBI7PNwELB3CChRVq7okJ/WKQ9mJzmtVc9JZL?= =?us-ascii?Q?E/kvidbpkSvKTYRbhvFCm5NJz0Lwa8PSKpd1r7MxKc3xzqYxpduq2czW6bUx?= =?us-ascii?Q?vVQ3zGD+Uwkr7/KPA76wpjgfTRZEHpqp2x3n+vG0kVc1ZD/r/iXLdhWH5SoC?= =?us-ascii?Q?DvEdk7tVVYcIowkUTV2zJWmtgovny8AgBjUNc7me+X5VFn1YiKRT0ZO7rEnb?= =?us-ascii?Q?GwBGEd/IfN+7e0o8zEHjVr4S65f7FBuWhp5x7OFKXnWbaGW1P6fUGUvj8QcO?= =?us-ascii?Q?SN/bp+36ukugVtVoXeS2ze/kgopQYxTkPYHHM7fnox7NrUKvmRLrYUOOxks1?= =?us-ascii?Q?Az/D9KcVY4OT0Fcb184Oqv2nQsZKPJ0WfciF0scZNc2eJyvF2TuuG3McWRTT?= =?us-ascii?Q?D837DkwtONc1Z+7ALJZBnGlEGT7vqqmMwY8MERTtNgxM3aP3Gt16waThBFHv?= =?us-ascii?Q?g2sfm6EmE4df179B2lXnqNKRBam/7ckd4EwflwZj5wF6ksCPcs6XSRAtlWjC?= =?us-ascii?Q?LvExmNW6WzXgCJu29JqgVFPdIO5KESTgahj4gyZAcOn42ROAq8lSuEMR+fNp?= =?us-ascii?Q?aTh5+nl7IYewNsHWIr5DZe/J202rmdI2WtuGvSGHD213JXz8hwipOj4dvQxi?= =?us-ascii?Q?dIp8nHcHzrFZ6g5aaw4oklBdU7AeuMjQgJVQfLaplGPkmhKmFygbVsJBUIF8?= =?us-ascii?Q?NzVW2gSmi7lkn+U01BemUIAN?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24e88b88-087b-42b6-0eb6-08d966dab63e X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:39.7613 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FfsRsJAdBfPPkjhEWT0irt+GBB5uBIFHrJ5vz8Jw1ZtOqKuu0uXJp6SMeRpCQQCCIcHHPw52Cj2Csa2LChgbCAxvvC6PKuhZWgaFcOscfJM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795236585100001 Content-Type: text/plain; charset="utf-8" In the next commit we'll get rid of source argument of cbw_init(). Prepare to it now, to make next commit simpler: move the code block that uses source below attaching the child and use bs->file->bs instead of source variable. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index d7f1833efa..4858dcf8ff 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -149,13 +149,6 @@ static int cbw_init(BlockDriverState *bs, BlockDriverS= tate *source, { BDRVCopyBeforeWriteState *s =3D bs->opaque; =20 - bs->total_sectors =3D source->total_sectors; - bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | - (BDRV_REQ_FUA & source->supported_write_flags); - bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | - ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & - source->supported_zero_flags); - bdrv_ref(target); s->target =3D bdrv_attach_child(bs, target, "target", &child_of_bds, BDRV_CHILD_DATA, errp); @@ -173,6 +166,13 @@ static int cbw_init(BlockDriverState *bs, BlockDriverS= tate *source, return -EINVAL; } =20 + bs->total_sectors =3D bs->file->bs->total_sectors; + bs->supported_write_flags =3D BDRV_REQ_WRITE_UNCHANGED | + (BDRV_REQ_FUA & bs->file->bs->supported_write_flags); + bs->supported_zero_flags =3D BDRV_REQ_WRITE_UNCHANGED | + ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & + bs->file->bs->supported_zero_flags); + s->bcs =3D block_copy_state_new(bs->file, s->target, false, compress, = errp); if (!s->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795149; cv=pass; d=zohomail.com; s=zohoarc; b=e4hsRexKYSoyq9p5VCFypcxzIMeMLjaOYDMqVmI59jvNICW11X3ewC4uIUYJ8B+aRX1v09LZQbFWriR3RxrlWRk3hNxYvGKfcqvAd4rLHsna01qyvyR0y6Qxe3MeENd2ZXNxHYHrv/jW7D7ysYwFxKlKSDSiIfIEPgALUE1vwqs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795149; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TL+Dt1sAp3vhxXpWprlMvslntvmI9tK/UfQr63vTPKw=; b=HpTPpL6CTe718M5JGMC68aPeFgXeUHiVUg9OAVuo9IOUKNy+1Z22zEqbyQLrkkwvOzjmkVErsfK+Wbt5iSQSV+lAcJE9KKJbNq5D3qudfAbfirdfhFUu8LShR0/XSg7L1fehQXt7EGuPnO+MdGRMnAmvCr/qsMz5mpriMqjgA/Q= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795149572924.6174092556736; Tue, 24 Aug 2021 01:52:29 -0700 (PDT) Received: from localhost ([::1]:36044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISAW-0006gR-Bp for importer@patchew.org; Tue, 24 Aug 2021 04:52:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyO-0002xU-3G; Tue, 24 Aug 2021 04:39:56 -0400 Received: from mail-eopbgr50092.outbound.protection.outlook.com ([40.107.5.92]:39447 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyM-0007cr-73; Tue, 24 Aug 2021 04:39:55 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:41 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:41 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=asQZJrXb6A5lK9BAIzdb1QnZq1WJWD9s0wWSF4eL7V6WlQDVxpNfcVsRzXJ16NVP47qJTi3iU/dMRVt8nt6nChqmooVnglHZmRkJ+FBCObGfiF7sdfF+MSIf/VIg0ZtwrLK3QKR1BLeFcwkd82BkajoQ0mlhEA5EKhoXQO4TmmrfdPV5YTFSET/Uw92QfB0E8jD1kTW/uHTA84gwaHRiZaYjHRVNaRYSjLBvu2lYbRbGxx3TH285WaH3PcFZyHP/1yCkK0IowDzis3nEzda/1Jor2BF+FMijiG+dDO0ComTa8Jb6TcWDm4MrCZqy8XNIluwdGFfXrdvJMwVd3OymyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TL+Dt1sAp3vhxXpWprlMvslntvmI9tK/UfQr63vTPKw=; b=S7Q+7SlEBaK6hAfxcOFCWXqPA4xn/tENgZaTJAoIdpMKtUCq+ezuoU2MkgunjnsP7j2y+FsmZYFmDHi95DZmr252zHz3AcFLn+WzHZNi+Xrr39H9TlsjovKbEgbyayzq0ORam65b9gC9MCIW5I/nUmiimgKim53b58+piur9vLo3Bl9rFZF2ism+aln5ekBrNXUPIpj9CUmwLCAx91Igjf5C6WDyAWL36xonyKZgEoZGaQKe4OIed1tF454JiqYOvBo3ZbYeUzLHUueakuFo02jVoBnc/gPJk50/Z+zcZW0viuavVbn52TKGhgScLpuFZBFgzzMkV5wMq/6K5zLT6A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TL+Dt1sAp3vhxXpWprlMvslntvmI9tK/UfQr63vTPKw=; b=IPTCKjlsw74Epsj1xY6MH71BQW7CaNqghc+jTuwtDDvNPe6fQhXcryWZ2pnxzr2Wpg6PlLXwYkbQONpfW5B5ZSsE8I7xxpDrVHmpl5nBCtubiYJRQHeFv5+NlSS3vozVEefY6EM6rya9q0InFBrIyJa6NKoHdAzbFLl7hj0HPg0= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 17/34] block/copy-before-write: bdrv_cbw_append(): drop unused compress arg Date: Tue, 24 Aug 2021 11:38:39 +0300 Message-Id: <20210824083856.17408-18-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60cfbe40-b2bd-4607-c326-08d966dab723 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:60; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zN+XYkKXlw9/+1Lk2CNirknV3DVSkMvCTqWCoOPqW1N8D0Xgo6telcDvAkT00JdqjgNVmVnIOAVzgARcA7aI1XSpZ/G4DmKdlkrToqnha1qkRspYMnkGH+dGBZJSf4VwLrqnb9ovV3/jnF6t23kRNW5qmAMrZNG11fDKBtR6sZzovFXfVElxGXuuJaeYzrhza/yVIOWHMpNV72XDEIjbvhymEIMJe+OBxSB3m9Inq6V2HpQgN10EkPR1LzU59KA+9PAonyw6Yg9b/WCuNNvKALEAA6aFQp+0w7WlLrTu/dneT1tHi9+NUz1mYP2+tBRZ76PQB6dM3GfBfdBG7gv3f1MJSWB/veUiTAa1joYhoY6oerX0QlRWF3ShDDjXT/1LDGxo3mw3rwCIh1XctQ3byrUm5k4X2JKPV5Pf9L47mzfiedQNDNRE3xVyxAwXY8veGichW5JT+M4zGHODTb4n9yX+ILuDTb+/LlUtpmbNRRIsoLA8qwGrn8JRyX4cmOpc0WeuP1rl4hGXOT9uf+BtclHOn/5ymA8OGJrv2j/PpxCqnwdH36es5ziHZ67JwWEgB9G6dasoVwgZNOakMNjq5VOZVG7pQJbcjtJ6rfcWggJpju89LytOZNEcl0dHxyI+GLuBMitPGlSEuaVaAjQgTO/RVCcYjk7Y0fqPParAaOArZzt5MAAj7/w4XVkJTrSIVJUk4bsVn+YWzgOnpGq8AA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?/I/uXSQSmw2OrCbMl9pUigE/bFu+6VGGA5w3+jcXxME5wptYntDH7mKsPVQB?= =?us-ascii?Q?TbvW19va4ZSyblN3Gp74rbO9oA48S65qtq87M/+V1iWHB1+tu7zBJf2V6EcO?= =?us-ascii?Q?ICwE7X0n2fiEvoYx+EOfClOjzd3394MLPtsdw29c0gu1tq5OHa9wz3ud53eB?= =?us-ascii?Q?IvHBW5l+aD2ws3F+RVVsq10a6budKLliWITImbTMYFdTUCW2twWOR4O8eRN0?= =?us-ascii?Q?p9hFIQ6Frg480wlMIzKmnpVhHFbYVial29+CAIqKCbK48iNzQLvy13/TD+mu?= =?us-ascii?Q?9iF+OxW+z0mzSM54w5hATM5sfYnpo79yKsR+IYsKp5RfkLMC5H9MmjUb6JSF?= =?us-ascii?Q?rR33407ADuOwllH0HI4AQvUAfqkszECrCF0fjdRFLgZ4CMMB5gqXGUAJpxXe?= =?us-ascii?Q?K5JcsT7xssImt98a9hfGOUwo5WRdHoBD5RD4ssRqzUfjo0aRPDLgfJW4iZiz?= =?us-ascii?Q?HbkNQj1UhsdaLvHKEN14NxTkVGGbgp0BMFC8p9HXhd/Q1xeAy+fyqWNFHgwN?= =?us-ascii?Q?ZLr5HavXRnfH5p4PK8fxOXYyQjiOsaDCVbRY7rSUeqGX55WOZdQTuelH+Ve6?= =?us-ascii?Q?N9fp54Mbo8Wp01ccZL52vSPgZ5nexBl7AKqNWuiEgf5OHQ8Nn8ZJ9v67wH9X?= =?us-ascii?Q?unkChvruaorecP7nQ1EG11TXK6f/Yu/Rz3awJCBPU1Ir5+wby2CCAK+PIrRN?= =?us-ascii?Q?N35wV8wMiR3dbL6bPYJJiboEPbyRo+yCIvocKQJiYffbXEjv5mOTr0W6brSv?= =?us-ascii?Q?wMxEy85iB/eCrrH3qEguCt2rW9OxyocXSc0x/AZlaxbyFhJHA9RYFah+lepM?= =?us-ascii?Q?tRMPr2tVopnpaMrCXZ4uNsLQmsYOtTUVreII0VpaMTCUOjuq7IDLauqV0GHn?= =?us-ascii?Q?UyGqDtUFyslJwu72Lm3HG4aZWifTO1gKeoUjbSShb/7XiqUByPds0WTBc38u?= =?us-ascii?Q?7MHNDaKQPYXV5t0/9uH0mEyxa6q62cKk1+oPpP7NRvRe5kjCcl5hxsS4bF6T?= =?us-ascii?Q?Dq07YJo4v/ZBO6XappBvhbvDAi4MT5+6g/C+HKLnMUvxWWD4Nz5RY08PNKZZ?= =?us-ascii?Q?ftKUpj0ryPM6TvRcoL6NK11XW74lRKO0FcotLsWAHEWxMA0LVRyBUebfbFN4?= =?us-ascii?Q?dIIhAVBCJ/xWG59Zno3z7TqItz6Q1Ag0TbAwfPRVpzcOgf4NLR5lshepmmVr?= =?us-ascii?Q?yPc4F4Bl+LIBxA47AVnMx9UaZDCpUnzSBxK1rS9rldMzDKnb6BGj4fne+VGw?= =?us-ascii?Q?g22X9fkM8In0meIm4cJxHw9fly6NZ/RqQDr8HRrlMArAqA5V0f7+NgfdwWvk?= =?us-ascii?Q?+fwbuhRNa85FyfGnD4yOUjz/?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 60cfbe40-b2bd-4607-c326-08d966dab723 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:41.3095 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sun2tWfCnMMfrOOfW/RV7LtzvVcFEUCbS/X1AbPsX80L4Syb1JnuZ0OBnG6ZrZp6Cuh6t06ECX73aiMiD7EnwQZZQkJ3+h5xy3IBqxxiZxI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.5.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795150532100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.h | 1 - block/backup.c | 2 +- block/copy-before-write.c | 7 +++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index b386fd8f01..51847e711a 100644 --- a/block/copy-before-write.h +++ b/block/copy-before-write.h @@ -32,7 +32,6 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *source, BlockDriverState *target, const char *filter_node_name, - bool compress, BlockCopyState **bcs, Error **errp); void bdrv_cbw_drop(BlockDriverState *bs); diff --git a/block/backup.c b/block/backup.c index 83516297cb..4869f1e5da 100644 --- a/block/backup.c +++ b/block/backup.c @@ -452,7 +452,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, goto error; } =20 - cbw =3D bdrv_cbw_append(bs, target, filter_node_name, false, &bcs, err= p); + cbw =3D bdrv_cbw_append(bs, target, filter_node_name, &bcs, errp); if (!cbw) { goto error; } diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 4858dcf8ff..1e7180760a 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -145,7 +145,7 @@ static void cbw_child_perm(BlockDriverState *bs, BdrvCh= ild *c, } =20 static int cbw_init(BlockDriverState *bs, BlockDriverState *source, - BlockDriverState *target, bool compress, Error **errp) + BlockDriverState *target, Error **errp) { BDRVCopyBeforeWriteState *s =3D bs->opaque; =20 @@ -173,7 +173,7 @@ static int cbw_init(BlockDriverState *bs, BlockDriverSt= ate *source, ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & bs->file->bs->supported_zero_flags); =20 - s->bcs =3D block_copy_state_new(bs->file, s->target, false, compress, = errp); + s->bcs =3D block_copy_state_new(bs->file, s->target, false, false, err= p); if (!s->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); return -EINVAL; @@ -202,7 +202,6 @@ BlockDriver bdrv_cbw_filter =3D { BlockDriverState *bdrv_cbw_append(BlockDriverState *source, BlockDriverState *target, const char *filter_node_name, - bool compress, BlockCopyState **bcs, Error **errp) { @@ -221,7 +220,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, } state =3D top->opaque; =20 - ret =3D cbw_init(top, source, target, compress, errp); + ret =3D cbw_init(top, source, target, errp); if (ret < 0) { goto fail; } --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795262; cv=pass; d=zohomail.com; s=zohoarc; b=B5iv05rlPATKJy+C+vPJny4S51rqyKVoYeoVjQ0SeL2s/qwmBHHfC38L+OU+2RZeQsH3kM/qWVuD19h7WzvJdziZ7HS40IzlqTlJLqtBc8srhqLgRRA6TJeglXh1atHCga0LY7YSllIgPcC/8TJWbzK1VhRAb7QEIVM1zPz5/gw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795262; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qjtzCUW4BM3J8oxtEaoIJWjbz/Qm1wPX4vwU5oAbMMw=; b=BlmedPY0sxvt0jFqKVlLg5So4ZrbGaVhJzc5eKRc7JkRJbSmI+TQnLUwjkpNVuhMM6RXQOjRiBFc1K6HzEYGcFjZEfhdC9UVvFz6WBtcnmlFmHC1WZF/BIVj9ieG5VsLHwcCnw9dPIYIH3XhkDLa0JJTibTPdwLOewaDoHU2RRY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795262073759.8288611710617; Tue, 24 Aug 2021 01:54:22 -0700 (PDT) Received: from localhost ([::1]:44494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISCK-0003yv-Up for importer@patchew.org; Tue, 24 Aug 2021 04:54:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyP-00032h-AJ; Tue, 24 Aug 2021 04:39:57 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyN-0007US-2h; Tue, 24 Aug 2021 04:39:56 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:42 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:42 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZnXO7gxzoSfdZ5AoJTqSe4Xe6rOEyHXvnzsZ+deh/PDrr8NBfBYm9y6LYB3oOArAtgKTPnjFcD+HoEHyW2GSQHkSK208jHz2YXTdLIkSlLdSyloJmcK7MNR3DIInRVKGYF4vWDXuHrXCrahwK+ZlE7k7xG1MKVTX1WnWgffamue1lMRsSMWsn/B2j8g0H5RrJXqxEMH6AaAuf8UxI1MTqKeW7af5Cxg+q6g3Ut24F03qIpIHvTRaLcZsZsTBip5ddbZqUgGK6CNl0MvnoWSrcJT0eISD2OTM9PpS/VX+K71fGV+ubODtaYyk4wmICbcsxohjkIt4EnItHMowmH1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qjtzCUW4BM3J8oxtEaoIJWjbz/Qm1wPX4vwU5oAbMMw=; b=c96wwyxlVPdKZtIpyGUufV/RdwA9cH4W/9lBfTrZcIjMnvwuUBWAQLZFJST3OUT0jqFGV3AbgQWY3nCnSSCZWpzWiSH6AL9QqvkvzUBq5OpaCy2/NhV3hy/XJ53joDXI57j/7BhQuuOIaOtGgyQgMJ/ysf+n+4e0Q27wtzWDcSMCCkEqn3LWoa3wEc5q4Eyy4Q5KoLggSirZ6ME5MxlKoZUupyqPn+NRlX14LQH11Y2ggjDq1ruLRUbYQYJ8XQDlKznlEaBv/NTQYzvwtMllj49nB+TMYtPoFr16Bu50pBMUFwnm5WanswzkPkqsVIDzJIx31fkOiiSGbxfrCha2lQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qjtzCUW4BM3J8oxtEaoIJWjbz/Qm1wPX4vwU5oAbMMw=; b=du0pi04Cq+Vw/HY/YCGabvfN/nuYr5HDYL81VyjfRg1JFRtPuSmmxFGg1TO7O3ZLjCPu6GqBuyz/gUorpznFwEYSyzXfjayyplHGQz/QaoOaWrVA4Ixctsc0oLYjw3KR3NazRFRYGVw+qIYwR8itSNWYzrRgF0m78GV51ZEDBuI= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 18/34] block/copy-before-write: cbw_init(): use options Date: Tue, 24 Aug 2021 11:38:40 +0300 Message-Id: <20210824083856.17408-19-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 313f2477-23ef-4de4-08cf-08d966dab7fb X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:110; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1oV0VWFnLY7KEF6ru05BLy6fnI4aPncsrtkfrbA1+YKwhxHq4cuNNvXRYaOGLxr3locMemUEU012K9XBM0aMdLufXYqvNcinaI/NbHNSlZHXrU2VNPT1ZjvWXa0EcbfriZXxkb1CQxlUWqU+l0j3XdvX7fIQqAYaTWEpHcg8iSVVCBqYPou+hGDzpQie8194o7foPYAzhXIcsXIT+4TUiMBQS6AqB0Q9+jPyzThpS1xSX3nBJdOglnCXJGWzfHvl1ERO/SkCoYXEOSP5lJvIjlJ4oAjcfh9x8HFW2kSXL9gk8RDXg8pLSfnqJQ0y2f2tRw64PzhDOzlchTsThrWELync8XzM5wOAmTIbjlj7ReyVQLDkQ55GmSRRYZe+DAkRz4A4yGJUvRLP25FRD8Xhl0z2yYS8EgMY396VexfPpun45GyLGGZq6hSq4uwQ7OkpHQi4Aa6GRUk4yOEbTPF2nXoGfnEe9HhQO4H+CJhNxOVo3/akK16HG/YP18uAEXBNUvebwv0zfMk1A77QaaYHyDEt1hvo6l/V4R1/BguDY7nON1nwBxOAUcr2cGAoetesbojRkL5nLOQEZgjsNXHYIa+2ieENjERVwJmuUSMww2kBZRclPAKDIJHUtnx7/1nczJSnrSAUZeXH6ixexAhRWPN4nbpzJTHmX+k/I3CKnB609TiQ5udsYDniyqEPpmNqrCq2AZteGxzeQPjWAlt4jQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Wyd1GsLA+Vl8n43lGhlVGhZVcGCp797wtN6owSQIWtfPsHKt6Y/2ExEw29p9?= =?us-ascii?Q?Kd7w5RVIlt0/feBVVSJl+DNN0K1k8KNkSSwVUjefMmW0GHAS1t5t4saQbw3j?= =?us-ascii?Q?V81kY616mDoi7YDopRwfpzbJGchBubSIFMWJGDWrMw78yre4Ci5vCe0BMaiC?= =?us-ascii?Q?mWEN3TbouFe9RwJVzCql4XF4SddB6hat8VYcziQYSCZtl1GNFV/xDNeNoyG8?= =?us-ascii?Q?VFbpAn9uyP75hPD3zLsvx3lPBeD3ASvXyaZvkOs5Dcpk3BVMIeAxTmZS74C6?= =?us-ascii?Q?Z6FtrDF+j50KA/AxtAK5tUTsM5Z/bfaQCTDCk1DzX2wkr0FgqR5y6sz2sLRp?= =?us-ascii?Q?AUCcR82TXnZv47tsDRe6/kqYgSesjAlOZyOfDiB8txfescpjYBN6ZFIEQWFM?= =?us-ascii?Q?Q9Zt/TYw+m8jD08rmM34YrKWu2gtiQZAh5n9wfx0FP2ixTZyy5Ot9rJRLS2H?= =?us-ascii?Q?7ZUSJYfNeeTPD8KE4RL5UKPWHJOxFgzLAWzWNmmTFwY0n2qD26cqKgrWRnR6?= =?us-ascii?Q?hgDMe+URJozCcX/w6+quGL7kemHJmitnmTcRv3ObANo3M4fgs/G4zk8Y6lbs?= =?us-ascii?Q?rekXB1sKKBkB2qphKK2ISsZdIdwFGRUFQiDrvKoTBMAKx8hi/60cONmn9GcM?= =?us-ascii?Q?25iLgs5bNH8cmngslAAWUmEuoVu1ayG5b5onqkM7J9ssFYXZYjwmECx5GYbY?= =?us-ascii?Q?dRja+L1KL0Tgva6P5KKxCpfxrSGuiyyZ2EHRXvnoGLF3roCLPE0oQzed22gm?= =?us-ascii?Q?vf/LNlssZgIkGUQQfCAhZO8MWfzS8bbs9VCbf1SgrVA4xAhTwxPGrmV69XkQ?= =?us-ascii?Q?mgD+pe4r88L3agsdwVS8Uex79duFENcv6PU4xhX3mAkKk7JzlkJ+vuiyrCBA?= =?us-ascii?Q?LpDDIns75mw4tavB8gksZOQ4VkDhng+kZJsMheZQ+q/fvvh5hnRKqTk3eumM?= =?us-ascii?Q?soGgqmUI6PGC41MRvfvCMet4HcXZs7LkRuyVBgoaMI8cauczfhL+//pQps9+?= =?us-ascii?Q?bdtjmcPCv7Od98jUUs3UHX+gvKqcERgC1U4lvN1pdFkELNRf6sZ64zZ+4cP9?= =?us-ascii?Q?vr2SQ3aCiHS2oCgaFgk89edVMqH3CKvi3EoLBhR1j8AyPRd6CfX2FwylFDcM?= =?us-ascii?Q?nBk99Br+77b+TW9PPCUcX7dbWqS6irDCqi30hLvi7sEyrTaOFX/1fC1OFhNc?= =?us-ascii?Q?1sP1d/3WN/eMxo4m70veR+6zWUfZfObkF0MBdjFKETarXOKq2xyrd2po0NLg?= =?us-ascii?Q?vgStKllrt3+KyC057s924if4o+WOucaj8ODnA950qbIyk+Ua1nJUl6Uoq+Vu?= =?us-ascii?Q?6XXpLl/61nyyXg0YmWTse2jF?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 313f2477-23ef-4de4-08cf-08d966dab7fb X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:42.6506 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2CkTsWN/c+Zubqcus+8JXVZ/5KguQsR7zKTcygp+ES2zQBWHQisfjW8F4wB9CNBPHjY2CiafxulcZASipETeVfGI4ogpfczs6Vnklgxn/gA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795263941100001 Content-Type: text/plain; charset="utf-8" One more step closer to .bdrv_open(): use options instead of plain arguments. Move to bdrv_open_child() calls, native for drive open handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- block/copy-before-write.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 1e7180760a..1cefcade78 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -144,25 +144,20 @@ static void cbw_child_perm(BlockDriverState *bs, Bdrv= Child *c, } } =20 -static int cbw_init(BlockDriverState *bs, BlockDriverState *source, - BlockDriverState *target, Error **errp) +static int cbw_init(BlockDriverState *bs, QDict *options, Error **errp) { BDRVCopyBeforeWriteState *s =3D bs->opaque; =20 - bdrv_ref(target); - s->target =3D bdrv_attach_child(bs, target, "target", &child_of_bds, - BDRV_CHILD_DATA, errp); - if (!s->target) { - error_prepend(errp, "Cannot attach target child: "); + bs->file =3D bdrv_open_child(NULL, options, "file", bs, &child_of_bds, + BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, + false, errp); + if (!bs->file) { return -EINVAL; } =20 - bdrv_ref(source); - bs->file =3D bdrv_attach_child(bs, source, "file", &child_of_bds, - BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, - errp); - if (!bs->file) { - error_prepend(errp, "Cannot attach file child: "); + s->target =3D bdrv_open_child(NULL, options, "target", bs, &child_of_b= ds, + BDRV_CHILD_DATA, false, errp); + if (!s->target) { return -EINVAL; } =20 @@ -209,6 +204,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, int ret; BDRVCopyBeforeWriteState *state; BlockDriverState *top; + QDict *opts; =20 assert(source->total_sectors =3D=3D target->total_sectors); =20 @@ -220,7 +216,12 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *so= urce, } state =3D top->opaque; =20 - ret =3D cbw_init(top, source, target, errp); + opts =3D qdict_new(); + qdict_put_str(opts, "file", bdrv_get_node_name(source)); + qdict_put_str(opts, "target", bdrv_get_node_name(target)); + + ret =3D cbw_init(top, opts, errp); + qobject_unref(opts); if (ret < 0) { goto fail; } --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795515; cv=pass; d=zohomail.com; s=zohoarc; b=LkvbagmxF1sR46MkAoUZegBs1SVwdUpU4C4Fgr/jkoIQAa2ITEBdjq5fg6ak2QuCreLaxy728rUHZsRPfX8JrIGRCsm3n21WtcQcdY9yedKjEZ0n9X1sTF0AB0CEXN+3lesFMaWfPYQyetqQ6GlV5DDFy/w6P4nCirPfNvBv7Kk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795515; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Vfqnsp7hFTsT4dqLeM7DgaoDGD1UcygGkQvv816ee3Q=; b=B9AwmfkOBF/E5bhSX4Qk9Xg5Yl4CjipBqXnScJhlFxEZqNswlEb1cM3w0hxqk+/6aj11ayfWq+DU1uAPPf9lXL28XM2Qo8f8Deuz1RUrO+AMrv80AhUpQLEBPLMRhdo6RmdJshJ3T+xk1yMrPuUPejIbVVtxfTBwKs8zs+u9dFk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162979551593523.704062787016937; Tue, 24 Aug 2021 01:58:35 -0700 (PDT) Received: from localhost ([::1]:34712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISGQ-0008Aj-RT for importer@patchew.org; Tue, 24 Aug 2021 04:58:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyQ-00037k-Q9; Tue, 24 Aug 2021 04:39:58 -0400 Received: from mail-eopbgr50092.outbound.protection.outlook.com ([40.107.5.92]:39447 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyO-0007cr-Vp; Tue, 24 Aug 2021 04:39:58 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:44 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:44 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KL45JxMMyPceO9BOQUrVv0ju/g1UQSHbwQfC4QWKij5SMSyPtbnXlz4Vv56D/2eNf3x3T14Ws6o8jCdpEtzXhnEtKQl1K9RPE+tdy4ElrA7ndLzIp8siNgjFG1Gis43DUd+ZRT+GlWeGJFeUInN+GmrOGYRm8MLltoISXf9aHAoHQ9vi5dBOepdRox6B+576WQ2rumo+JieGISb1Zmg+laXOG6YN412WSfucNhN7o1rwwufYv4PyMkfiFOaGb9tefqcu1I2zkD9xR1yrSJ6VAgbqTfTBA7kuCLBSutagqQLsueyq+tDl8W68KaNjK0CU6n8UtuO9W4dNI10K4Fjjag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vfqnsp7hFTsT4dqLeM7DgaoDGD1UcygGkQvv816ee3Q=; b=DSm1nOCdIfWvMF3LL+D5zTfmv0Xn36HjRjnLw+EQEBCyBpgdwkogT8pxKQHe4mjF4Bt1q0+TxIWX4FdgSpOIQOxiNCehsLrLyx/JRVptjUl5Pe9lpcADq2bUwBZ3AecKqsjdIM49Q1iblJxOdNotEX5oT3x0rW1KLFxHoCyzTK1eGw5jXA2IpvH13uZtH5uNzoOl1RE4qlp+I1EQXnc5L2cOf5/GCjdA1n2BNmzkFm9Zys703VO475Ka1fXIaN7I0oHyjiO1qwT4Av2mUgtdBv60tc7Jov74yBsKpbfg+v3JFnVbF3NDgJxlxf17VjJajjUPNbrWPFnwT5PjtUVQ1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vfqnsp7hFTsT4dqLeM7DgaoDGD1UcygGkQvv816ee3Q=; b=eoshUdlInOgXhzzT2v76PWYa02zaM7KaUSu4mm7mlWPGHz1jlFgOCBorKSa5x8JX0wPYADIWkTDWYoaJwLy6g5SP34WLRx13cXEzkrw8/iMgPhuFBHKSvkRJTYyj/HkzOll/HUizTKBHjXnrio29OhFEP1bshbisszTgROfry5g= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 19/34] block/copy-before-write: initialize block-copy bitmap Date: Tue, 24 Aug 2021 11:38:41 +0300 Message-Id: <20210824083856.17408-20-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8fb34c0-d425-4ba0-1761-08d966dab8d1 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:194; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zfHUi2liljEAPfb0wBUWkGIjq+hA/FVvV0mx9T3NZRkmsSRNj41iBD4fZDxlGXLhgWLbfjP3pDf6Zi9SiZlFXDMsn6aFScD+1+rD+qRvcxAZIftdlVHbXM2UfKXaPhPMVdYwvzmWkGjbNtKloEx9APVt8Mb5ZmMlxEQdgBlP+igHMKYcT5s/86i/EJJJTFexmA9uZy7QWSHRjtgAezGoYAU0rKUG9g6tYrP+ih/9NAITTQ9rUzm1l4Gcq5oJjrPXWBansx3ciDIPts7XtVNuXE79tqfgiCYlzzotH6gmtLHfpSzgkgEQG/vUY2hxH2Xlwi/Eqfehyq9+Knz+W0zd4P/OGRCGnGJLAf5L27m5WjfCbR5SxbVMPxxZcmuBYOHBCmIsZQlQNcZEqZUL6OeXaVwtYRD1B7YEXOTxcAl1BRCGickZOHXvUQBNHCcYtawxg1TUTrSEwEKnigUXL6XXVLq1Dn/Md9/onwGRSzIAXBuTlXhKaIAKuS2bFCTMiX/jagRGeUOp4otgE2HXeJ2vtenclBBRc/PbTsdhHn6pZmg5N4eUTXwrDAtJTgFDZP/NQhNnVFKMKaapDx0drwJz0QBg7WFj3WJYNxHomQAskvI4wQiRzAIAXMa8S6qgqxBX2+fMjTufwbgclFLVaoUzqNIwodLe5UfpaCw4/s1udTm5+AGjinSd5Dctn/AaZtzbZwJsIQBmrf3DNZzXCDY7Zw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oBOc/k5SEh+1zl6ZOSngnRj0IH0wg2gSYpG09yzRJT/LfzsMy+l1anUbQlSh?= =?us-ascii?Q?7BbX2igy3GPUAgjR2abCV0n2xySx+BA1XIuyTBLxA+Gq4++hTxY8A4qEBM2p?= =?us-ascii?Q?IizHX2xKI/apwrTfqAN5nIgNVpCaNx7DPPJf4VmG47P6Zy2HdkQtDXWQoHeQ?= =?us-ascii?Q?q1/9f2UV66vVvMpV5N2/j68YkcbR9op5WhsgvYsfNwzGlgrvOuwK/Ip7JV8k?= =?us-ascii?Q?yo0ab0BtxqFoqiTyUr4fQ7M7ivnL84Sp/7jeYfrBnaOYHLe9AzhKK/+aQD4a?= =?us-ascii?Q?TxVDiHumihyJWsQiQpe3hN5E98hoQ+xCb74OT+npsZzJ9zzAh1VofobEuJUX?= =?us-ascii?Q?1b7e+9//ETmINLc60a/FZHP7LxQCqIaTzUmiIjmUaGLg4LS+EEE8Avfau+Y4?= =?us-ascii?Q?hS4e1vf4LY+D38qb4gVdzOoCq+F7X+fRbeCRgf13QzrZU0Btdwko2rgf0Z2w?= =?us-ascii?Q?mE6vT17TrlrkkCKk/ZJp8ekVRfcMtPKPIcVdP148uKR+naDcnhPbo+cRCRui?= =?us-ascii?Q?JuVNHmo6eZ6BUTo6/4IRHXYwat4Qi2DAJHDEK79i9dxlmU0yPnzsu7aKgjh5?= =?us-ascii?Q?fA9j4iwFXY8pAUKgJ4iA5PeaFJABOIoACbRxsFQ+0gsL3oYschuM6OfpD7TI?= =?us-ascii?Q?QEJaA0gbU5yCV2kXzbOFWb+nlEgXmiwIi60T74b7AFpo6EUtrzYX+Q2pkuHZ?= =?us-ascii?Q?GtmtwMVSbsnEfwY55/dDxCDlmwcJZ7kpUef9f6DSAq0qehR9AK6OSVk9hhZb?= =?us-ascii?Q?SQdN6MAoLxXhpL7dBHEzqkQdNW7xzjDMnlMS1ZtsmhEDj77ev8plGhrvuioH?= =?us-ascii?Q?AX/f8a/EU9r89zYtAvNuN/lsnii+WgoZmQsGfl4gLRoknwFLEBnRoQHPOnik?= =?us-ascii?Q?tKCEKLjfeCyc/z9ftKt7FSZFk49ZpdueSvgft/LbZhdTvq0JYXQ4eIlo9Eb3?= =?us-ascii?Q?UcgAgDOV50as+W4gQxW3qXxHEIZfv4zZuhRGMEuzQmZQuu55XgbqoqIIa33C?= =?us-ascii?Q?/OqYyfQwyL9uBa8VxMF0QOsd2W9JdLwab8dCikZUDSj+qFOa/Q+PWnd14JwJ?= =?us-ascii?Q?n9zNO5EprHZ3sU33bOq9mEiZ215VQuQhG23fDoa+8XAfnXDDt2qF3xnlzrl5?= =?us-ascii?Q?jb9AvOrTdXraQQTbYcmYYZkX9met5oBefHGEShfFEESGvuVmXWByyzz1gW1Q?= =?us-ascii?Q?E0zaPXs82X48zqmcT42nZWexsihV42iWuJ69kGvUDPOgPgVqZGcyTJ6OvwLk?= =?us-ascii?Q?v2CrtpS1uv/6UMayE3l6fOSTCMHAriBW0D1cGQYf9RjKO2ysgUr/o4m0Au5D?= =?us-ascii?Q?k+cCEieMjDgeadGqkqPL9jwQ?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8fb34c0-d425-4ba0-1761-08d966dab8d1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:44.0464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BvsWXTq6d/3DdqtMDL9Mcf9IBCDRmzpnrj2syFa8EmQDaW43DEEOx/xQ9Q1F8t2zzAiwlHn5uJ3V2hBuZMaPD1LRPse/HONqYWBvrHPW/sY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.5.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795516269100001 Content-Type: text/plain; charset="utf-8" We are going to publish copy-before-write filter to be used in separate of backup. Future step would support bitmap for the filter. But let's start from full set bitmap. We have to modify backup, as bitmap is first initialized by copy-before-write filter, and then backup modifies it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/backup.c | 16 +++++++--------- block/copy-before-write.c | 4 ++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/block/backup.c b/block/backup.c index 4869f1e5da..687d2882bc 100644 --- a/block/backup.c +++ b/block/backup.c @@ -233,18 +233,16 @@ static void backup_init_bcs_bitmap(BackupBlockJob *jo= b) BdrvDirtyBitmap *bcs_bitmap =3D block_copy_dirty_bitmap(job->bcs); =20 if (job->sync_mode =3D=3D MIRROR_SYNC_MODE_BITMAP) { + bdrv_clear_dirty_bitmap(bcs_bitmap, NULL); ret =3D bdrv_dirty_bitmap_merge_internal(bcs_bitmap, job->sync_bit= map, NULL, true); assert(ret); - } else { - if (job->sync_mode =3D=3D MIRROR_SYNC_MODE_TOP) { - /* - * We can't hog the coroutine to initialize this thoroughly. - * Set a flag and resume work when we are able to yield safely. - */ - block_copy_set_skip_unallocated(job->bcs, true); - } - bdrv_set_dirty_bitmap(bcs_bitmap, 0, job->len); + } else if (job->sync_mode =3D=3D MIRROR_SYNC_MODE_TOP) { + /* + * We can't hog the coroutine to initialize this thoroughly. + * Set a flag and resume work when we are able to yield safely. + */ + block_copy_set_skip_unallocated(job->bcs, true); } =20 estimate =3D bdrv_get_dirty_count(bcs_bitmap); diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 1cefcade78..2efe098aae 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -147,6 +147,7 @@ static void cbw_child_perm(BlockDriverState *bs, BdrvCh= ild *c, static int cbw_init(BlockDriverState *bs, QDict *options, Error **errp) { BDRVCopyBeforeWriteState *s =3D bs->opaque; + BdrvDirtyBitmap *copy_bitmap; =20 bs->file =3D bdrv_open_child(NULL, options, "file", bs, &child_of_bds, BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, @@ -174,6 +175,9 @@ static int cbw_init(BlockDriverState *bs, QDict *option= s, Error **errp) return -EINVAL; } =20 + copy_bitmap =3D block_copy_dirty_bitmap(s->bcs); + bdrv_set_dirty_bitmap(copy_bitmap, 0, bdrv_dirty_bitmap_size(copy_bitm= ap)); + return 0; } =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795715; cv=pass; d=zohomail.com; s=zohoarc; b=A3EkDeB4CgdAVWsm7oBGJtNcgKhsZkqgxeSe/KeoNz08piVf2iiAHLMfA5tEeUIsTQHoZbGNos58TSx+vewK3QvJ2MMbgCkgybNT9s8hD4K771j7e6oUXAiIJi6LWM0JV2Z9OBd3bITc359Io1ZDec+a53uC8coku+ePAsAry5c= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795715; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GXigi/tQA/aROejty86++dzFmTjAgfO+1VHtp2LnyHY=; b=dQpyZXyMsauGdDm+cdxkHGrmfOuZZqlZge3+643B2eLqvot3XGeQrn5flsqNAMXQNvvZ8GHOJw6cbng9/4TYIJjyKTJP/B5FoRtNDWjs19Knhz2cvA2P4q2UtTwCWvbhFrYG0AEq5IrZmUzgBJdAqleYBHQjceG/A2hHiOq69E0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795714945984.5845134877275; Tue, 24 Aug 2021 02:01:54 -0700 (PDT) Received: from localhost ([::1]:43760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISJd-00064r-Vp for importer@patchew.org; Tue, 24 Aug 2021 05:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyS-0003BL-3p; Tue, 24 Aug 2021 04:40:00 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyP-0007US-VQ; Tue, 24 Aug 2021 04:39:59 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:45 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:45 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ACF44KXw5GFw+5uE0Yv7juRzZsK4UHRi8Qf7EIvVrIw48LNYGoP6tZlI9r7opOFlNhv/0ub/5klqKfUxg1WvC5643oXR0eqd9/Qo72Jhtast5HlsQIG7cgwQ0/6U0nkVR0+I/T/7zukrylOupBGUzbvqZBMAvJceBgK/pW1KvKG1gGkR47U7YABb6YHek6K09HZAzcI2x2WVWLy5DkUOfKEKGdQVHzgrY5cdW1ZQya+1VcWYl2Ec8pZ2LUs89xNVw3RNOetD8pU0p6eFWNamCFCaLSNvJacyt+AFo4TE/2yGCe7vxPdUzP353IiaAawDda+tm0NlB3UTk5BVQBHuxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GXigi/tQA/aROejty86++dzFmTjAgfO+1VHtp2LnyHY=; b=MKboW5GE6eFCBJGAXVW7xjNhATH51sIapcHx5hQO79RzTEtf5rZOzrI8wpSHYanEgRaXSkucZTcghoefjtRNc2fwJMZX1uZRaIMtCWjkI0c/JfOizKVCTcXl4QPAsIv9yHod8ysDZAQ/BZZJ1aGrcVfFp26YbpXxKVbQdYDbi82YdZB3iCE0GPNtMMMyzkVXEwcp8mjydgiAQj9ybwYZj519i9qgMANlNQkF9bv1GE2Hd5nVq3YMin9pjhUi7Rj2ENi+0v8ikWsuFvj1aPRuug/o+juin82k56slQUlYiVYJrIeaAhV9GFBW5zU2oAjGvMPODYXbVaCHx5rK79bTVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GXigi/tQA/aROejty86++dzFmTjAgfO+1VHtp2LnyHY=; b=f3vWb+SSJp9Mw3Q2gS8nMFuVxMS3df4adAfS++M9wKSIz4zwrrymWt+7RfolWvWlcx6E/mEVH3+krrh4a5RD4mKYu2ZWzi7Zl28U1XgLrP6EBL2Y+d/MbUcvU0ONChph4p44NAbJ87lwP+kc+CnoznE4crkNb/oVdtqXTzkFWxE= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 20/34] block/block-copy: make setting progress optional Date: Tue, 24 Aug 2021 11:38:42 +0300 Message-Id: <20210824083856.17408-21-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2dc94285-957f-49d3-2fca-08d966dab9aa X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:63; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sRFlo6l9qZ1gThJc3hHTK7z8951Q6xScT6FYjlYhdrdCwrmF6+AinqYyeRrnrUssklE6deeres1Vjt2uCO377j4RorhLzMCLb5fSMK3bo17uGQ6MR512WMy5fviW/lP/L+p2OZ5/nDBUGiTVHXmgmPQCbxBmqz3JTmmbzA3ElxlELHTcw8wf/BTwrgmH9uonFIgEZg23jwq9fp64+erfEz0nxkk7imuG2hgSvUODY4HvhzYVRLJL87tX4yFB7C1/i2qvC8L4hiK0aBumHpsTx0iIRdwQYAv3sLUENyk5YS6dIojPvb3XFp/Mk9gqpVZHBUEbW6MxsNsOa6RF977Lsq9q4h4FWe5OZ/OncJ5b0iGumyHk0W4y+S60BY6SGTnHcyrS8UhXB5743S7LO5arcfl1TuIf/qlhp9BpmST7X2fuB7WAfDqsl+E2Xpk8rqXNLdO/6BXhzJy5INFPcULLW9BUKBoNO93TIHaS0B1hvYIl2E4P+slw3m6RnJDOjjM1X6jmgYQ0e0rhAewzjXHrdrhLp01O7gLMX8D/TtGvSExE0KbvL1lBJgEJ15GQySIZP8siwu7kGDWbBtFedonTJGy1j0FKUv2419M9TbagVhXAYq3X6n8WNLAJciWyKHxF2PwsHGbrmK4e5oegkAAlJuTQXm8YAtj2dTcPGYFlRd3HVU0NGc8HfaLTqZN5zFu52wsxqs/xufF+DCKdciaptg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?CmGY31Akye3P4Yq41O9D1azLis39aHOg+F0UgWCLSh83o295aF195BIN3FZy?= =?us-ascii?Q?7h+s4GRMiPDTr5yGXv90N3vbycBhuThVvz4kN7+by2pAuxrLbiykmKBVBiIy?= =?us-ascii?Q?rADRUY/UxaIsjaKRYlcQ6egn8rc19UYiPLFYUL9SE0XHMmxhWCjPUZDaPeMY?= =?us-ascii?Q?653WKK0lP/qHdhokWysnTHYjITwIiWTiM+D2gKlMndE0hniYAplFYnVmxCW0?= =?us-ascii?Q?51y+A/bkYSmfATgm+fzQzA4TRNvgw27hMOmJqIkOSB8ZAeHedACj41cEOdCd?= =?us-ascii?Q?ybCvxeD9r05SL1gSiTPvEWfNgJdBLvHYG0RX2wBiFmqhiilVriRC1fIac9XN?= =?us-ascii?Q?s4aUPg1xvl2+dlUEeFj417I/y9wGXN4r25bNfqUs4d45kb4AwJtJG2wM1FqI?= =?us-ascii?Q?JWTiz7DM1ai+A2ON40XOrauXThxduowafcI7PF2CRgfUxxHGTTOIBlNIRSUL?= =?us-ascii?Q?Gt4+OoBg3InElj1VynoITdmXzdhAphhJA20iHKUBuNDB2qG6MrfkybNQrqmJ?= =?us-ascii?Q?+9nS7rqPDMyabs5QZzM/KXWo69wzIGaHkjAiC5McDu++YDDHTo5m0QcvC7rm?= =?us-ascii?Q?mgm2cwa6BRkjJQ9nyayHwJFxqRcyoZwbLBm/uxp7Tt5n7bGBPi3+DPa9lg5d?= =?us-ascii?Q?hK5iiZDxfye9cSoleFPwlpmKjyGZqvOUbtQByNFtiDhjBSmo3+HZZ4t2OGVm?= =?us-ascii?Q?j1otQw7ZUTb/vM195r1pxBCqnnTji+gV6aXNhymm6/lJA7Wx0aGTTxMsP4CH?= =?us-ascii?Q?wb71ALCPqC8BGLKWoDNSNscIgb/NDn3a1TApgY/SsupqCx7GMNZOnjcmmbZf?= =?us-ascii?Q?TrnfDqXAwR1i3GPE1rARDeZ8GerZJ6W3j53XbspKrnRUJSAyPGqHY5m0tlfA?= =?us-ascii?Q?bTgt6FQiMaMvqZdiZP+yPD/j+idEzrUlf/4+w6HPVrhv7uIBCGeymtoVnZWo?= =?us-ascii?Q?rHIVUobRuRb8lhPJ1CDu/UULIx+VJu/bcjcCg9/bkTZJNvnCgJPLgyiWQglr?= =?us-ascii?Q?V/zdfzdEyCKh6HHQJ9Vpnf+b/S8BeHJ1uzNvMCFn11S5R9bsgoXlgHyBDjdV?= =?us-ascii?Q?6edleoSB4zTxFa0qKtqdOwp68ysvl7LFSjzr9XwEcjwX4k75v1/g1Pn2lFQi?= =?us-ascii?Q?PfHE9wTwLURmBH0XO3PCy8k8Izffud4+cLyl2fs1yrgg6qWy5hz6kZDmkiie?= =?us-ascii?Q?HoUKrsWRmgILJ/lShfO/5J+3N3D0HMjcY+dZ92l49WA5AOS7ICDuLvb/Yj+j?= =?us-ascii?Q?Hrz9Ak8N9UBiHCtnURe9Q5HyZKNnVLQsTFP0ep30IR7Mu8WGRTGREo9editp?= =?us-ascii?Q?Ht/NWI0+YlKt1NYABwotXLHo?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2dc94285-957f-49d3-2fca-08d966dab9aa X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:45.4891 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Z9SO54zGbLp2/4IkH5aDl5/yanImJJ6NEGd3yzkDVkWIOKBmcWGUndNGbHL7WSiNoEaBPA8CFLNtL4i0LGIqmexEadbk7k4jTQTD5siKMDo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795716778100003 Content-Type: text/plain; charset="utf-8" Now block-copy will crash if user don't set progress meter by block_copy_set_progress_meter(). copy-before-write filter will be used in separate of backup job, and it doesn't want any progress meter (for now). So, allow not setting it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/block-copy.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/block/block-copy.c b/block/block-copy.c index b0e0a38330..975f9986a4 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -291,9 +291,11 @@ static void coroutine_fn block_copy_task_end(BlockCopy= Task *task, int ret) bdrv_set_dirty_bitmap(task->s->copy_bitmap, task->offset, task->by= tes); } QLIST_REMOVE(task, list); - progress_set_remaining(task->s->progress, - bdrv_get_dirty_count(task->s->copy_bitmap) + - task->s->in_flight_bytes); + if (task->s->progress) { + progress_set_remaining(task->s->progress, + bdrv_get_dirty_count(task->s->copy_bitmap) + + task->s->in_flight_bytes); + } qemu_co_queue_restart_all(&task->wait_queue); } =20 @@ -593,7 +595,7 @@ static coroutine_fn int block_copy_task_entry(AioTask *= task) t->call_state->ret =3D ret; t->call_state->error_is_read =3D error_is_read; } - } else { + } else if (s->progress) { progress_work_done(s->progress, t->bytes); } } @@ -699,9 +701,11 @@ int64_t block_copy_reset_unallocated(BlockCopyState *s, if (!ret) { qemu_co_mutex_lock(&s->lock); bdrv_reset_dirty_bitmap(s->copy_bitmap, offset, bytes); - progress_set_remaining(s->progress, - bdrv_get_dirty_count(s->copy_bitmap) + - s->in_flight_bytes); + if (s->progress) { + progress_set_remaining(s->progress, + bdrv_get_dirty_count(s->copy_bitmap) + + s->in_flight_bytes); + } qemu_co_mutex_unlock(&s->lock); } =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795386; cv=pass; d=zohomail.com; s=zohoarc; b=Ele+dYtnLpmYXozVbXQDCE4gqO98g+vsVaD3fTVd7Pk46CbpORjChyZ9XmmATzkDJQprxMxK0CqwwK8omiJnB7q9YGg6EkvJh+X//7Q2JIbgCD5WlYSCQcotamo1jIKeLeTuQ6H/piT6Z27LdyELv9mDjFzx8TsQzZBS9Z/r2no= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795386; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u4ocnYB2elMcQ6ru6jvylmC8TgB30m1LbCBjWVE9qmc=; b=BdjCy32vX7ShfRytmGG6Y/V+HGrHTWH7dLrhLsMUY46qHeyfYeiThVFz5LlQrLUt9kV497aPUvDwDI5nxVcucqY0eLsrS8Fr7t5qfoBHHPZ3q9In+ynHOfLaCFZ+X81K5aizm6FUzfrp1qoZGr7f/7SgT6tNe/lhMWRi2P8EZ/0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795386009550.63417159718; Tue, 24 Aug 2021 01:56:26 -0700 (PDT) Received: from localhost ([::1]:50290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISEK-0007v6-P4 for importer@patchew.org; Tue, 24 Aug 2021 04:56:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyM-0002ro-JW; Tue, 24 Aug 2021 04:39:54 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyJ-0007eD-5t; Tue, 24 Aug 2021 04:39:54 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:46 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:46 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dY9jN8YxJw69t03luBMBdHgBaRkuNM6fu8CVJTHWCQLaxfIvjx1Uo1HcV0Vfr2WtSVk84Pv/E3smkI+rFWW+RT7G8MB1Oe2/vGA4mvxv6LguGyC/AajKA6d2uF3pWVVUX9IqkA0OJuCL1e3hofQa0a/9UpPn/1OnF2SRL2BZEQuOasL7sb8fq8AcXVGQyOnyy7CJsj9KALaswC47ybs6JxM4JB2Hk+AIBq5fyB1Gy2jmy9cw3YzoRCn+cTfuV3IvLdw4oGh95o1vaOwseNW0utoPUdGcn+d1uuf8h1E5oPc8Mejns42xI0X4CwH+K2u3Ic7SqhgaBF5PnDHQwmnJxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u4ocnYB2elMcQ6ru6jvylmC8TgB30m1LbCBjWVE9qmc=; b=kPHrkCzH7CakN7jVQ2O9urmZid/g3Nn794ktKFuBYpP0veQWz8wea8lGqcX3HzspGPrCU8z3BbSpK4FtilRM+JJNNraZimQkw536pMWX/Emg08rdhNedba+lMI/vOizbTRBJ+5O5feiNCKuLHVfsLnP75hJgow0H4dAg+SswgYLk5t4DDtwiWQPRcudqanFxjcBIewRbqG/UQ3KkQJEoYEeiPkdecPWExZ6uJZjKgiAFwVQLk9flofvmeMFCiS1lfM0D7ZYjk02snvn5iuYUD5Fe6k9mer0l/IbGEvMAuDj0+ROowtz8ZMfPk+clvKCuBeeoajPa+QdjqxO4nCb3cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u4ocnYB2elMcQ6ru6jvylmC8TgB30m1LbCBjWVE9qmc=; b=udOLBVjQMwUz8hYnfU1z8p+JrWoZoOd1ku1V7dsj+v6xSe/+wcq5m93EHJcDl7V3Ied+BSuLIfvr1+D8RI526VO/H2lTZU42leNWebt6RyILEt+DqHMeBZY1cJ8lb2oww73J4EX4UnSaMhPUJvnhAmR2SsnE22Rzm8m8nFC9aqY= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 21/34] block/copy-before-write: make public block driver Date: Tue, 24 Aug 2021 11:38:43 +0300 Message-Id: <20210824083856.17408-22-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9753c82a-ade2-4ac0-54fa-08d966daba7f X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:341; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZkljtHLbpS3w/noKot4zwQTRJsPvevFEzY77/yctp435GeltOmwuOb2qeL5/yP6SYzyHWrmaLJRkB6FJ8ODMY8p4VD8OZaHNrBkmwzyUvocG2Exf5lIbCREw47DWtoEdiALXBggONfQcL1gwswFVLWI+Z98tZbOmxOkjsfdMr+YenHGqG/FWQObQwPP5LUSED44B9VovAYD6LoJtCuFgpCF3EBIv/hcbMx7XAJyvUy3CtstNKDV8PGAc28DHve+dyjtEsm0LmWiq5GSB/beudpa1n8Gg8DrJD4SNoIxqGsdk3rLaoGOzs2jXQl00E+wpqRIwbkTNy31lKBaQGn+ToxUsYie0csTKysBd30wslMiXDY+vLJzit5YWK9ff0z6yGsbOG/qeH2oX9N0fTl++Y8qhkPe9VOZ6Do/Tcog65ylPFz+PSy8LPdAkfMzyStLmPrfpwjNfyC3snO0wRx6v3R/xxSvSsoe0G6QeA6k/nVPTDwqqt1PJNtPHMt3EO+uGhZ7BOpmdHcW5x65TTmJnawTEmLk9wblARtx5CWyw0ICf9/T63KosVir7/4Nt3QwmpWf5Z0oIDxmRYWvWPRsmCWDB/Tz0MFz8rPz5b2Y94/8UxU7GaF0Sfh78/9clQHY/RPosIBXNL45NAtvUovYiePxF7Zg0uwkJATL0Aeqf5O0ntKdyBvCOVSJJodq5S3PbJvHfTxl6X9K+o0fsReLKxg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6506007)(52116002)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?m2VDpLEIlQuu6UJuGDaRR3C68AmDiLLhpGZMCVN6ltW9l2J5+VoDcTZufy22?= =?us-ascii?Q?2VsZjX9C+gf7rVwIJ97mp5l61mfG4AOBn/QKI5O6lZY56RK26bqOkifwVvx6?= =?us-ascii?Q?i3PnONr7M2jtticsJFFFOrotNOj73AKph3xwIVSiYJ61Xkf/7DkKs2h5aIfP?= =?us-ascii?Q?5mfblE8a3oXpC2NAD0uQQXln9sxsOUccCmU2yUXckitSFj9klTzJdtRyTD/N?= =?us-ascii?Q?WISEpxfIiXtZnScPT5akgqwoi71e1R+L6HgFhDZdwWcpf+zLS0a+c7jbOGac?= =?us-ascii?Q?ig8FBZIzd4E9HPyVOhZQBdVOiQ6HXepxiZaavv/0J2daQR5o+rxEb3kx/cpY?= =?us-ascii?Q?udaHioOj9RiuK8jwyjZpEvzhm+cQ5+5TGgxnJwGJjxQFZmq4IFWa01n0Xe8L?= =?us-ascii?Q?BVrKZi3CZXw0PgCNqY+eUfhjQbmCQj0qLRpVGRaCzfA+RZlEPnE/yMnIP0em?= =?us-ascii?Q?0YYpl1LE6FK34Unn/wCkDqCmRwTxnXkhJ/+zg+7uBEtnJufXoyZNQe2AS5n2?= =?us-ascii?Q?Uy7VgodAnaPFJlLdCNmvKrkTQB1ThVhd4z67FPwrXk6JAd3OIJqSlB8gHwjb?= =?us-ascii?Q?NFRcSybTdGNPI4j5BSai/6s3opDCVSRHZj5Yv43B2MKUQir53TWWt99OrTyr?= =?us-ascii?Q?3Eid01vWp+ItEIvu95pVxN/U2zipwucLW6qPOKqkQ8MNIwdYe5AO1aDCaKEq?= =?us-ascii?Q?e6Mhnt1/EpDctnYxloRt5G5nHCX4tlkU2BQHrg5GHaKV9YgPc9FgV4CDVH0p?= =?us-ascii?Q?tdp0FwuKUxUvDBHucXzTL2AlU6wCkv87toRFOlWux2t0o2IUNgUh/7Oi1hpW?= =?us-ascii?Q?12S6NiVU9VH3JgDYvi3FEGu/0mZWU3AO5M0bo76tNSjq+wjkCmPGBpk+PLR8?= =?us-ascii?Q?NAQcuRNRDoXVEXNu6+Vz/0Tld528KkluVny3WnEnV5CoZDIJldcL3iYfr9pG?= =?us-ascii?Q?KW8peNUapoWxsSK0cDNXFkQ7xLkETQGtIKPJfqtLMqnwZYqUFhSBZnax6OiF?= =?us-ascii?Q?mjjk3fLg8LGBv3zsQZUKICgBe/DIazur0wHScf2QSGdLXHY8w/o4VMBc8Zh4?= =?us-ascii?Q?vZHmPkkQHStmT545ZYfyTW2gX+MNvt0AjgtEqWGIPY29ht6YtOJkyO+5XnD+?= =?us-ascii?Q?1tAxry0n2IWBgKjVzvIh4zL0LhJ/AuJMCnrUGoHgFZw+YK4DY8JDY3pZnu4C?= =?us-ascii?Q?I6FQbZzkr7+/6OKGGwEI2EiWlizv8nBy6DfxvxyYYmH2A1a6f8kllIv7WarX?= =?us-ascii?Q?E8qc2BlbaTIZaWoPGqSEHz9VfsHqQM5Nk7cV7agfz+RIpTuKJANBKxd+SOZp?= =?us-ascii?Q?BQJVjr15Xpm3RmWX4TloP2X7?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9753c82a-ade2-4ac0-54fa-08d966daba7f X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:46.8760 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sltB69BwfggKBsFyr46d0cZOsH3YvMCwB69EDtWP+a5GL2rp691dPiL0V4YIx9qT4inGAnV5b6zHeuX+xDds1XZDSY53CGeT196xRJ32Aq4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795387570100001 Content-Type: text/plain; charset="utf-8" Finally, copy-before-write gets own .bdrv_open and .bdrv_close handlers, block_init() call and becomes available through bdrv_open(). To achieve this: - cbw_init gets unused flags argument and becomes cbw_open - block_copy_state_free() call moved to new cbw_close() - in bdrv_cbw_append: - options are completed with driver and node-name, and we can simply use bdrv_insert_node() to do both open and drained replacing - in bdrv_cbw_drop: - cbw_close() is now responsible for freeing s->bcs, so don't do it here Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 60 ++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 2efe098aae..2cd68b480a 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -144,7 +144,8 @@ static void cbw_child_perm(BlockDriverState *bs, BdrvCh= ild *c, } } =20 -static int cbw_init(BlockDriverState *bs, QDict *options, Error **errp) +static int cbw_open(BlockDriverState *bs, QDict *options, int flags, + Error **errp) { BDRVCopyBeforeWriteState *s =3D bs->opaque; BdrvDirtyBitmap *copy_bitmap; @@ -181,10 +182,21 @@ static int cbw_init(BlockDriverState *bs, QDict *opti= ons, Error **errp) return 0; } =20 +static void cbw_close(BlockDriverState *bs) +{ + BDRVCopyBeforeWriteState *s =3D bs->opaque; + + block_copy_state_free(s->bcs); + s->bcs =3D NULL; +} + BlockDriver bdrv_cbw_filter =3D { .format_name =3D "copy-before-write", .instance_size =3D sizeof(BDRVCopyBeforeWriteState), =20 + .bdrv_open =3D cbw_open, + .bdrv_close =3D cbw_close, + .bdrv_co_preadv =3D cbw_co_preadv, .bdrv_co_pwritev =3D cbw_co_pwritev, .bdrv_co_pwrite_zeroes =3D cbw_co_pwrite_zeroes, @@ -205,56 +217,40 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *s= ource, Error **errp) { ERRP_GUARD(); - int ret; BDRVCopyBeforeWriteState *state; BlockDriverState *top; QDict *opts; =20 assert(source->total_sectors =3D=3D target->total_sectors); =20 - top =3D bdrv_new_open_driver(&bdrv_cbw_filter, filter_node_name, - BDRV_O_RDWR, errp); - if (!top) { - error_prepend(errp, "Cannot open driver: "); - return NULL; - } - state =3D top->opaque; - opts =3D qdict_new(); + qdict_put_str(opts, "driver", "copy-before-write"); + if (filter_node_name) { + qdict_put_str(opts, "node-name", filter_node_name); + } qdict_put_str(opts, "file", bdrv_get_node_name(source)); qdict_put_str(opts, "target", bdrv_get_node_name(target)); =20 - ret =3D cbw_init(top, opts, errp); - qobject_unref(opts); - if (ret < 0) { - goto fail; - } - - bdrv_drained_begin(source); - ret =3D bdrv_replace_node(source, top, errp); - bdrv_drained_end(source); - if (ret < 0) { - error_prepend(errp, "Cannot append copy-before-write filter: "); - goto fail; + top =3D bdrv_insert_node(source, opts, BDRV_O_RDWR, errp); + if (!top) { + return NULL; } =20 + state =3D top->opaque; *bcs =3D state->bcs; =20 return top; - -fail: - block_copy_state_free(state->bcs); - bdrv_unref(top); - return NULL; } =20 void bdrv_cbw_drop(BlockDriverState *bs) { - BDRVCopyBeforeWriteState *s =3D bs->opaque; - bdrv_drop_filter(bs, &error_abort); - - block_copy_state_free(s->bcs); - bdrv_unref(bs); } + +static void cbw_init(void) +{ + bdrv_register(&bdrv_cbw_filter); +} + +block_init(cbw_init); --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795863; cv=pass; d=zohomail.com; s=zohoarc; b=amJ4yLxc1lhvSinMRsZrn4VTlSoKIGKpd1aOo6sHMHfp4CGRimQfBjJZL56aJ1VhzUZEy/zZPr1KiKEvP9wKsGRBPXgr1AuOAp9rkLr5IrW6PtBa81tXFuFvtyHUUIneyusOoafSpr4W6IyMDawrMMSe/Lk7XxOt0B+0iQclDg4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795863; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1H4ribzFNeXT+JKVfw7jHp1pKBhoGjoKPX/UWvK2KA0=; b=H2KnXEsTD64UTj6Hhfpu7d7mhAd3UHxR+c7oMbzNp658tFCl50TMorMLaXktSEkdZfpqe5AkEjVBFayB31NObLxhjgSdeBz2F6IePM0OwZY6qHVKhFOdVRTC9yIQoKo3K88AW5/WKQDYfdvYTC4w/kDcEKb7BOsy0KRClF+mmtg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16297958636437.484583617859357; Tue, 24 Aug 2021 02:04:23 -0700 (PDT) Received: from localhost ([::1]:50378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISM2-0002Az-Ja for importer@patchew.org; Tue, 24 Aug 2021 05:04:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyT-0003E3-83; Tue, 24 Aug 2021 04:40:01 -0400 Received: from mail-eopbgr50092.outbound.protection.outlook.com ([40.107.5.92]:39447 helo=EUR03-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyR-0007cr-Gz; Tue, 24 Aug 2021 04:40:00 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:48 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:48 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TxB2eJHWevbeSv8Lkcmi06bE5QC/3NiWQluiGCP20CKkbk/qxKF2PmIhVA3NldSP5R97vmQytiSw9Q3cCHKZDQLGpZupS9cqP9IA5QPgdfbnTXchJRsgQA5Y1Pw/Rzn71nghly3ugyu9fX+xZ+tVA1QGBM8UVq1tsNdUiaI6/Xc0DRWnenYyQS4du8n51tCM/a8d8Mood9ASEmTvKOcUoiuknTszmhnwHBmsqCtFQNFI+01DGq5o3oKp2NtBrZ61X9I2qhbL2NgLrC72VXdh0fQmlLkzOM9V+9gyElzTBkO/PaFIZfJGw2Aiu8n8S2wqDIBidzFQL4HIB5yqoLUhAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1H4ribzFNeXT+JKVfw7jHp1pKBhoGjoKPX/UWvK2KA0=; b=FBM2K9MT/uAhstCc6fG1L7t7o36usd4aIKhvXU92X4xELPwOpsRX0wUMG2aNO2MTNeFX4VqpHRe94WjEJrNpCFpweVvNCDHlivwyON2szX5HB+pW1rh1VSgWXuMwmgkWfPf3LyIm6vx9UMHx7FFSkmWXzwyybpxnvovv100cwWp4HLII6TA3Jpd6hCzTBsbOscrrISqWhMyPxH5qFOYXO7+cJgX9MF42Sz9BDHHtbHU4VO2ZHBcj0dioiQP4iG4Ipovv8CQIRGr4Q+ttx/jXObyXclbVNjtMYnqdkMO9Gn6cLQfIHdFbgHrE7EBvWEBxoTlTpb+IQic7qBD8OaB85w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1H4ribzFNeXT+JKVfw7jHp1pKBhoGjoKPX/UWvK2KA0=; b=cFT1iRz5Gie6+3sGMZQI05jlo+s94rehHPEG+HSb8AyL43OCh/2UdnWcslEQOzYy6LIfqkfg7i9YlEl0vip6Hx/PLsYpYpyGLs7s95eatGNjXSHcwY+XFWo2MpygvNApq8ge/J6ZUqSWxMhT9/4wZXNqT8J4QkTJ5+n6UwqTVl0= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 22/34] qapi: publish copy-before-write filter Date: Tue, 24 Aug 2021 11:38:44 +0300 Message-Id: <20210824083856.17408-23-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06f5d33b-c916-48d0-32ca-08d966dabb52 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tPSSzxbiJ37U71g/C+wBrJOUKqIDXeTdRazoumijNBe0MDJaGoK7ZYODgYREx4dffkoq4yxFPHdqb12hLbPStTV1VwwADMCIOjEjoyMlRwraNj3gIwWf1/BDNQ9dLRbm34NHcStOV1547FGgtZT9BC0ALZIMQ9z9WCIJSkK7ShDs5WEiMGgYjbZL9BKMUXhli9DcY8SMxIMlzfUnqTmdC82j8y6dfQfjpeUE/sOGP3WNf2z4TbpiLS38OZ6dwjsor4wxAVuHkBRpWia2ZVgGCnvpPWrnO8fHCsi3ZhLYAV5Ep+uSeAnnhrt/bXuaI7/O2Bgagqr0SGX76OCLVRXwoZvIdsxVk+ub29ffrEg/Jul4MsDSUq2d+3KKNNoF0lXZDileew1CIfdmenzjLOgiF8VT99aE0YkAIVo5Am9k6vLR/0pykGcLLPsAiF5xpWU+Q3/kYaaNtJ5zxCP8wBkmsfDVoCyat6Xzs6P4630QCq5in6G7m2JTPOWX9Z60enG4G7FtcangrvoNqu8brpCyit/B33WeIISJD2hlO7Ui+vdUTofS3x/F7L7HbmJx8QNc6wdybJ2AlbWzPPoXRlA1ar0x0VQ3bxjH8CkjIYPAX66OApPnH4ZJsSZxkcr6xgk7f1wFi9QhCEaTYnXtpJ/A6aB9ZoaZEwr9wCJc6G1FkcymSLXPP0Tw/9QjP9IWpicHZH9gYdRDJ72GJupuxS3C4g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(6666004)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?uV08kWWsgebwpp7uo7yofSFv1ym7UPmrWXpfU6cWEQ9MIwjXRw17LjymuebR?= =?us-ascii?Q?BYDD98EeqF2PeIp5Hk14uadDCDEV1NyqXyiZD2ASrEg9MVCJzhM22nMiorXt?= =?us-ascii?Q?v9TaXs8lHIoPRlW6PpgDBs86rexIgBGzRqtzWH3GoXPsOMWTKDTTfo+ufqtM?= =?us-ascii?Q?4I6PFX33f09FIgquN3cpeKJ+8Fw4M4sIebUOeie9Nv4GEEb3RejKm7KmJD9I?= =?us-ascii?Q?a+KKsfka7WzGtaSuGoHq4xpj8KFpRKoNqnJw9OoaWmaZaDbbv625Swja8CU+?= =?us-ascii?Q?C2W7ZWYuA3+MgILWCi/BPpnkf9WZzWrbxUGDCwRspY8IyD5jnmvmBig6DQ7Y?= =?us-ascii?Q?OA6IqqVyRpC5s5CIrcigAM0UGPcRli7XAYfVOy8+4L5tfW6AeU87k/WQ6R4U?= =?us-ascii?Q?kGnlY9Ysb3b48JE7m0OORaqBfgXiWpQUi022stuk+yYJR700aHbipMeVMmrC?= =?us-ascii?Q?LOHuPxlXSJ5HAZ7dY+1QH8Dj403NqwPFFROFJITnY0Uy4rIKYCcuYdglpU60?= =?us-ascii?Q?8I5Db2tOlTThGyR1WBVXjOQ0fwEKf9HcRfR5yuaBPhI6FL90K5a3frccfxAS?= =?us-ascii?Q?3OdFqg1Xj1aQ7R1CzZ4ndA1dLz50t/+7oNJL8VfHDURt0Xjn0Ed4op7SYre0?= =?us-ascii?Q?E0iQeYy2tgZujxqlnfQGGiALh56k3ditE4EQkN5Obedi49Bm3ynP3T2/p3oX?= =?us-ascii?Q?K//IYMKf2z+ri1qjyl0BcGaJ1tyX9pdXmoq9xUBjHYkzVd+/l0qOzfblvKxn?= =?us-ascii?Q?a9Cjw04X+O9Elyub8d+qFaUppj0Uo3ICyk5tuBQxSrYiQiJb96EEd9iISvc+?= =?us-ascii?Q?FfN5TCPllJQi1eRTgxxpqOfKTK7HRH1gUA21+MyR6eoPRAs0MRfqmDiVByB+?= =?us-ascii?Q?SWBK79EK6mmsc5qRcbHQ0D7clv0h2+TD82aRrC0UEqx4LwLzc55WB/KZfWE1?= =?us-ascii?Q?FIShcC6IqGM0TBvV+0ErlYVQ0Ww/dOssgQbQbr4Vs57aISdnCnXoEiWFv0XE?= =?us-ascii?Q?mdgf7TupeDloEJCVBvsh5I8nY2868YXXuuBYfq52Gjqye6s2ALyOBS9dKh1n?= =?us-ascii?Q?yOoWq7MZVLir9SR/s/exRvwbxFisMuYT5qlD+2OVvpHOvbh2Q3vOKRFU1Jnw?= =?us-ascii?Q?bkiNdibppZZFHrF8J+BnFgtfdRUUTaE9IgS+YDjopCLH1nK7BpqE1v2ZJvpX?= =?us-ascii?Q?jIPYQy+Y5HzVWOUf+042T3pGYvY+zyI7hssT03mUdTsOIi7byEcsdBF2T5OC?= =?us-ascii?Q?v/sJa60roxukZ+ZJ0rYTnEz1qu04tsxMr7KMAmvO7Q0ntjqgi8mCU4MSQ1G6?= =?us-ascii?Q?jZ5+dfjMxC4Xb9OB6UH1dQgn?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06f5d33b-c916-48d0-32ca-08d966dabb52 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:48.2540 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: k0ZMyi+gjvTojwdqhypUrMw3I/OT6LA48yqN9sadBsMOSB2Ry+cOGSloyPmLItoTqLOeiS4BLYuwfAOEqa0VoL8aJrE+lrTqdjdMwqIebDs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.5.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795864769100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Acked-by: Markus Armbruster --- qapi/block-core.json | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 675d8265eb..6764d8b84f 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2825,13 +2825,14 @@ # @blklogwrites: Since 3.0 # @blkreplay: Since 4.2 # @compress: Since 5.0 +# @copy-before-write: Since 6.2 # # Since: 2.9 ## { 'enum': 'BlockdevDriver', 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs', - 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ft= ps', - 'gluster', + 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg= ', + 'file', 'ftp', 'ftps', 'gluster', {'name': 'host_cdrom', 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)'= }, {'name': 'host_device', 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)= ' }, 'http', 'https', 'iscsi', @@ -4049,6 +4050,25 @@ 'base': 'BlockdevOptionsGenericFormat', 'data': { '*bottom': 'str' } } =20 +## +# @BlockdevOptionsCbw: +# +# Driver specific block device options for the copy-before-write driver, +# which does so called copy-before-write operations: when data is +# written to the filter, the filter first reads corresponding blocks +# from its file child and copies them to @target child. After successfully +# copying, the write request is propagated to file child. If copying +# fails, the original write request is failed too and no data is written +# to file child. +# +# @target: The target for copy-before-write operations. +# +# Since: 6.2 +## +{ 'struct': 'BlockdevOptionsCbw', + 'base': 'BlockdevOptionsGenericFormat', + 'data': { 'target': 'BlockdevRef' } } + ## # @BlockdevOptions: # @@ -4101,6 +4121,7 @@ 'bochs': 'BlockdevOptionsGenericFormat', 'cloop': 'BlockdevOptionsGenericFormat', 'compress': 'BlockdevOptionsGenericFormat', + 'copy-before-write':'BlockdevOptionsCbw', 'copy-on-read':'BlockdevOptionsCor', 'dmg': 'BlockdevOptionsGenericFormat', 'file': 'BlockdevOptionsFile', --=20 2.29.2 From nobody Thu Nov 14 07:06:15 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795441; cv=pass; d=zohomail.com; s=zohoarc; b=bfkU+Pn2YbwkGgSGagrJfO3aFY5lBYHDNJTwZ11hRUTSTyH76tpMdDU1wREno+yFsTnLwZcRKtrYr2tyT5bbY4Q+1bgI5EC+vHsNf5dmPWrib7P5KGiWuZPMqE/3EKzgbWe0PDGb12Y6kl0rOlWCNhanfiY4ztWdp7shp0fNhjU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795441; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6FJWIhLdp3ZBunz4U3SknoYuQthg0pb2m2HtQWXoZ80=; b=Kft+jAyya8/9nBGW21iMX6+MO/xc6stEvrJFEn6f9WB3wiXd6bZQM5ejld6y+YEm0fJQ0ciKhXXIAH8epmW0IWq5FGP70LH2I1hUpadxb7UOimGJIydaFmgqglDfk1ZHDOQ1SPVSanMwvQH+HlXySnsyMxBHyzxweSbzKzdGM60= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795441706162.97715158747405; Tue, 24 Aug 2021 01:57:21 -0700 (PDT) Received: from localhost ([::1]:55448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISFE-00035w-Ff for importer@patchew.org; Tue, 24 Aug 2021 04:57:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyP-00031W-1A; Tue, 24 Aug 2021 04:39:57 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyN-0007eD-Aw; Tue, 24 Aug 2021 04:39:56 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:49 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:49 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TXbc3mC19+MfncM/gN9CgmQxY3cfCXhYd8mFJWVNV9uaCkrjAIfuJ0L1iKYV4ZtLZCkaFEC7wrzJwzWpZQ3WsB6kCs8SYKFqrbb6aNs2XB6YD13rz57BODcp7vMiCXEuui2IisPYA/i/Yb+UgnzSMv4oBdP9JuwZkvsEgjlbxGKlqbvKei5t8OCPRCSfuCO74PP4as1ud13sQxOAiQZUhuhWXopZKNjFQJ1ge7Pf7hbz/u2IfUgKJm1sNo7HiT4zIo0atioJGsT4514anoJmXdAJhk53OPY0/bHb+L4vXnFR8a2vrmH8sgWeluP6wRGlj/G47IYcseirbapE8erjdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6FJWIhLdp3ZBunz4U3SknoYuQthg0pb2m2HtQWXoZ80=; b=e1dJ5Df540nDtlvLn5AWxA2Va/sJB4VwBLU3w9YieSCsOMPVtzcP8WY9NHwxw/eoC1w5eTYHPTosLlnrm3xT17nU6vlgWMAJIc2GUlViFguhhxg5XLKGYmSpwr7a1/RmJ5UyCTHD7FykBbcc0Y3GXL/Wco67PnQ2+61xq0V8MXWJdajVFi5coEvfFULRQKJlzP4Dw35aAOozr+8Nn/ne4WIZ1uh9nC/DaH37YqVV5S0bphkLh2rgbowpXTsMUs2x0EPpK7w07iMOyL1sR4XhvfyZudROBCHToLODNWI5N4kDKroqLN+y52jrqj1gRp/wQNPHAGFoyYuW+ajn2BUg4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6FJWIhLdp3ZBunz4U3SknoYuQthg0pb2m2HtQWXoZ80=; b=vI367hPiqxJceN73HkkW0mQl6tInsII0L6JMKKjD8x60nJIvXjGPoSNkhrT+F3+KbT4CBlPqJrx8n3kyKEbSNvYalsUvego+kR8mLkMiNexhjWzvk259Y7BwwuKqLfNl1vaNCOkLetTk0SWFUrtMFvGnH9fxRngFIYCcksDY38w= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 23/34] python/qemu/machine.py: refactor _qemu_args() Date: Tue, 24 Aug 2021 11:38:45 +0300 Message-Id: <20210824083856.17408-24-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9958987e-81c7-4f2b-f703-08d966dabc2c X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gJj4NK6UDSjV+5MhVH2OCvJpYAzhFHPrniDbu66P6A69ZT9qHUpiRRDebsT1QiZPbGLeYYw70NB2SvglDmzwKLsgzy5v/YfKHJc7yCn1nU/FsQcWejwuI+Xz5RaayBngbKEOJdw7CBlvsYXuhWTJOW6MzDNJnMjEWX0fd/VkTP1ps5ilVKST50lTGF11g+xTRgAEF/6iFCjm7981ZhiE38bLoh5atm3aTlUHkju/y0PYMI/oGNlYkPKJSL6cHGWhypJWlpuaw8VmWndmRXDqgOu0XTjlnU1UGMrOHFGRzYNk/YzpYCFP6L9/WVPzVzAAsXWciZUireQ0hw0HGWeM9naVafKboKht3RCyZJT4BNXtE5wVMqhkegauGy2yCNvTTYGwqYdu/yKK97JZC9lQydmHm+eP5qiLRcZJd+1oxDHXhJsz7ggDcJVDNSDXNZ3298pgMwgzJA2Wbe/BoDz/kC/y420/Z8uZeAESJKkpmm2GO3fQJQkl/hNkQqczH0B5nrnpHZpMfRzhvuhAkSanFqt+mFeP3O+FaH28RbmPo4jaFnMnmcHakWQ5n59vrmfFqi4cTnA16gVgI8JRBIQF1x4fq/NzrDwETI8c95YcVPSdrrKGkbAhP1riyVuB9gJFT4jrHA6foGRI5Jp3BQAoOaPNuxgYAzr4Oe7o7uOgeHsW6MnIs6RPq9S3Fo7VHZaSwYHoAfEXTtAsbtgeNMj8aw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6666004)(6506007)(52116002)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?sLIubH2i0GIzKvXIlQMfaHg72GH4yMx35C2SebapAZioxc/+yi3uCp3tB1O/?= =?us-ascii?Q?0ovaJ4f+WfJzxe4YMZUZE5teHdYaNBvWrjr91kearmcssY4rvZJ+7IAoJEbr?= =?us-ascii?Q?mQD5rHU6sCcwlq7aijFVyH3owphESsXyp0219JmXdSxubujYvncbdIx826HM?= =?us-ascii?Q?SstucqJv7rqJRnuKFIvIVECnz7pHWNNtFzCIdA5I8UWkHxEI/7tBwmzv6IIS?= =?us-ascii?Q?Q2Ac0upZU//eI1/B/Y1k7Zv9jeNT1veB9OChzt7AAgXv2AGJAFyJht5LWEzk?= =?us-ascii?Q?X0L6hvXoQyzHf8jCd9oGAmvSF7LhyBQ5UYeFRxoV7a3fBVI55/25D9JTk6Z0?= =?us-ascii?Q?wW6rDGvDSpKv3EnIq26nxuWCWzW/tc/DsoHNZ3SB3j94o22ue0CqscV5uYme?= =?us-ascii?Q?E6+pDdW5vSnh66ABt7hstO2W/zJ6IFuy82hRMmN3sgW8pd2y8xQoAV5rYCIC?= =?us-ascii?Q?OsPkVRBYjWyEN2n8M9NDH38XRh7B6Sf8KyIEvV68ENtqI8pMMZ6dBu3p2bzS?= =?us-ascii?Q?OHDCTpfsRxuwVLI6Tdp54CSDY5tFQNzFGPyENPqs8G5Kjm+G6rpklDuE4HFW?= =?us-ascii?Q?+u9jG1uEfX1KT53fXHCNqoqRz2RUYKnDGuNSkQ/AGq8TEzRSFNObmmSpNXkF?= =?us-ascii?Q?VXV4ETMj6Davsclwj+IKWvmIJNLkGdcHfoMnazg+WLOEwNEeyeNmlvoXtYCn?= =?us-ascii?Q?7lBM55C7WqTN1qPMdHV2qvIWQjYfBIsMAdnVn0yf5u/2Vih6gsOVETAPcRSM?= =?us-ascii?Q?biuIKtakNzw66rojXbiDQIhgEVgZpoQC03lFk2PoMr3QG39lt2fFbM6haYLX?= =?us-ascii?Q?Doc+JqLGPoiwermDZEK+nfDhUeDYb03d/KsVnYBLQZky53WjP8C6lzry8ERQ?= =?us-ascii?Q?Iv6XY1Hrh2hFcDG17ZFOYuSJ49CUlhE3ZthIZ98oXnsVWwaPoxju+gGc8B2W?= =?us-ascii?Q?tepoDUafJc9yh9EXvrdQnuJUtjFWqfWBREqhb0J/EBxiwcNG0aDrpAryB1gM?= =?us-ascii?Q?LeMy2KRRdHovxWpS1ei5tTK9uOp0Cd7eTGSgeFR6/PhBgvhKVnka73t1wB6w?= =?us-ascii?Q?AGMCoCaJr+h6yT3Aj++NBjClXxaNjaem4vQemjm8c8YdfgW5yHHUqtv3TElg?= =?us-ascii?Q?xQb7YvxqkLsIe9Rp2cexC4SY4B8WkGFn91Jmc4lP3fwQyY/JIA+u07SvO8S9?= =?us-ascii?Q?Tg9FmLsJWc2KMuzGlW+pcFGH8ZqWH95f2op5gWxE/CVohx4Z7CPcTeMhJkZH?= =?us-ascii?Q?ML5BTp/qk8LLtRwaUfXnoZECMG1KFt8PkD/ZxwHAfMxZN6W9HCo9mrqACs4v?= =?us-ascii?Q?ShLYzAKpAaYLdiGlIqpDgH5H?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9958987e-81c7-4f2b-f703-08d966dabc2c X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:49.6847 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: neZ2859fU+hciQiZUjMH6fXTG0Q5r0n8s9ONPN/NEoToBVg4N0x9ImwyedXao2rCM8NY3vohPdR62/yWtSdff6uyGt5Fqnt0VwzYFg1zwpY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795442981100001 Content-Type: text/plain; charset="utf-8" - use shorter construction - don't create new dict if not needed - drop extra unpacking key-val arguments - drop extra default values Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- python/qemu/machine/machine.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 971ed7e8c6..5eab31aeec 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -564,14 +564,12 @@ def _qmp(self) -> QEMUMonitorProtocol: return self._qmp_connection =20 @classmethod - def _qmp_args(cls, _conv_keys: bool =3D True, **args: Any) -> Dict[str= , Any]: - qmp_args =3D dict() - for key, value in args.items(): - if _conv_keys: - qmp_args[key.replace('_', '-')] =3D value - else: - qmp_args[key] =3D value - return qmp_args + def _qmp_args(cls, conv_keys: bool, + args: Dict[str, Any]) -> Dict[str, object]: + if conv_keys: + return {k.replace('_', '-'): v for k, v in args.items()} + + return args =20 def qmp(self, cmd: str, conv_keys: bool =3D True, @@ -579,7 +577,7 @@ def qmp(self, cmd: str, """ Invoke a QMP command and return the response dict """ - qmp_args =3D self._qmp_args(conv_keys, **args) + qmp_args =3D self._qmp_args(conv_keys, args) return self._qmp.cmd(cmd, args=3Dqmp_args) =20 def command(self, cmd: str, @@ -590,7 +588,7 @@ def command(self, cmd: str, On success return the response dict. On failure raise an exception. """ - qmp_args =3D self._qmp_args(conv_keys, **args) + qmp_args =3D self._qmp_args(conv_keys, args) return self._qmp.command(cmd, **qmp_args) =20 def get_qmp_event(self, wait: bool =3D False) -> Optional[QMPMessage]: --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794830; cv=pass; d=zohomail.com; s=zohoarc; b=YiTx5421cZhBZvvKzwO+bKdJ+T4LyMgEztRpGyt+80xbEn7yla4/YGgZph7GYNUjUEf3c+pTsD1jn/R0Jl9sleTTB2nENI9aG1cZidsqlaLrHH0xScvPKd6+NOk9sPRpkk0710LgkKBGWmlr+FyKxtfNr19x4ArTWBqogbES+KU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794830; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WJuVZ1kuk0Wl5cOGUuwIXKMMuQ9XY9UDNeImIl4AjmM=; b=isU/gjlsfycD+zMip0mVHRVIk3X5qK2gUeZZhaYL0+Bkrfyg+hhzKKZAQLOGXr6r889zGLOnDqlWJeeFFn/ghMtHUiEJEkYmIwlywWBaMFz/oA+SnpUqVcS5Ek+oDvJVjRyU3+u6ypn7VOol2yGEY+YdOBkjbsYNmsqYtbD8Cf4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794830378570.8378278781539; Tue, 24 Aug 2021 01:47:10 -0700 (PDT) Received: from localhost ([::1]:46052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS5N-0002py-9u for importer@patchew.org; Tue, 24 Aug 2021 04:47:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyU-0003Iz-P5; Tue, 24 Aug 2021 04:40:02 -0400 Received: from mail-db8eur05on2134.outbound.protection.outlook.com ([40.107.20.134]:13121 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyS-0007US-OM; Tue, 24 Aug 2021 04:40:02 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:39:51 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:51 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZAfzH9rE61wd1lJSwRGgzzqmYb1r+bTocPPflDM+64hKovNXWeaEQK5X7ZJgHjmSyOkb3CaA+bSWs4+3mbQ8+aLOldyanVRajvCUhy9oLW6h1QwMsd6F435yrglyIrX68bM8nRCV6cjWqw8YdE9u2SzrhdbiW9BjBvmVtEz66qaY5q9tKsm8SWxRT3ZJWjSAduqt6x+r4nTlbxYmZuWF6OZIg6pahAT3IVEGA/oXZm9JSVwFf+bX2K5MGdTT5+sbH9KNz1Ncd7h2M7zmN2w2BOX5mCiLU/BVIpS3vM+5w4F+jWFi8DwpR9Mldxk0M9BUwiE2EpdRqm63q/BRYGk+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJuVZ1kuk0Wl5cOGUuwIXKMMuQ9XY9UDNeImIl4AjmM=; b=hOuQiIt3+bJxbriKNpuuNR14U6uaeIGK2iMam5PhiTHRR0CjwtPuuKdf5zBwUrmhAwu0GqTfFKocyIV2Cet9+26BSY9GV2nFGO9IOgT/amAi0sWtuX7+jMusOElrE3EIdDIuLMRsDXUmRueqMlwbMxBxjuLZLzKOsiMN4P7nSqTuV2ywCvUkyKtk6GyD7glafBinnfsEmBhv6x9RFw9qU30EIk3wCq4AKJ+fcROs+SsDKhMwnhYV/ylMuNsR2zKE6qRmX9Vymo5jVSU9aMzfeGioMZoQldywjFoJ64fnZ96hPrUdjRqstj8q7bJOPAHCtPC1U7x7kAOLkYOCKU17ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJuVZ1kuk0Wl5cOGUuwIXKMMuQ9XY9UDNeImIl4AjmM=; b=dAuv8AN5Y8wQ1boqkeyYhNS4knc9YnrDMJ68n54ijyLdnO/y2X4ZXLZl5dhDtvgd5iAjIREH5nH4RRRhV0NUePU0YGbN2H+7mWHFGVh+jJcpKV9OFop/OVUHtxOLN1qrduycG64zj/F1J3JIgDLsJirOzeU96OyOLtcTedwVNZM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 24/34] python/qemu/machine: QEMUMachine: improve qmp() method Date: Tue, 24 Aug 2021 11:38:46 +0300 Message-Id: <20210824083856.17408-25-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fed0eaee-a1e0-4892-fbb6-08d966dabcff X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +Dhv+RgylPKQSdKblwNPmLcoIEd+rGHWdUDCyQFAxAsx4BjNJOyUzou4JKxC8HbIsIJFlXk/TPAipCzt9/OJdwRbqWZwQiEZZNrH7rNE3JLTN9MOh7NIJD8oLf0QbxpNhm9l/YwNjZoacD384pwXMRAFXXVnMswq1EKdODFX7Gk658do4U3PnoNAyH+zCOfNqPBBwP2QzpoO42NP7NFwdfDNzxTlmJ/0oIJaSdNSS7bh3mZ3+8YDN8Mu3OC4MV89ftruI/peKwOFVgljSbq3etJ/Z1YfU3IDHc/jCxRLjxoYYReuNDEnE2yHQI9aOpu6k7lrRycomGLVZC37E9tnCuSZBcKTkZgucgpUGa19aWqP7pwjH7/AMuVTVgHa0LY8F0XoMmmPyOnfOw7tMXAll4gTbX11dvOi66cXi9mSGBBpNMKvmSlUj3PMEihmS+QpMgZr0RF1dnbqSxj2Z4mGtXxPYA3wDGAKdcPIX/ngHuVLUhAZ9RNdzCDn+WlcGiA0B7ViBXm+I5cEwrqzxAoW56Dawi3DHTdDs8Fj0MrnqEr0OvsBn3t6q7pD+62Uj0HPlATQEtRi6W3oP40aJzcXKPbZ1P6X4ANyFaHSccBRwarw9wk6Ix16KARzr7N8awlDWOicsQ+58CHPKL4woy3H1Rob1srxt2o3tPmY0nRxREb/oDktuycQVHXodH3280Q48XVizhDbfUIwCPVF+f+3/A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(6666004)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6iQBjEPlHIz/uzsP/HKbUv5ilRxWOeBwqWA8FBn0goaOIE/MfbMwFJ2XUP+s?= =?us-ascii?Q?92snj/cvlR3k+8tzMUxcgyDUH7Y6N0/2/H7vDvBrq5x5u5zzaZK70vgx1utq?= =?us-ascii?Q?jU+UoknwzGkPy9CVYKmMyhRC+0AWw20aQFF6k+c3MyxqyFrhxJTKRwtzygDn?= =?us-ascii?Q?1ts0v6JQvHZwRZJhbhzqcRuFbPo3Kw37pP57flTiWnXQsk0Zsczgxjnk66Jj?= =?us-ascii?Q?gGml0NlN4V4OSrsJye6kmZPaE2ah31ua72R/YvUhs71t+vsbtqNLHRM0XMCk?= =?us-ascii?Q?n5ShezwM7Yitkh0mOMUG/cpEAKE2vCmBOTO0cVuxHb4FNcGWtY/1ViSStCYz?= =?us-ascii?Q?J9jH6SvSpW0ZYsDbatFwjmOzp/ah9XLurogL26CnKm1VGOOqgoMFXkzEqmh8?= =?us-ascii?Q?SeDzGyZd0hn7O9hoNjoiEK+uN3QS1AhP/f0CY1NM7LRZLHpXD2qqKHbZgdgh?= =?us-ascii?Q?Bk3kUmQBcSr7+Dk1/53vhL/T8AZxGNbXWIBm/0Z2XTwaH2Q9dY7mB8QBGMqX?= =?us-ascii?Q?AMBpTwRUZ38qp4LkS8bJG51ubj+qkV1Y+hIsmPU6YDY+UJuNVQpjnPMABdwC?= =?us-ascii?Q?L6DIh83jo+RBl3V5ul8TotlgcgpqIXHTRDTfWuOUYwBpRr3ejnQVmJTQbBsZ?= =?us-ascii?Q?t9VCTJ3e0U9i6LiGPD3041T5DKNekCGVMBttpgUGt+gOL21uZaELtdZiZx3H?= =?us-ascii?Q?77Tv5ba7ttNEV6IfgqCz/c75hUWaA2OyOI9uf0xJIP59oaQR8s3WYHW52sTr?= =?us-ascii?Q?gf9SIYNEFNgkK4XYqnmOchVLR4P/kwQLej+wveYpzj/NhWXoIqIC4l+ZiXSe?= =?us-ascii?Q?j3aYAz1QMuooCDqollMeUbfVgbNEIDzL4fS2cEJ/gQ14Mt5OQ6mfJqgBdgNi?= =?us-ascii?Q?Yutg6YuHFWhD/nY6IIl9MQgnE7oxutrJ4JFBId7PtGbHJsaVBNrJ07BEruEr?= =?us-ascii?Q?m8h2f4fvu3E0wcgNxkhS2v+vBiBb6Uvvaf3r26sNysbfDlI9Z1qF5WVfTEIv?= =?us-ascii?Q?o70dz0JZNX1NZCWt+bD4ujBBloYrQcTCcCbiWPc20wsPNLU02ZCkYhflsmWD?= =?us-ascii?Q?TLt65CEfdHX0PlyaMKalhQfChzfCQSI5MiXINFfKqjKmouPdub7pyAY32mNt?= =?us-ascii?Q?G6FIV7eijzVnMYOqrCwZPUXYMf60YXNYh+HPAh8ARdAgPPiOpVWlKl8moaPg?= =?us-ascii?Q?nr7g5aG1r9Ml1F1mBnKTKVxrVWs4jNaLBlLOAZU35Rw7dJdU8Q4elNXMZpkI?= =?us-ascii?Q?CGy8mpKXrVgRTToeh3ECBGI5UHLJIZKKoSW5by3VjINqt+Iu9WeETZRPQNtV?= =?us-ascii?Q?JNagdzW3vgYv04Pu8459J6V8?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fed0eaee-a1e0-4892-fbb6-08d966dabcff X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:51.0656 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m9QLMsqfdUESBp8B2PeUIAiGpCkY/pRERfuSffTj4vwJVi/NJif9xAy+Fjp49Z0SCYhUIdWi8DQs5c55Q4XZIvg+0OVROoU0CC0NFOYYDtI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794831721100001 Content-Type: text/plain; charset="utf-8" We often call qmp() with unpacking dict, like qmp('foo', **{...}). mypy don't really like it, it thinks that passed unpacked dict is a positional argument and complains that it type should be bool (because second argument of qmp() is conv_keys: bool). Allow passing dict directly, simplifying interface, and giving a way to satisfy mypy. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- python/qemu/machine/machine.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index 5eab31aeec..ce1e130c13 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -572,11 +572,21 @@ def _qmp_args(cls, conv_keys: bool, return args =20 def qmp(self, cmd: str, - conv_keys: bool =3D True, + args_dict: Optional[Dict[str, object]] =3D None, + conv_keys: Optional[bool] =3D None, **args: Any) -> QMPMessage: """ Invoke a QMP command and return the response dict """ + if args_dict is not None: + assert not args + assert conv_keys is None + args =3D args_dict + conv_keys =3D False + + if conv_keys is None: + conv_keys =3D True + qmp_args =3D self._qmp_args(conv_keys, args) return self._qmp.cmd(cmd, args=3Dqmp_args) =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795527; cv=pass; d=zohomail.com; s=zohoarc; b=L+orn7pMCOYsX77+8Wce7jkPd8AkuVu3wc+Rr33MqonebdJx4CljVPqat0R0rGwTh7LwAAdqVC85yh81y4/ypHnvQDtGcNfYdj7Ta3EpaWYg/XvqSGlbohpHagwJorUArxfKida0hUysPSSC6G+EaR3MPGBPFkcQuxFuVTy6mBw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795527; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e3uU44tcrU1em3AcwKZs0h/khB6xFRZOacOUIEfk+ew=; b=mny9iSwBxrqQTDy+qJWFf/a2DEOAm9lN4W9DwYSC5myCRhX4mjMMUeTFQLRYgKEoHZSIW0stng5gFG98y2D/azIY3zLvimGrJA2oPFPVRmmytxTa0wx2wfh7zL/J78MdBy/6MFqm15y7626maJKTdqkywMJpGN1m1BOyCqc16Gc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795527096791.485783466691; Tue, 24 Aug 2021 01:58:47 -0700 (PDT) Received: from localhost ([::1]:35674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISGc-0000O0-4O for importer@patchew.org; Tue, 24 Aug 2021 04:58:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyR-000397-Eb; Tue, 24 Aug 2021 04:39:59 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyP-0007eD-QN; Tue, 24 Aug 2021 04:39:59 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:52 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:52 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UrOuhTsz5anD+R4nWg6QpShmZrBWM0i1gqIP6q+V8dxzeJWdWCDZdpqqF9qirHtHKbdap7GU0xghysxPj4pLZY/GSxhqswNR1NEpSjtKBHcGx/i/RllJFAJsM3PWTnTfvWwet3upA7kwhN2fz092r9b5THtIEktPdjgtvMgY6Hrf6x1FtYWZXeBPVVBH6gHNjvDnUk5Pc1x6lR6gwDRV68fPnhLTLuZwzIGUYSFI8gw9lh2BXyueN1OTFlbJINa+Pett7EpudkdqkfZUv3aUKPfRJLTLhl3tpx04qsAEbEllezsnEcIlv+GL3/M92H7RBDb1CQIo6xehBppZn9X7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e3uU44tcrU1em3AcwKZs0h/khB6xFRZOacOUIEfk+ew=; b=et7+nxslChk/5rCU7u2DzooUFh45EmdlFgOSToVcfoZ3G1QKhs4MBr6Pv1cs+SGP+8uoY033RQeawOnzOi92Fl5Ea7IxydJnY5tlZ8mMzonmnRBwhnmwgabAk8BkGobniPUHu9wbJsg/1N4fo+6kDXuo8Z3jOzUBhLuOWLkVF9gfrlUeiyj54uiN+eahm50X5wM+nEJml80E1SyqOwtfxOvSUurmA9wtHnbBhDVn7w6hfV7lJM6ErpXw4zecW9eYMkGwM0v2Q7VrRfEuqz1n1UPOXcyWPlwkVxSgXewRWoHJfoQ2gf18PkK3G6dQxGo8S1I+L0s/afPqOzyvGzE7mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e3uU44tcrU1em3AcwKZs0h/khB6xFRZOacOUIEfk+ew=; b=uUkyhzA1FxEH6P+MurZMYDoaDFNtHe6LujMGp75LJjG06Le5DdLxI8e6a7DQMw989Qt9WhkHR7jJAFqOxkzwNyf2kpjmEa3glOMZi2WNWRd096A03wg+BZdP7AvJ4gGJLREBTwUiBKMRBvbDAGkZpdBzb7gdCcb1iKOMCKUfQDg= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 25/34] python:QEMUMachine: template typing for self returning methods Date: Tue, 24 Aug 2021 11:38:47 +0300 Message-Id: <20210824083856.17408-26-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e8ab60c-cb40-41b2-c273-08d966dabdc7 X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wmL+5bbt0lQfrxh2ZQywQ4RrxgW7USng9XM19i2wYIBaQ2RVYQwhC7al2S4MklAfRDyVBzdoTMcrHPPomOKKE7l752MtHzQsVGD7BiuJUTjo82dVDtd8PvWSppDEN9JrREgdFIAWihKmgmOOikL4c2+rj6ZHtLY2Wf7uMdofCKLq7Z1a33cqqt8EDKT4v5T5bUoHraMDWfte6tr8zuaQjww30eMm0VrltUFlT+VmSLuYyr97piK9yctM1vgkMRmDAasFJxqqCyxEpWQiGLHW2ozOjy5A5bSlGS0YwFOiKyE2U3EK/d4rJgnaKW/OtxR8aw6cRvfxSpZXmMbrSrdPM27w6W3aEvhsm4MrqEJEIjQVbfdZZbMkoqzGA8Gk3ZvEWXOw0UN4BrM1GNerf1lArrHXUBfJvmesLvcen0c8cbHw9ZXeWGhUf/n0O3QdJZ9mZM5bUi/grnVMfVmNskrFmawwsLmsQfY7Vzg8PuG73aPhnVU+z05mCL2f4GsdkiASes0G6hZtTTPnExg3N6/1VhvoQAu0GMv8RlKdsSFmOKSRGOecT0PYP/vRlezASxIloenkUvouJyp1d1fd+C9LGmE91GEUz+VdgBNMsAK6w8LcWHIBwWZG99XlKHWu34J62DW2HhvfJpTDnEwVpAh6zMSbjNZ29OfUJxD7hNU89nUCkJpBGf2Q9ChZvsPHMhbMBDRsX5Opuvcxx9FT12bYZQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6666004)(6506007)(52116002)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jba639DzZPNtXpjDQxlFIMz7EjDgufYhOmShMmku8SWSs9f8MXwAslk7esCk?= =?us-ascii?Q?BL/8++EqSlTF2NRFZu/hnXnb6xQpMmhvH+uJzY3Z0rXPfZV2QVYWPJ8umC2k?= =?us-ascii?Q?7wnX1QM6uduoTO5JB3S8iU5al/+idXJzvI1WF2fEpNwtdsXyCm+fs8XXwjqB?= =?us-ascii?Q?IQV4sAdWFmP4Zx8XKWwE3yxtV8KkAiHz3BWNWw845UITPsqrpXmvJVJDNafy?= =?us-ascii?Q?QfEmCr5Y8LLYPs9N+nD76/nd+MTa4VOcRRENgujzp8uL6h60mP7Iu6jeHIqy?= =?us-ascii?Q?V7xUeakHokSgKqlxvFjAT5pIaYStsUZNijlpW4mSc6ljdLJTdwD/PcU5iXMP?= =?us-ascii?Q?UhF1ykXyJDzVb1/fe/g0bTQajb00H5cS/WKSj9kwKwJino6SYssyqW9BwMbo?= =?us-ascii?Q?AfXuCk7xjUclVJUzYqE8uX2DqPHOhnuC/nk7hEazsAeXfzKw5acELApoBSYD?= =?us-ascii?Q?6S+Uw3dgy/q3Iz6iVQ6j25+AArAn0fyG7vGr6TLEWKnHfJwpgDSk3UWCG2NS?= =?us-ascii?Q?BuYn5R6CTLLdTRX1RbExRmjJhuIFNBg8TTxXnIkw43OkUKjSkTNIEVZN6T5n?= =?us-ascii?Q?7mgN91+SzJGrPDvpGjUOgXySSgr+tLhtYxjLlfW3eOVKmB+PwcdKg9HW8P8u?= =?us-ascii?Q?aMFHiFsR3Qy6cYTfU/90QVzyyoJtoaGohzjXIjyMcnF+/LLz8kxhQAitDGuo?= =?us-ascii?Q?+YIEngtqeTH/+1gdcPa24O0n+54FiPy1sQ3qfBv1pc5vxA12d3DYUWtbsfkb?= =?us-ascii?Q?k/hvX54yyCrGfQBnP2eNevLm+6eyc9ZtzYsvOqqpKrWOFaZeYqo57whTUTdr?= =?us-ascii?Q?Gkupy1tM/fUJCY0BbLn+DTe+hJxIsWbXaMQ0sX6WVquMaMLx53RJozcEhrMb?= =?us-ascii?Q?jrAkxjIQtYYDGmrC8xLsn3JIdFOaJcBg+3s8rQ68atihlnchIvS/PgM+ipfz?= =?us-ascii?Q?XlFdTj9KXSLahq1Opr/Df+TAuZ2XQRC5naqGFbM2P8Njz4h+1KLnjHhGsr9s?= =?us-ascii?Q?2rDmdi3L3GRk7qSNr7fK42w3YasAk+eMFXUm6K0rt4w0fxS4WmjA1Smvzsam?= =?us-ascii?Q?bVVrnej9IyIrWp7xbsj9APVywJCic/M3lLXiGECcb74A9NHFrh9iY9b67XAX?= =?us-ascii?Q?iPV/MorOtOb6m9s+q7JDA9gazsMk4XT6fdVdNZDqOUw7whQFro+K36DNMeTW?= =?us-ascii?Q?tOD40Fa5E3gssPJEQvmqb0XBgx5rimrnje20lD1aR2O9NN5bDGr55Wg6dOoy?= =?us-ascii?Q?wW7Co5jNZEcmnRb5NhWTRq1oZrduh6VOnwBZzW+FbjOI/pVEyJjnzRjK98PD?= =?us-ascii?Q?AMDDq2x2DaIp0G49Btb3iGEk?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e8ab60c-cb40-41b2-c273-08d966dabdc7 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:52.3580 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uqFNlEsSjGQPqBgYznLp3QTXtqkDtCzvXackWu2blKr5gBHLJhmCGV51NF9EyfU863KOx1Z5abH8oYgr15V2AXRAZbSMTnscVCthHJVK9ao= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795528855100003 Content-Type: text/plain; charset="utf-8" mypy thinks that return value of these methods in subclusses is QEMUMachine, which is wrong. So, make typing smarter. Suggested-by: John Snow Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- python/qemu/machine/machine.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index ce1e130c13..1c347d2c30 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -36,6 +36,7 @@ Sequence, Tuple, Type, + TypeVar, ) =20 from qemu.qmp import ( # pylint: disable=3Dimport-error @@ -73,6 +74,9 @@ class AbnormalShutdown(QEMUMachineError): """ =20 =20 +_T =3D TypeVar('_T', bound=3D'QEMUMachine') + + class QEMUMachine: """ A QEMU VM. @@ -166,7 +170,7 @@ def __init__(self, self._remove_files: List[str] =3D [] self._user_killed =3D False =20 - def __enter__(self) -> 'QEMUMachine': + def __enter__(self: _T) -> _T: return self =20 def __exit__(self, @@ -182,8 +186,8 @@ def add_monitor_null(self) -> None: self._args.append('-monitor') self._args.append('null') =20 - def add_fd(self, fd: int, fdset: int, - opaque: str, opts: str =3D '') -> 'QEMUMachine': + def add_fd(self: _T, fd: int, fdset: int, + opaque: str, opts: str =3D '') -> _T: """ Pass a file descriptor to the VM """ --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629794698; cv=pass; d=zohomail.com; s=zohoarc; b=LZ1fRiQ9uqstHoCBgvCTyqttUoqoQHL9s5bGnPgju/UlhRmQ1K8edLCNgclFCQiTnd/dJzVs/H9cIJqkM06XfCv1RXJM4GXsnX4rrU1670sCcJb7jLb/5eB6sUGNPhJ2UQZybK06tf4ceE8wRsIUdMcNF1eDpt0ZuZmf5fmCnFE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629794698; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ofy2QVqvSoIMLrXQBtXlnCHooDNtNXeEmY8QERMhYiQ=; b=RTmldhZewBivkdv9kKURF+BX1RYkqdzbEOpcUZbsuLiXCAhkgJdhWJk3p1t/m7kDSXb1+Ud0LnftVOoakWLx7xo34w53WETj45TJRzQAhNmVzJIwPxDk5I9OrrRLyahByEqVoAPdprgW1oLf8GfNwJEVnbvNOAkgTyQ92w2EAVE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629794698928249.47872484305606; Tue, 24 Aug 2021 01:44:58 -0700 (PDT) Received: from localhost ([::1]:37478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS3F-0005WI-Rh for importer@patchew.org; Tue, 24 Aug 2021 04:44:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyU-0003HH-7r; Tue, 24 Aug 2021 04:40:02 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyS-0007eD-72; Tue, 24 Aug 2021 04:40:01 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:53 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:53 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSZuXanLeoA4nX1D/YLIKWd+sntCAEXuXx9Axc9yR+NZZ37YxA3A02eflJDh84UYTpIgZYh0WhP9xRWYjizbrInX4xaGgIlK5Fj3kEWeWClp/0VCr/FvyUxEADYiOrT2buCKsdK426JmgH9fueWdmyeb4/uSA+nKhVpkXMDfF6wSnvwHxUX7eDRF38GLFkigdPpwrVprqKh4UKBHrNlY31cUGjAd5icavKh9K3GR4VvDzcnffkC4PlgIFpWqp6fgmYBsf1T7lSJjs4qB0YNsquFq5+ZmsUR276ytrya3Fc4wD30duUm2uj/jU3zh5cCcOP3Ud9mpzhsXl6QlZ4fXdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ofy2QVqvSoIMLrXQBtXlnCHooDNtNXeEmY8QERMhYiQ=; b=NyovyubJdV5TSvcQDBAoHpZTc6YQt8p34v9Mh+AlBmr1qAHUSfHQUukO1IPHj1HK0vNvt9EGJpxYATICMMz6TI5XBHgjZ783l5gLbh8GCbgk8A6AtKaf/L+omyFwkdEZ9dx3TuyIrH/j9R/wZKUuNpmv2GyNViAK9mUIdRXQFVrqLqNS0rP86WcTa5WDtiL6G5UaDVfXnS6VdcPBAugBtSAbtqjXbh6eRwOUH/MDzhI8FdTHWiryShtyJor75P067V7qnSCcGrpycwfvC+19CLDk+7/rnMVup1xRgDFJCBOS3nTTo4CsKOsqig1ELnQ2AvJDC8x0fl0c5Hy0g0nMmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ofy2QVqvSoIMLrXQBtXlnCHooDNtNXeEmY8QERMhYiQ=; b=ByV1zO2IWxfyvklFDpCagHCw3zL8lOZaaLOQ8XzJylue6iXK3vF24w63tQIRdSGI7Ky9TcMqEr7E1kV6DjTbJPYxx5LNSFpRUWA2vdfTsOuQLjwPCi1wTnkPEPXPK82GbHM3KiQq4Xiw+DI9eMvui8G2j3E56YZT09NWEv0El74= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 26/34] iotests/222: fix pylint and mypy complains Date: Tue, 24 Aug 2021 11:38:48 +0300 Message-Id: <20210824083856.17408-27-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 476026ff-5dab-42af-6f89-08d966dabe97 X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:454; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VV1q9LhyxmsYM9m06zaKdvC+N3aHQ1jkvKbeWnd9118Zc6ycSiFqapL7TlOo0HsdFbkUrETEcKS23IXVkYzS2sHWU4Bljg9JoeGoSi9odpKwoXIhdeA4FEfHvJICOHksppYD4I1crmGwltT5oIy2JkqV0Wd7cYnRe4xaPtdVA5G83ywNqDys7mdCiItVAz00VK0dwal+We0KA2+Wke/ZrjtoVFxo6CkNwzZeY9q+LRyegZzM4w2SStqpybFNQrhlZ2gH2Sz8QBLxHPBr98yShZ1NVPiYuhNLeF/z8sHDzCNQ7uRNpwDKvbt4Ny61rD5JxyRiWCpIgpkGeaLY89yBbsDqauAUZVlT5UHh4HhhwRJBrxo4VeiKIJwEFYnkhpp/BIFvtwBJqb5/mg8UBH4teDVNdaPOL53hSxl7k1cZeZtHq/zkhdHPV+vordQ97CHmPvRzbk2V5GPKdKKCslLCsm5vEw4Kt8HB1KIy/ZHXJ1ViThS79n2m5Z0V5DfP8HXotwwX67qL/4F8B3iBHEuSKNedR3ZSmWQHf68MIXAKYRzeAM3V6HzxtW3nhB38asjroVfNY/cmasyF3efTMgPLI/vc4JKT3jz4rsbKePtCxHIyfMqA1YJ++p/QqNVnp5WbdxM1a9akMj0pjQPBpGfjQZRi7HESmN0x1/degpaFZ6GelftT8HbRpNrvZFuT4fI+CMP9u1M7GZ5AGwY1kEDXNg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6666004)(6506007)(52116002)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7L0Rj+9/jFZBxvlymdr8SgDuJiWlGRa2WztnhmAYTF5lqgWvEaG169IXUNX5?= =?us-ascii?Q?tSdvwffRZ3NRHID1SWFs+H77epDZiicWbu9hUhJeEWGWOfsAxL518iwAze4p?= =?us-ascii?Q?GnD2myiHct+puWn3l0bffnfwPlmTYPJwVHi7nZ4D6NCj2iupvD4MW6/fqdxn?= =?us-ascii?Q?naacPMkHY6aygWkh0w1OnesDJ2MXKshrdEGSCs5HhFUCnJCRiBMppH81SsDN?= =?us-ascii?Q?L4O/EiZnJeLF5waq7v1GFmmMPjwnekZ8zooKqYzNKCWgB75FkM26dThs0YmX?= =?us-ascii?Q?xjIAYJ5QmOTaqe8wOq9LfK+AwQnwmNOrBnMNRtcEnk+iYwiuBjWM4sZyHbZv?= =?us-ascii?Q?vdY9JxrUlt3qKtVs2QBcSB4mWwVFND3fUJ8GJVsBxfUwHQY8zcHRlckDY3iR?= =?us-ascii?Q?AyM4c3hO/5n4b92QjVph09g6Fox0FXH0WFeL+5Aklx5eoPRho63ssu1nU0Ps?= =?us-ascii?Q?ARS9yfRyoJrUc4OTMi9K0sRMXmUqptZXHSDfn4QJ3jx61M3ao9Xio06FQhfT?= =?us-ascii?Q?gisQcNR9BfM6gaiCX/UWqdBe8G6aF3hMe5FLOg5mPlkzDGENF+LjfYqnMUXx?= =?us-ascii?Q?slep4de6ZXUUYT0uESYFLt6i4c6bDnAyKVjjzkhFSFib5Q537NeimPkEleN6?= =?us-ascii?Q?8/v2hWvBpgXKlgvhFe66YGovScLIPkpa219cOM2uiPgcO4itvP3wpGtlAoSp?= =?us-ascii?Q?2YmiqcE1U8+kPptK9DnrUFKYxn6RjDcX9WLjIoUcPq0/T+E4lWwEsytWgOI1?= =?us-ascii?Q?ulYdxaKDxzSUU3PfU+PntUcOUjofNik4Hdi1hBKNPXtjZpPAJuiJDg8UT7LA?= =?us-ascii?Q?KBbaoDCcxRfofxCNOgUoRDXQZwF4wYtQKyuuwA/A/+4V5I9Y9g1LiSxR5zk8?= =?us-ascii?Q?NCC47w7A438jg7F5nnsgxQ1oj9SzJVT+CsMhMgcjMUqP/U+2zHw7KFIhphro?= =?us-ascii?Q?CPEKUBL5n8zRpQWo3bgthYffbd2AK/YOi/WkZ4cwOBbL6w1Kr0WBTT/MV1Nq?= =?us-ascii?Q?mp0Jr0kTTUGuHwfnW4kttuj7PeWzZPP615sncIBQeWqG5AQajfhXrWjaCNni?= =?us-ascii?Q?Uv1+BILCZhbCG6v/XFTTQsuDsxZU1M2d/byUBb7op9aFMdmW1eDK/V1qYIAR?= =?us-ascii?Q?FkUSfI7itk9a1O2iEmzG9xFjqBGh1zV1tBPC6zGPQJ1TQvQjq0xhpA3kZH94?= =?us-ascii?Q?sS6Q1vhdeea/D0arKQ0wA4ryE6dMBFZjzf3Y9ezzpiv6k0WjAu6Gno2SN7Pa?= =?us-ascii?Q?dN7WCfLJJeMipMgVkSg0ENkVE4A9xbSyIVDq5t6HC1uAIttJiotJRviR7Sod?= =?us-ascii?Q?zJ74U5fqpbkXnAiRGmeXLVa5?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 476026ff-5dab-42af-6f89-08d966dabe97 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:53.7489 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JrTIn19AxozzCzB7Y8Pmw6O3SgFyqJf5xJGp9FpThxSbY56fnhGw9FlKo9cTwqHK1ybV9tQDB/6enPwnnzkoyi4fx4bBtXksRtuiQjfwAj0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629794700978100001 Content-Type: text/plain; charset="utf-8" Here: - long line - move to new interface of vm.qmp() (direct passing dict), to avoid mypy false-positive, as it thinks that unpacked dict is a positional argument. - extra parenthesis - handle event_wait possible None value Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/222 | 20 +++++++++++--------- tests/qemu-iotests/297 | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/222 b/tests/qemu-iotests/222 index b48afe623e..5e2556f8df 100755 --- a/tests/qemu-iotests/222 +++ b/tests/qemu-iotests/222 @@ -50,7 +50,8 @@ remainder =3D [("0xd5", "0x108000", "32k"), # Right-end = of partial-left [1] =20 with iotests.FilePath('base.img') as base_img_path, \ iotests.FilePath('fleece.img') as fleece_img_path, \ - iotests.FilePath('nbd.sock', base_dir=3Diotests.sock_dir) as nbd_sock= _path, \ + iotests.FilePath('nbd.sock', + base_dir=3Diotests.sock_dir) as nbd_sock_path, \ iotests.VM() as vm: =20 log('--- Setting up images ---') @@ -81,7 +82,7 @@ with iotests.FilePath('base.img') as base_img_path, \ tgt_node =3D "fleeceNode" =20 # create tgt_node backed by src_node - log(vm.qmp("blockdev-add", **{ + log(vm.qmp("blockdev-add", { "driver": "qcow2", "node-name": tgt_node, "file": { @@ -103,8 +104,8 @@ with iotests.FilePath('base.img') as base_img_path, \ =20 nbd_uri =3D 'nbd+unix:///%s?socket=3D%s' % (tgt_node, nbd_sock_path) log(vm.qmp("nbd-server-start", - **{"addr": { "type": "unix", - "data": { "path": nbd_sock_path } } })) + {"addr": { "type": "unix", + "data": { "path": nbd_sock_path } } })) =20 log(vm.qmp("nbd-server-add", device=3Dtgt_node)) =20 @@ -112,7 +113,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Sanity Check ---') log('') =20 - for p in (patterns + zeroes): + for p in patterns + zeroes: cmd =3D "read -P%s %s %s" % p log(cmd) assert qemu_io_silent('-r', '-f', 'raw', '-c', cmd, nbd_uri) =3D= =3D 0 @@ -130,7 +131,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Verifying Data ---') log('') =20 - for p in (patterns + zeroes): + for p in patterns + zeroes: cmd =3D "read -P%s %s %s" % p log(cmd) assert qemu_io_silent('-r', '-f', 'raw', '-c', cmd, nbd_uri) =3D= =3D 0 @@ -140,8 +141,9 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 log(vm.qmp('block-job-cancel', device=3Dsrc_node)) - log(vm.event_wait('BLOCK_JOB_CANCELLED'), - filters=3D[iotests.filter_qmp_event]) + e =3D vm.event_wait('BLOCK_JOB_CANCELLED') + assert e is not None + log(e, filters=3D[iotests.filter_qmp_event]) log(vm.qmp('nbd-server-stop')) log(vm.qmp('blockdev-del', node_name=3Dtgt_node)) vm.shutdown() @@ -150,7 +152,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Confirming writes ---') log('') =20 - for p in (overwrite + remainder): + for p in overwrite + remainder: cmd =3D "read -P%s %s %s" % p log(cmd) assert qemu_io_silent(base_img_path, '-c', cmd) =3D=3D 0 diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index 433b732336..345b617b34 100755 --- a/tests/qemu-iotests/297 +++ b/tests/qemu-iotests/297 @@ -31,7 +31,7 @@ SKIP_FILES =3D ( '096', '118', '124', '132', '136', '139', '147', '148', '149', '151', '152', '155', '163', '165', '169', '194', '196', '199', '202', '203', '205', '206', '207', '208', '210', '211', '212', '213', '216', - '218', '219', '222', '224', '228', '234', '235', '236', '237', '238', + '218', '219', '224', '228', '234', '235', '236', '237', '238', '240', '242', '245', '246', '248', '255', '256', '257', '258', '260', '262', '264', '266', '274', '277', '280', '281', '295', '296', '298', '299', '302', '303', '304', '307', --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795013; cv=pass; d=zohomail.com; s=zohoarc; b=Ctv9HZIJQRJ2VGVZN0Z6D5EiawpFogJR1BRx81QObrXPdb6f/LfjrkevXY2iabMNMNJkGfsze9uU6tdxa/Mvj3RyC7qOMmG2UNBq0xmb6K+mcZmFJ8UkMQJU+bUmornhfT1ktL3JDvmEjtRPYT29OwZgO19febqaAy8LcqSbiAU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795013; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zUZIELcLM8f+XWay+whz9zP3yI/HpiDjHxOfs6j6Jxw=; b=ZzxVF1yu+/+V0VL+xO2N1bTlw3TJHXQKX4f+pkLAGwCZvLTVaYQsxluz1+iou7fwf7YfKKHiJkOGprxf0viOcUAfxVQksjGMCi6TsOKiP3KAam5ApIlDWxPfrZEIcb5qpU7hlpQQwqNKFvNNnesMawqmqeyyeVRtv6uUcS7z7Cs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795013510951.2225613204811; Tue, 24 Aug 2021 01:50:13 -0700 (PDT) Received: from localhost ([::1]:55208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIS8K-0000Yo-B8 for importer@patchew.org; Tue, 24 Aug 2021 04:50:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyX-0003Sg-4Y; Tue, 24 Aug 2021 04:40:05 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyV-0007eD-2V; Tue, 24 Aug 2021 04:40:04 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:55 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:55 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGj6Clrc5MplDhyBuGB5P78EpksoAQT7Cyx2+krvHSUdSwNBfU4nPwRO2GRENnlcCpJ46SNl7/rE2FnnouYn/VSJNmLdGt562y5w9oClEyucpNIT+OyZGG6AbjC2VWRkUHQ+ddRtJpcKCGgpqliExEpI35afM3v7QIz9OWyux8BjWMeBelXYHPMNWNegAjL/laECLOn/Euh54jUG4//O0SzCYparVXWCXLVIE3VqBmQf0DfNr2JqkbgCG4Dlr+M0bGDLdmM3G7u4qGzCNHqk7bYBDxM1Plz6SSno6FhT+ZrCV3y+TFjLs8RYmYbFCP+071sQg4o/KRX0UVPjt24suA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zUZIELcLM8f+XWay+whz9zP3yI/HpiDjHxOfs6j6Jxw=; b=KyqjLwZ8mu8vsmTp0q1vpwnx8D6CyHoUDYGESD25pvocVpz5ZHShKfpz8KXmrVInvVs4AbKxWthfcugj6DflLjYWlsQxakt6hRziNGQyqEewM3fbXsiayBYQrxAKcUa8ynZ7ep6XkopV4KEZ4/58/WnK1TmsJ4wBriHCZfbyrnD2uCcqSfEVKg3YUPIbx3N0JrMSEd/eExP51+7mAseD9tXhLdGVbMjkXssUCgVdKLIN2Pc6auaGaC/sFsp8QO+0SK+exhIE1pVlrl6qiegvEIaXZAsbJkAHmTnwe0vN8L41kmvPSuEqkuzKAc3S+a4z3OrjcPOlJbYaLtnG/9ISpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zUZIELcLM8f+XWay+whz9zP3yI/HpiDjHxOfs6j6Jxw=; b=YO2YbqNInHOapsef4483gIhgwXckcGDBhPOW+vwnDqwBNNkuf2N+bKtMdrEsV+A5O5zbJt90ZZycBgdKnMRWfkaCtriadhs8mUn1DM9TIBsZu/hN/PhO901OlhIJ+N2QpPZ6G4sRhoy1E7RL0rHnHiRfG8hVOrSgYtunnOG2q7M= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 27/34] iotests/222: constantly use single quotes for strings Date: Tue, 24 Aug 2021 11:38:49 +0300 Message-Id: <20210824083856.17408-28-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2f5996e-feca-41aa-19ab-08d966dabf6e X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:446; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 798hO2uTUUVZaX3TBSOjrZpIH/3eQQ/ybXtar7tdMQSr6U36pr+Z7rpz6bYk3fYR0jt01p/OMCfnKtGitjC9J3/ZkDujLREvdVm+hYb95NiDK4VpZRM+/jZxFmNWmoNhfudzf10cQ87XIQAvtw/l64Z5KbxNncL+ZCE1cL9fOJyTrt337u+ImaavYQy3TAEVOYNhaGPprB8vBnVu0DMYzr8rOT0Jns3TQyw+oDVQaq8szV3Xbp7OoVVsNHnnkelP+MNRSuntZi9uDX1qlpF9YNy9M0HN8VZ8Gx3gCq1qBDnDn2LtM2LhEeD6nJaorBeqfC9NqfsxoHDbJ+C4c1eBKwMToB8nf/pfVv62UzZqgFq0x/+A8kwidb16LTXcQKfpLf/Ie0SUKZgydxcuB/numVddjjIJlz7s/IMgr3xxcO8naJ+M58zWvFmVg9FdHYrvelt3M59o3W+Ir0N+gdVtO0YL49IsAuV10K1SX9BPra/fdONTQooYKGp4FmcNxnaO4OtL0Gg39AC1pIjs/ZFwnQDfbF3e0q0+MnyyD7YlfRYtFM2TK5LVUKOFmXJOyATGluKoTb2LoI6bKH/EBwmwjXfe5KffawTRcdviBzUbMR/VLdUYsOLvNHM0w4fGGQ8sobhwitG3LbaXPBKpz0zOthXIP6yuGR2BsbOcDrhAm23ahAlOOXvLggBeYZtHIUpUrGKiMiuLVc7KtXNQbsWPZA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6666004)(6506007)(52116002)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?atz6IJf6GqyXVg0yoWtJFLhSRFV9AcD4Mk++QAGB1IHY2aeZjvPoythlQLGV?= =?us-ascii?Q?l/1dAEk7jFkU6js0KqWLQ2WySsvtpiQXogjFSzzuUww/ULbkManucGRtapQL?= =?us-ascii?Q?oC7f5spXb0co4SQ3VXGELNZyYeXdUeM8ueHn2+CWDGa0h3GSNPtIDP+9Tm4T?= =?us-ascii?Q?piQhcslcG50a+m23CUJRfs84smtzc3/LdOdUswniDtAi+TRxFtPvzu1D/P39?= =?us-ascii?Q?SVbZdxrjSpcj+jkt9lENCMHvauvaf+3N5bxVoS8loYB0OUtbFNUwdwbx2T7B?= =?us-ascii?Q?mJouJtD+liUaOSeHSeAHOc97mJ5ogXW+Lzmx7HbWNuslS313EIxcBiKIjAq5?= =?us-ascii?Q?qVr/5MfbgPxZmLMzkyGurlMly2VFMMVLUrjmn7Hym5T5/IR/T6N1rYN1hR/c?= =?us-ascii?Q?Tz/7P8crZ3jX/TEBH5lVmRVquzUJyuvPEwGgiipadvPEKrtRcu5nf8sJV+MU?= =?us-ascii?Q?A5aJMWZ7SuLPeLZ6KabJp7sqXrcdc4W3ZFKE4ffvEDMrc0n/rhvf28PrDZ77?= =?us-ascii?Q?q2Gd6lBN2+as95arA7LVUPRZzTO5LFdxDmpMYou8QxFikUpQ4iYjbHq+2/8W?= =?us-ascii?Q?6L0HxHFO2c/Lr5q7yHyXidKJNOKV4J+YaQ/WDpG1i1udviXaXgQt4oTcKF7M?= =?us-ascii?Q?HRLTkq+3GHfdVLZOfpu3B2ZUAZA3a/gSic+pCwXH7dVlCExuJHwIKBBXJCSm?= =?us-ascii?Q?ie92MlbaMeOmzi6wdSGH5HPbdKJqCzEtY44yecB3UUuVpaAnXIK+yn7pkryt?= =?us-ascii?Q?SFVZn0Tr/fsD8A+XjwjEYJvoKF08opOFmpvlGNcsTkM2cT5h/RJ0CIZZjfRO?= =?us-ascii?Q?jAoQLe/t6asiqbdNEfKT5FL0fcvL07rDggIeEb8AcfuXB1oYUj331yakmnAA?= =?us-ascii?Q?0b43ms6ydqC/fwfJ4iVJYt78ekyB5ELAZRcOLPeVU46V+gdy8bwhvTGlGRvT?= =?us-ascii?Q?cb163tpCU4W2q6vV6ZsfKVgdZ8TwFXn7kU/gMrO7eGWc2Q9WF8HRr40HSZvs?= =?us-ascii?Q?tr2lYJeSp5fld+JloLK+Wzb+dqhP0cc/lTcEBOwdki91xhVUBI8bTJvkd/1v?= =?us-ascii?Q?BuncQg4KAliCBF7AxFPQH5qGg1S2TUJwWiioVB0gLs3kS1PTJhm5N1kUKLS8?= =?us-ascii?Q?R4IadBwUkBcpzn09ytNnH+FLyhutOlkhT29QrUTSye8B6TL08+IaP5cDUdyi?= =?us-ascii?Q?6dkM365xUfvTZg06Lgm77LBkCUHyDN0/vtTnipqC8oEloysM5w+Ga6KSSWbY?= =?us-ascii?Q?nwVuZfZuwOwNBxaie2fSQeioci5mIy8nVxLIcofe+m6So27YG1To+0JWqlce?= =?us-ascii?Q?JjIe+sQR0TJJbIYqK5AmGya8?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2f5996e-feca-41aa-19ab-08d966dabf6e X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:55.1507 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pMmcYc/3oyfM3MhWc3y6nkK2xps3C1AZ3EenY+QExgjH8MB7VFp0gc+f1D0P257GvlAvo8WvgBX2FxPwerAyED2UZIoowcwFo10dmnzVvSc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795015570100001 Content-Type: text/plain; charset="utf-8" The file use both single and double quotes for strings. Let's be consistent. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/222 | 68 +++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tests/qemu-iotests/222 b/tests/qemu-iotests/222 index 5e2556f8df..799369e290 100755 --- a/tests/qemu-iotests/222 +++ b/tests/qemu-iotests/222 @@ -30,23 +30,23 @@ iotests.script_initialize( supported_platforms=3D['linux'], ) =20 -patterns =3D [("0x5d", "0", "64k"), - ("0xd5", "1M", "64k"), - ("0xdc", "32M", "64k"), - ("0xcd", "0x3ff0000", "64k")] # 64M - 64K +patterns =3D [('0x5d', '0', '64k'), + ('0xd5', '1M', '64k'), + ('0xdc', '32M', '64k'), + ('0xcd', '0x3ff0000', '64k')] # 64M - 64K =20 -overwrite =3D [("0xab", "0", "64k"), # Full overwrite - ("0xad", "0x00f8000", "64k"), # Partial-left (1M-32K) - ("0x1d", "0x2008000", "64k"), # Partial-right (32M+32K) - ("0xea", "0x3fe0000", "64k")] # Adjacent-left (64M - 128K) +overwrite =3D [('0xab', '0', '64k'), # Full overwrite + ('0xad', '0x00f8000', '64k'), # Partial-left (1M-32K) + ('0x1d', '0x2008000', '64k'), # Partial-right (32M+32K) + ('0xea', '0x3fe0000', '64k')] # Adjacent-left (64M - 128K) =20 -zeroes =3D [("0", "0x00f8000", "32k"), # Left-end of partial-left (1M-32K) - ("0", "0x2010000", "32k"), # Right-end of partial-right (32M+64K) - ("0", "0x3fe0000", "64k")] # overwrite[3] +zeroes =3D [('0', '0x00f8000', '32k'), # Left-end of partial-left (1M-32K) + ('0', '0x2010000', '32k'), # Right-end of partial-right (32M+64K) + ('0', '0x3fe0000', '64k')] # overwrite[3] =20 -remainder =3D [("0xd5", "0x108000", "32k"), # Right-end of partial-left [= 1] - ("0xdc", "32M", "32k"), # Left-end of partial-right [2] - ("0xcd", "0x3ff0000", "64k")] # patterns[3] +remainder =3D [('0xd5', '0x108000', '32k'), # Right-end of partial-left [= 1] + ('0xdc', '32M', '32k'), # Left-end of partial-right [2] + ('0xcd', '0x3ff0000', '64k')] # patterns[3] =20 with iotests.FilePath('base.img') as base_img_path, \ iotests.FilePath('fleece.img') as fleece_img_path, \ @@ -58,7 +58,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') = =3D=3D 0 - assert qemu_img('create', '-f', "qcow2", fleece_img_path, '64M') =3D= =3D 0 + assert qemu_img('create', '-f', 'qcow2', fleece_img_path, '64M') =3D= =3D 0 =20 for p in patterns: qemu_io('-f', iotests.imgfmt, @@ -78,43 +78,43 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Setting up Fleecing Graph ---') log('') =20 - src_node =3D "drive0" - tgt_node =3D "fleeceNode" + src_node =3D 'drive0' + tgt_node =3D 'fleeceNode' =20 # create tgt_node backed by src_node - log(vm.qmp("blockdev-add", { - "driver": "qcow2", - "node-name": tgt_node, - "file": { - "driver": "file", - "filename": fleece_img_path, + log(vm.qmp('blockdev-add', { + 'driver': 'qcow2', + 'node-name': tgt_node, + 'file': { + 'driver': 'file', + 'filename': fleece_img_path, }, - "backing": src_node, + 'backing': src_node, })) =20 # Establish COW from source to fleecing node - log(vm.qmp("blockdev-backup", + log(vm.qmp('blockdev-backup', device=3Dsrc_node, target=3Dtgt_node, - sync=3D"none")) + sync=3D'none')) =20 log('') log('--- Setting up NBD Export ---') log('') =20 nbd_uri =3D 'nbd+unix:///%s?socket=3D%s' % (tgt_node, nbd_sock_path) - log(vm.qmp("nbd-server-start", - {"addr": { "type": "unix", - "data": { "path": nbd_sock_path } } })) + log(vm.qmp('nbd-server-start', + {'addr': { 'type': 'unix', + 'data': { 'path': nbd_sock_path } } })) =20 - log(vm.qmp("nbd-server-add", device=3Dtgt_node)) + log(vm.qmp('nbd-server-add', device=3Dtgt_node)) =20 log('') log('--- Sanity Check ---') log('') =20 for p in patterns + zeroes: - cmd =3D "read -P%s %s %s" % p + cmd =3D 'read -P%s %s %s' % p log(cmd) assert qemu_io_silent('-r', '-f', 'raw', '-c', cmd, nbd_uri) =3D= =3D 0 =20 @@ -123,7 +123,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 for p in overwrite: - cmd =3D "write -P%s %s %s" % p + cmd =3D 'write -P%s %s %s' % p log(cmd) log(vm.hmp_qemu_io(src_node, cmd)) =20 @@ -132,7 +132,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 for p in patterns + zeroes: - cmd =3D "read -P%s %s %s" % p + cmd =3D 'read -P%s %s %s' % p log(cmd) assert qemu_io_silent('-r', '-f', 'raw', '-c', cmd, nbd_uri) =3D= =3D 0 =20 @@ -153,7 +153,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 for p in overwrite + remainder: - cmd =3D "read -P%s %s %s" % p + cmd =3D 'read -P%s %s %s' % p log(cmd) assert qemu_io_silent(base_img_path, '-c', cmd) =3D=3D 0 =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795142; cv=pass; d=zohomail.com; s=zohoarc; b=SYwa6oG6EPK8NdiTl37NRdn3udpWyoh4ydwZ03KqsWI2Psn6cqUScw6G51x7YMgrjniiJLImX+bB8WKLq4zI8QsUEUpzgSn7zYYWYBolBPQHWojRFxnutJ7WpQW4K+tXuhpda4GDwUsJzRsKtkJgDJQ8w5qJKncW4za34pyg++E= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795142; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pm/DX8vEH9U0U4+GCtPJAxsZlteqTAW/fTB5aMXiQYE=; b=AkzEaRBQwzvCTTONe+K92K8J3mwvWbhIvoZkC/Bcet9+21O8P0gI2PO1q7RNC7hQkhDKSu60v1dDnPKb3wRgS6s/5SuQmxyBpbPckRydc4P32e2Elze8xQn6mJN4onz3ZYYJbNTKZ4UCp/Fx/RGCpCmkoP1pt0l1jHuOSpIzzHY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795142282721.6463750773422; Tue, 24 Aug 2021 01:52:22 -0700 (PDT) Received: from localhost ([::1]:35374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISAP-0006FJ-4y for importer@patchew.org; Tue, 24 Aug 2021 04:52:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59068) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRya-0003dg-E0; Tue, 24 Aug 2021 04:40:08 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyY-0007eD-VQ; Tue, 24 Aug 2021 04:40:08 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:56 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:56 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cRkhZ3OXCmm+VS0P/lesF+2l6bl9eevRdWJt0AjKYIwAR8kQ0DzHlZJGHTdTXmLNt34hRkUBbM9/wYoZqNNZmfG3wZvguklyptX6Qe6SWOiBOoCSQs2jm4FHYOf2baACbl7cYLvSaOVZEvpjl9GRzrWaN7QvNdrP4HABku3jRs5r2ZfXd6Z1fLGEPQ2L705yLYwG43oqYiquWktNRBiE8Nklt06+K36u7GOUJYiqiECkZCXGvoahPaFPcgWbJS2J9ZXxfE3v/MEEy7FeS/k2aPpZfUSTrX6dygif3WSD9vK3L63iqPhqcN4KS3Yl2co74eD7F7M+zfMXGpI9+SZhOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pm/DX8vEH9U0U4+GCtPJAxsZlteqTAW/fTB5aMXiQYE=; b=GKM/f4g7kOn2dIfCB3YsvXIGmcCJ2hxQ1/5HLsG3gjDVNWI5HsoIRDlqGKrhihPBse9ZHtIaGYvGBbj6AseNh3uRTyrS7mFmhEuv8ilyqNHllI2VT7Sd8nA3e+qws1hOfEG4icNrXDfC0rweVN5c7SZgBazL9gLhxM41mzb0H+75AoRI9kVFHTenbp+C/VHZ8VOBUIKpmBepSoqegf8a38MFFIr+/WhXJb+zOlarSUshWZGmauO22vJwyT1tKO5Qd72+JLw44hfbtYZGpcFtCB+JAIUrG052QY7CHrO3g4537D2zjTlh3NVPcCVJd+eBdVrWtMo6RlftU3ABViQYtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pm/DX8vEH9U0U4+GCtPJAxsZlteqTAW/fTB5aMXiQYE=; b=sdqaqTmumBq0JLZoCEH9az+z70gnHXw53H6rxx3RXcrxOn0fkCKuCH7HrJSrdd1WRwEA8LfG4GC2YcwmYp6SJMRvb2JLOghGEQ/YkIKqJS2pJPxnduW+XEv+40AHY8AaDhDpxuZ5jB5ALcXBhKcxvixnwVuTERzi0mFIP4QETn8= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 28/34] iotests: move 222 to tests/image-fleecing Date: Tue, 24 Aug 2021 11:38:50 +0300 Message-Id: <20210824083856.17408-29-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 79081a19-ae63-4808-2838-08d966dac044 X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:497; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AbuXObNz3lE9TtblFfjXcgTVCnkJvSpk34uX269gCqQz34TIk2Z3DqwDk9U3UAiiMSF1XCbCZ0hqSY0xAduza2Gi2/2BxFGtjxLHX+Lx5GUIl+MM2YjlpRJY8N8dabTys2lDAU91+PJkBNioF72KaRd1WaDPSN5+htKEoiIh0wyKWDIaHLovFnHz/+5ggQziqZdNhpc67PeSeKaRRdcIAqm2cQjFjE/xZUhFogOOrUxTlw9anXdObvBIcBfFM9r0PMtRotu8woquOlrAe3Zvi8pcJRiBIgghvqNZp6PVwZmoIurm/LCvF7g6AcDVa81fXmEEgsyw7dRhb8amUqJcjhH1Pf9Pa2jxTHAkyC8ncJKslRtHNMz2cEv0M31DMurOe/TFI42wjgWiShxp8xNqmv4ZUwm5M6WcT5CfE7L9ZtkhZXnumhfxZOiiUmq52fqSx+oaIbfjD+3DYcYBGFfsUkrLAw9lDCtqutgI19aB73J3Eo2MNNLBw9RUkprPY2zycWn89fJ4d1x3YWF/OhQQHJ7AbYY5qYA/9qTy/ahxQp0pHcLw36fe8Zw4Jpnv4q/W8Ql8Fxvh1FuqIHBQ894mI5zmX1a/jzldjN3c/ZKyI4R0Ji6voXDiM7nypRKXu7tPTl+HjTAJM55Yk3kXYROwQHxVX0boPDtYnmnmqxtl/7o5gmxw/XKfSp4fPH3PniflUudqfaN3ngKG/y6BAEyZsw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6666004)(6506007)(52116002)(4744005)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IJwyqy6HC1C1oy9P2WK717ZbUTtDmaO8TJsHXmt4ixJqsHOdHVuGVdHP9Jqc?= =?us-ascii?Q?XIamjgq00JQI701Fo+girdV486c8OaLzLCwI0WmaxH1OmZMwo63XKO7YBNgw?= =?us-ascii?Q?icX/HpDzA5R0gvGa0BEsAgSEBfyssimbP9V/FbqZMg+dI/gzCrnbt3a0RIhB?= =?us-ascii?Q?6MUWN0YkLMzM0AzZcpQk8xAJEu04Vk911Hllr0BH7RcjBFgvTxe493akMi/j?= =?us-ascii?Q?K5GVIEVy1Lp2srPGsVZSGAWBW7uO8F4z90iMfkIO7AMed5DBg/ubo2FwdiP2?= =?us-ascii?Q?tc5L6WYh2ySV3805yEcPlV0AnrqsmiHFvreRfr8kyHxNUenLKb7Azzw/m1FV?= =?us-ascii?Q?gTbcDjijXQxyM0Lw5b1gtY3j+xsuMHacsfS0K/VYd+ruUR+V8NmQ9lvNgJKs?= =?us-ascii?Q?cfwEvSsCzIkT7Mfr95wgi5JgI+Cgdx1bVzWaadOoO4cxXvyKQ623+bV5CLhY?= =?us-ascii?Q?FtlHuTiUNwEvfpx7QIdjcVyLCHB6ysD2vC5g+9GaSG1bK/jTlqVWektZDGws?= =?us-ascii?Q?V5rQuxV99GiQ9T+uKeaWUKF/+uIM68dEMufxqwF87mAU5eYlCKcAWdlTEJ5H?= =?us-ascii?Q?0czCYoYhiCty573e97Uvz7qAXBNRdbOyBOIX8R2Hoe3itOnn71v9JsT40rV+?= =?us-ascii?Q?REJVLIDuSK40QM8zPqf3J8Q3UyDk3UqTP+iLQvzEEhOw9lwcv+oLOr+JpvEb?= =?us-ascii?Q?04Jvrai9s3mx9HPun+8glhP4Uraar7wwuW4TNrTqPHS82feLOz+T3knD9tEN?= =?us-ascii?Q?dXKzzfDKq9QehqiylZ8Im0Z58hwjydt45z3ZxHXDBhnJvw2nBEX9G9A5xAKj?= =?us-ascii?Q?zYHEpd2gS9XXmOjED8W5/0bTXnMIzjenAGbAokqf4gHXbSjtB9v2Cr1nI9by?= =?us-ascii?Q?au5X8IfaMeStJl7mDMLzrnwtphFpNsjRdB0F1fR2LYR68C/pciLsSotkdd2g?= =?us-ascii?Q?lMTElQcNjmTRnPeEe0ST1NmphtJHLITyIk/VsY0tbd2Wi9PzsiYpw0rNPAIb?= =?us-ascii?Q?FObHWMGOqDH+SzcCLLt/1aynr9Q43PY8h03bg7O4ftkGXLDsBGmOGaQuAx4w?= =?us-ascii?Q?WNFlfNgMijIPtNO6g9XKkwmdd7uBOdSu31l0sQw6YLYH48zvysRDnfGfLZdU?= =?us-ascii?Q?Vv1tdfmFgCAlTpdIiV11EiZsROXNGv9zqNV+/cBZkJ79VSlVE1npwxe4y1Fc?= =?us-ascii?Q?9zM5lgN+RQZSmGxemnHrPq9F7DBJTFnWGEMUJdLVjp5F9e2vOnKTxp+UvzCf?= =?us-ascii?Q?FE+8XbevyVDASCzyaN4MRBA1p74xzskIadBTWT6RrupSLPs7TYOK6i+TDPOP?= =?us-ascii?Q?2IF7DJuzDrTjVGY4PB3V314d?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79081a19-ae63-4808-2838-08d966dac044 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:56.5765 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CKHBUCrnMu6XUmBggOVU/MuqqU+MAMlt3qBpub/t9NfkAl1DegA+xhG8vrqRqttVVks410/MX8qkfetXBa+dcN5+18GUNBRESATw+NL8kt8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795143739100001 Content-Type: text/plain; charset="utf-8" Give a good name to test file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/{222 =3D> tests/image-fleecing} | 0 tests/qemu-iotests/{222.out =3D> tests/image-fleecing.out} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/qemu-iotests/{222 =3D> tests/image-fleecing} (100%) rename tests/qemu-iotests/{222.out =3D> tests/image-fleecing.out} (100%) diff --git a/tests/qemu-iotests/222 b/tests/qemu-iotests/tests/image-fleeci= ng similarity index 100% rename from tests/qemu-iotests/222 rename to tests/qemu-iotests/tests/image-fleecing diff --git a/tests/qemu-iotests/222.out b/tests/qemu-iotests/tests/image-fl= eecing.out similarity index 100% rename from tests/qemu-iotests/222.out rename to tests/qemu-iotests/tests/image-fleecing.out --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795443; cv=pass; d=zohomail.com; s=zohoarc; b=QcmvYcOU+Utq/Ut0U2vEGrkrx3pcwo8HyUOhYZ8gYWApsyM3uYksQbohXR1q+axQdjRrab9A9fBF3CBRtYggX6GlE1bwKscRr9QLUuLu7gzUwkZ7YRiBZL433y6HDOD5DsdbBXG+LcGQnO14oqgpx9FcRtGEXBHiyo3e8tRReSo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795443; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=comyMmiZ22WDO4pGoXIo227PAq1jGSeS0rDCAQ6nEZg=; b=WnyNMikmw1Us79nOGjK8AVip/bJC9inBTO6H7UuBA/431tiY4mxX8wGUEjH97kNJW+NBc+lIftBx0SYtOp5k3SVFW2k2hhEhyA0zRGPkogON+ylqssVEjRT5Zzem6vy5kvYVXkrPzmsbVzzXq/bbBxk4rNocSp/KvkzS+dtXKKg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795443403848.7638834779772; Tue, 24 Aug 2021 01:57:23 -0700 (PDT) Received: from localhost ([::1]:55630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISFG-0003DM-9y for importer@patchew.org; Tue, 24 Aug 2021 04:57:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyd-0003my-4W; Tue, 24 Aug 2021 04:40:14 -0400 Received: from mail-eopbgr70137.outbound.protection.outlook.com ([40.107.7.137]:13025 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyb-0007eD-AE; Tue, 24 Aug 2021 04:40:10 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4088.eurprd08.prod.outlook.com (2603:10a6:20b:a9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 08:39:58 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:39:58 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1i8bPasueBAozkrqOBs+P76g5KA1jyK7FjlKSs8yNXofyi62taita2iutYiAiyVJMMhl+pLqCXCwumQ44hKGCSWm2o/cLJ9YcdBnH3KB61uIdYRkcayE8WvAiHugKVZJ8nck+GSWlihy/8JlLJh4zqIGwva41wKddm2A+cC5r7LMJbrhPBqt6Glby7UhZ7MeG9BBrxKzExNWiOX59Jx4ZE1ANrrNaFTCKMC7YiT2/xZePFfjCCQwdqtkbfFm/x72v0zV/ddJdjUz3wlxUWm0kkEACUkVr0niA+OAc+FwHJQl/eCb+K0h1P54DQ7hZwLHjyrSw3Bu42M1Yioelv6ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=comyMmiZ22WDO4pGoXIo227PAq1jGSeS0rDCAQ6nEZg=; b=E6JB1ceZUNfC1LrvSqMQzNUjaPKGSXwIiDJvLlN9Huqoi0OMM9hcDsg4ieQlgRKz9KSAYdgfcW487GG2xuK5r3vZ7XsHPVhk1t9M4RHwRtMfmWxDF9QRQMlzwYZM0gv1QrfCKifYcdp3LDq9MGI6OjnjR+aWZdaxWwOtydZs1qH+AY5apxfG7M8tSodrloU1aUTmfAgls44mxqW0w500tiuB3sExxUdwSxvACGJo2iY/IW+1m51u5BJWPLnP4HczjRbWu7uPPn+0jBftA9UqCVvMPhX48l5blKefXzS6IvIu4njZTv6al1nrtmNl4iGzdA+8bqb9cTbryHi1EQMfdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=comyMmiZ22WDO4pGoXIo227PAq1jGSeS0rDCAQ6nEZg=; b=a/LbbNwwjuBaItvNIuRcfGSF7OsXpfEC7GG93t9c2dzX3AuRLNIyrX1O277JflZ1Q1PJZDL3+9+bf4O6RnAf3JsDbn5AMIAIeY4ahXqMA8OUDYMwi2jm6UxbzBwOYjm4vNQo5CMkoRPI8uig+dDwIaCqrYijGOGTfmnooyvnKUI= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 29/34] iotests.py: hmp_qemu_io: support qdev Date: Tue, 24 Aug 2021 11:38:51 +0300 Message-Id: <20210824083856.17408-30-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae7b6c0c-902a-46bd-19ba-08d966dac11d X-MS-TrafficTypeDiagnostic: AM6PR08MB4088: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lp4cusC2+H35F+YVQhl9RvSm4ybjxIT0bi99lV3xuVQM9Ncp4Z8BdJ1ZT8wDyAvJLBivvejm8iIzG/Pzbw8iM1QpdtXdmMHqDUUE50a9+RTHq86Y51096E/XS8yxv3hXfUVLVr+0WP1AXr4hhBGsVPMgxEBTN7zAcvLmI1R1+RclDzmU6+5hZh8xzBIu7LljTsxx6lfTsce11dEG2jlZjyzES66RDVr/h8M2pxoaZLJyRVNvmKZfYsN2Wn7QjNP/mEnUGXX/h5Xl8TzOUXtFuhvAFlAdQ7Wy01oZK6BGa3usCkEzBJx8UzKBdH7q5RXSG3WnAHUTYuxCVld5JnNvdJKKSB7dbSj1EM5Eh0ytOOL8FYUMXfd/9wAY0RE7d5fPIaafI9ovx6rzOsQXXxGZxO1+42BeSdoag32r0dIm+r+YEhsYFFXIhvm5Ffhcd4PkXTa68EJjIlDHLhuHFWSg0fFetn70rPBRqZwjkJqLDjLUXj732mqegJCqCoHTeOo/MzQktUrqrWyb3FTkLGTz90eKGoy25F4qFQ8Nf+uBjS2AfgbgEniSeYLJ1nw4jeU8RRRc2DuN9Jb5lvCX0KLg9tWbXgdVEgxtJHHweHi3TmheF3shj9qRywQwiJ3Y673anQDxvopkWjUxsVi/AHMC8+/58/vJpDNtnywf6jbeTX/MbSDE0J8I3kPUgIRh3P2rN5hQfkqnQorL6nTlcwt8fA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(376002)(366004)(396003)(136003)(346002)(1076003)(7416002)(83380400001)(4326008)(956004)(6486002)(38100700002)(38350700002)(8676002)(6512007)(2906002)(478600001)(186003)(66556008)(66476007)(6666004)(6506007)(52116002)(4744005)(26005)(8936002)(36756003)(2616005)(86362001)(6916009)(316002)(66946007)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?N744B5xYS6kblJ4CwSM7PKvg6qAv8IKQ8WqQ+tf421z51CgnTibGL8G6egej?= =?us-ascii?Q?doWcsQqPTdmGMUJr8EmHHdEFM2mInRGFiR4onUBThxKxqPDScJh/kISGEscY?= =?us-ascii?Q?NDWNfb3eHBE3Kb/y4rQ/NFE/w7aADCEDtVjiw/CPzS2NDBlbqVZBcj32FxOy?= =?us-ascii?Q?Bixk8ElIGXAWr/qsgJk36RK3a0EEXBiq+Ey3kvHshK9ardQvRe/aKAoudpHt?= =?us-ascii?Q?mfo1yaNHoK11UntDdgMR7voYL3Z3YAUuhdppgOBfNMylAej5zj26ghH69Vn8?= =?us-ascii?Q?+O60wGEPXvkvplHDNAuxGpDJMgTf4ss8IOfkNwUK+98SfUqZVqcjDOCgLjYP?= =?us-ascii?Q?ybY50TSWCaTBijUKB00sbiTFM64yQlBAilzcZbV+jp1L3fVsAx8/9gY9E1EY?= =?us-ascii?Q?mNJblu5D+8vgcdXA4+Rn/cbivyvA/DBYQAG0Z1FYt5HYtt3yBVSXM+r7Vfga?= =?us-ascii?Q?kk2+tLRKj9vTeFX0ZQeHJAo1xfSgLNpXw3M0E/dTQEJrBtrlhfuAiRG4DVC6?= =?us-ascii?Q?pWa5Byat1Oaep/n0HAQ7XRhlNugizJYwKPAd2cbKWHtu4FTmPhMgkIOfEmg7?= =?us-ascii?Q?R9lrHd+82HnQ4qUOid8p/GSVw+O4sBvHX6eib9u+nD3xyJrIEa+nmHkU0zow?= =?us-ascii?Q?IBfLjQEtU7gQeDa8wWgSChBFoomGVYppd7/9Nnw36qOSFJH4n3eWuWgpqJB7?= =?us-ascii?Q?c3Qs94fk1kP8QXYTROGGJ18TJRg+z5YBJFXVz1/2dpPNnp0eZigGx6gOG+oL?= =?us-ascii?Q?kTXVjoxzQZeY8g2+KMpI8PsFR70d/EPdom/cJxheWxyhR7t4OUuOncxfhEJD?= =?us-ascii?Q?4mrn6va67JcblhED8pwcuRn3hhakRu1PBh4fNXx4IwN3J5VglNv8k4KPEA4q?= =?us-ascii?Q?odrU6sr4Grovn68g52mN2bUUfu2SRti/oOX1y/VY6nMsU265H4BUQ9roC62h?= =?us-ascii?Q?jHiZE7bJwuxR9/PP8CvWEdJg/Oqy9ROjuIWG9Jmoerrf7CfvBxgOeiXiTFxF?= =?us-ascii?Q?MMlXci+7lc3Hf6spVZEhM9Yzpxv61tQvCoYvPNBX0MIQgeo8zjvqWgayFrbt?= =?us-ascii?Q?8IkOUTe7UgkdR7VyCAUc/k2bYLf3jndBZd74IhSvPhskx3TBevz2awb1r3o6?= =?us-ascii?Q?VPEx27/4l+R4f7I1tQjwrancgvXk6Bghq0ZnXuPApkHsJa74OasO2uCfenhR?= =?us-ascii?Q?4PjgBe+NcDCKMuZTlUdw5/natPU7hfgund0laFLV4+MVfYqLE0w5F3GgvQdb?= =?us-ascii?Q?7YnFwAppv0WwqlgjsKsHcfs2xMm9Z8BtaxqQe+hsvMfBrMaSS+6Q7EN1kUUs?= =?us-ascii?Q?vmbXtw6t5HVGLf/gXn/6wSKa?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae7b6c0c-902a-46bd-19ba-08d966dac11d X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:57.9863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N3UFbBc24W7XqiemNk8tcPLXVBK16sS0no5iVT+j6InZBfu9h8A3WSGcK4sDzXs65dASnKQrs01gCwKsc9f+PCglkPhtxmHu4k38zsSoW70= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4088 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.7.137; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795444870100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- tests/qemu-iotests/iotests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 89663dac06..77efcb0927 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -651,9 +651,10 @@ def resume_drive(self, drive: str) -> None: self.hmp(f'qemu-io {drive} "remove_break bp_{drive}"') =20 def hmp_qemu_io(self, drive: str, cmd: str, - use_log: bool =3D False) -> QMPMessage: + use_log: bool =3D False, qdev: bool =3D False) -> QMPM= essage: """Write to a given drive using an HMP command""" - return self.hmp(f'qemu-io {drive} "{cmd}"', use_log=3Duse_log) + d =3D '-d ' if qdev else '' + return self.hmp(f'qemu-io {d}{drive} "{cmd}"', use_log=3Duse_log) =20 def flatten_qmp_object(self, obj, output=3DNone, basestr=3D''): if output is None: --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795530; cv=pass; d=zohomail.com; s=zohoarc; b=hZp6abELdetwcTQmVHN16q5zprM072SJjvoYfEISFMdPILBdWDAap3OcpVscYZDXSaHSpexqR3dWtXqxsbYy07f+f5tw/z7wbWI7/X4sv/9jwhSunVMy0B6MiN2jQjWbprI0rvGDG5l8ES8HQWIa4uPukhxKyFm+0y+7zF3qpps= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795530; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=R10eEY3SLa3JfenTqosr5rslG6Qb5NWVOLL6711tuGc=; b=iaaPisNFkn9zY+YbxWOYfWT20kaxeaJBv/oi/ZayH9aeMN57/p3/8k/x8UsCQeEWfH0dflxkDn+9UrSkKccICha9wmFcdUNuCCqR30dLcm/vxE541Nifat+hQQB49zoSffX0CVm5kQO5J6DiJXo9h9GUvv1mdrx1FUMdmJTIcR8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795530572109.5876594064897; Tue, 24 Aug 2021 01:58:50 -0700 (PDT) Received: from localhost ([::1]:35978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISGf-0000bn-CD for importer@patchew.org; Tue, 24 Aug 2021 04:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz1-000536-O7; Tue, 24 Aug 2021 04:40:35 -0400 Received: from mail-db8eur05on2097.outbound.protection.outlook.com ([40.107.20.97]:21658 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRyz-00086U-UV; Tue, 24 Aug 2021 04:40:35 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5333.eurprd08.prod.outlook.com (2603:10a6:20b:104::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:40:30 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:40:30 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:39:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkPc95M1DDfIJ+RZFZp0XIgXFy54djhK3dWJuVNOw5eUfa6uYiVysnt7fKSWIuNRNn1G9fTly4vZMfyU6A5R/v87sOiNQhKQq6RCSKZ9/fag2SBTLWtFH40BOvP9+JlCM5SJmuuDEHdnp3LoEoKdLsNcclrRiiPHRwdxIb1erIg7fvI0nOKhrwXGQrisfeOYvR+/6s+6OFUjjHFMyIhEMxzPbRFB/l+xC0ascQX6E+1jfjd7InP/82WIIlpnWg+P/IHkshM3HjB1KlMjzJ2czQQ5U3wtrf69A9bgYYx/9Ugs/a2jre+z0VBe/1siRH4Od50QFLm7P5WvyLV0Zl60IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R10eEY3SLa3JfenTqosr5rslG6Qb5NWVOLL6711tuGc=; b=eCYucab35sQRvCZeyT07arY1cpQpPtWDVWQQMHHnujdBHtNLfQsvEFlqzvr6tGIuxvj7RrC5vDHU68Xqb/QF7H7ICUB31CwYSQELbhHgnj3YgWCaOHAX6l1hG+ZdtYA6l0ebyn0EpZUpDz7ZX4CPgjJejHFMn5QRbtAjzanVidHfAI22Hmtu5ge8WK2ppHQPiHndxl3xnme3b8JWR3PtRc8+ECPU1clE/hFVqE4Q7PxBhXIjZm2gqcDSgW9NMUMI0d5A1CDUiGVWup754Nslep8YefA1sn6nkE5U8i9n4sg7wzUJEzQ9Osw4QHuQ5wFjQJGfPvJSLfz4wHxMpIDjFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R10eEY3SLa3JfenTqosr5rslG6Qb5NWVOLL6711tuGc=; b=Qv3XfPdNs7H1dQtJlntENZwuDTfGUiaTCfYRvt3oAChBXJOwQv6Oy/9URexBonLfBRNgRRI3JMwIqXUqhV7FU7YKQlL4pXwaJBN9VmP7l9qeW24A4OXzKii41E008TlnXNHikLGDpe7sgMFcuyT8PLHZ4Hrl1zIde8TLeTgshEs= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 30/34] iotests/image-fleecing: proper source device Date: Tue, 24 Aug 2021 11:38:52 +0300 Message-Id: <20210824083856.17408-31-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e364f260-d68b-4ee7-62d4-08d966dac1f9 X-MS-TrafficTypeDiagnostic: AM7PR08MB5333: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:580; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uhMQOdHGgwvl3xt9JBR+ccOwz4Ir4spH4QomUZ4It5HVoOMOQzeGH5x97RFpGB2593LnWYbbPK1lM+rkCL8um0rbIsR95i+SAsB/6VWAbINILtAFLgIf302slbzZ+EAyQxyMGKaFD7nIXTOar5MftvEgWtv05pTHf8AKPPZTJ4hcmH+/LEhJ6dlPe8hUiUa1j48w/4bJT4y1EmGTysthj3X3NiPXPgmVc4x49CD/1d3B6x/r3pdNnvET4ZaMDcUceuap0u4RVIFVuKnBLY7hp0w3WK/HZQtRpKLYmCMOczPEg6CjonxSgdZzSZ3Z87728LqslDkgnIOSK/jeu71JJYYDT/nxKcGyRxI9bAtax7y8dfKIbhMBXWzDFR5nsJ1sipflHpmowj1rt6lg6FRsUq+atQN7wX/MtaTVnLMHXN1qYJ0X2bgTP2SjI8UNcstxGMQ6tbuOVpfWbLUP+8c9efgxSBf06FI81N2mFChkSC9oqq8cjRdPbsYrHZUHI+b3EC2+//OitPFTMnmJF5JI6U2QGWKNMSicdCflSN5D01hWgrEW6iolKa7+sJ7sZxzQ1rShIXNB3y8308ha6hThSAzDhzZ/x8tmjA82ZQpB/Xg49XwgmSkcX0E1K1Ky3BUpLcrk4jdpnFCoPUnOq/CUnK357Rw7HtRaIKtHadZUa+cYafYsdoYkd3htWKoWfKj8HcSjJpLVSK7D3VWNp21DNg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(39840400004)(346002)(396003)(366004)(376002)(38100700002)(8676002)(4326008)(6666004)(86362001)(52116002)(38350700002)(83380400001)(7416002)(8936002)(6916009)(5660300002)(478600001)(26005)(1076003)(6506007)(6512007)(186003)(2616005)(66556008)(36756003)(66476007)(66946007)(956004)(316002)(6486002)(2906002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?OaW9vlgiiMzILKHt8wU87q2ItrlC34q37RP3gYn/Q2EpF6zfUt2ilPJ34r9T?= =?us-ascii?Q?blRnfklzIfqsALGIcQlt61MKOGhDtrkyTlZXAEu40/Ije+pT95bmwvPebP+4?= =?us-ascii?Q?FL55g+YEpEJKmGAoDCoEL5DOULZZzpyARQpl7cgbYTyroK75mCx6tUPpJS77?= =?us-ascii?Q?GWO/f1uJz6qunjRRjDY3LSr7W6AAdKZSZWhOXJvLzn2zrR/COntNJZDJ2dzN?= =?us-ascii?Q?QN3VTF+nBD/3jB5mTXBNDW29Qwx+kl6fm2WCutSB3G5XbhPAhm5+PjzoZN5G?= =?us-ascii?Q?/pTrNh8kh+R9QoHArhjnHRcnlM7k667K3/ee1k7LPaqX3cS7IAaVpvbtb5h7?= =?us-ascii?Q?78uSSIcFUmdgvAPig7pKW5RdvjafnNP7uS2RhRsCw6fted+OoE2GCW9VbqBA?= =?us-ascii?Q?hxa5rzdleKTI47DiZvg25LpQskHRrizHMdOMq2mtFnTfTRs5Y9l+U/nohZPe?= =?us-ascii?Q?ijd5kLEalYtW3o2Y4uploQo+ZhL8Xv4I/XTur4FrGeCoIPKWeKhYcAVwPooI?= =?us-ascii?Q?vF5P+KmdFiiTGn0b5tNeHIepNHfkhiSRtHggt0eqA35B7IcttXJQqdFneFM8?= =?us-ascii?Q?vJrAPum7KULKlXaESqPHBvbBhvsxp3Frmod9MVRYxFoQT6HbSYjIBAZ0sOrx?= =?us-ascii?Q?DKuMP48WEiSnfBHhAZumNiPCbVLgc79PW97ewwhiCfbf+kFrmmu/wcIr9LIr?= =?us-ascii?Q?TS1DxGlaUOGnSLfFi9I2ih17gABJ41T9W2T8loU3VX+vGIHVZjNFn7FuzmZb?= =?us-ascii?Q?piPueptcZaErXeo6XDZbbbr3TaYptVAyPkNIJKFPCjV7mhA+xuBqTEfnXtLo?= =?us-ascii?Q?E4DlvPKP7Oz9wLjBAPa5fxoaMRK74MSPyBpT0a7XMyEw3H8HR9ycqosB/3i6?= =?us-ascii?Q?1M1GME56PINuyU/N9/WK5wVUuUgwzjFUayNvoahXWpKf69Q0Bsb8WdKLsAKv?= =?us-ascii?Q?9RxnMfHK9N5DiXnVKqL8ldpv9HnBPp5bVJHZZheUjmcMOdcF6aMxm4OnW8Cj?= =?us-ascii?Q?D3NdOAQ+COB3QuH3RjviiojO0CAqMkmw7biD7KE/dBaeqjR8k09DuKeJYqR7?= =?us-ascii?Q?p/ya4uWeeRtvRAWAgXFHK8VKsGPbfAgY7pbV4qNutNBXgHjs3FPrvmRCLNEL?= =?us-ascii?Q?mwCl7KZ0YH5HG+FTHpKxIdwofZHyxmlhy+Qx2ZCXBTjqCaK/oK9zw0KZ2r0+?= =?us-ascii?Q?STJCGJxmWQK7mf5RSFZU3as80bN+ukQnBUXor87+gUcpuhTFFCGarjebmBuV?= =?us-ascii?Q?8ViwErwTzSCDtLlMbLvsd5bMUmAqu2ZEES+Sz5PD6PpA7HR8AGrhlpp+2LjO?= =?us-ascii?Q?7EA6Gu5PpMbsr6ilCDCjAPR5?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e364f260-d68b-4ee7-62d4-08d966dac1f9 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:39:59.8949 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HwbhQPOHaMzQ3MX2zkhzi2mkC2mtpzv5Zt4/VnAGvdLOfhlkYNPVQxoCopaKllRo3RsmWHPBEZIZmeikQ4Fiacin39LQpqhJ8X1TbX4ct6I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5333 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.20.97; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795531218100001 Content-Type: text/plain; charset="utf-8" Define scsi device to operate with it by qom-set in further patch. Give a new node-name to source block node, to not look like device name. Job now don't want to work without giving explicit id, so, let's call it "fleecing". Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 12 ++++++++---- tests/qemu-iotests/tests/image-fleecing.out | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index 799369e290..961941bb27 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -70,7 +70,11 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Launching VM ---') log('') =20 - vm.add_drive(base_img_path) + src_node =3D 'source' + vm.add_blockdev(f'driver=3D{iotests.imgfmt},file.driver=3Dfile,' + f'file.filename=3D{base_img_path},node-name=3D{src_nod= e}') + vm.add_device('virtio-scsi') + vm.add_device(f'scsi-hd,id=3Dsda,drive=3D{src_node}') vm.launch() log('Done') =20 @@ -78,7 +82,6 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Setting up Fleecing Graph ---') log('') =20 - src_node =3D 'drive0' tgt_node =3D 'fleeceNode' =20 # create tgt_node backed by src_node @@ -94,6 +97,7 @@ with iotests.FilePath('base.img') as base_img_path, \ =20 # Establish COW from source to fleecing node log(vm.qmp('blockdev-backup', + job_id=3D'fleecing', device=3Dsrc_node, target=3Dtgt_node, sync=3D'none')) @@ -125,7 +129,7 @@ with iotests.FilePath('base.img') as base_img_path, \ for p in overwrite: cmd =3D 'write -P%s %s %s' % p log(cmd) - log(vm.hmp_qemu_io(src_node, cmd)) + log(vm.hmp_qemu_io('/machine/peripheral/sda', cmd, qdev=3DTrue)) =20 log('') log('--- Verifying Data ---') @@ -140,7 +144,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Cleanup ---') log('') =20 - log(vm.qmp('block-job-cancel', device=3Dsrc_node)) + log(vm.qmp('block-job-cancel', device=3D'fleecing')) e =3D vm.event_wait('BLOCK_JOB_CANCELLED') assert e is not None log(e, filters=3D[iotests.filter_qmp_event]) diff --git a/tests/qemu-iotests/tests/image-fleecing.out b/tests/qemu-iotes= ts/tests/image-fleecing.out index 16643dde30..314a1b54e9 100644 --- a/tests/qemu-iotests/tests/image-fleecing.out +++ b/tests/qemu-iotests/tests/image-fleecing.out @@ -50,7 +50,7 @@ read -P0 0x3fe0000 64k --- Cleanup --- =20 {"return": {}} -{"data": {"device": "drive0", "len": 67108864, "offset": 393216, "speed": = 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micros= econds": "USECS", "seconds": "SECS"}} +{"data": {"device": "fleecing", "len": 67108864, "offset": 393216, "speed"= : 0, "type": "backup"}, "event": "BLOCK_JOB_CANCELLED", "timestamp": {"micr= oseconds": "USECS", "seconds": "SECS"}} {"return": {}} {"return": {}} =20 --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629795262; cv=pass; d=zohomail.com; s=zohoarc; b=c+oT6PJ95g3od+VFDvHoPAuxX33XFEbdK1wfthxGP1/C9n7V5AwCA0CVDVXqMXr+0Guemq+RlVdeLGPgt3vxBYIbWpbt25SHZbyOZDAwlPFU9fXVIhL4YpnxXJxVdwr8lzKWxLxoQLE9qm7wwyd47fl6GaWDs876vWhddnHaRhk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629795262; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HfTynrtFoOtQlEZdXbg/sqJjKgrWrpnDM9PaHle0IOc=; b=h3yWk+k32ryKG+KCBXvcP6Fmx1jcnGO2UmfgGIX+Tso4Lx+bHCtzbHL8zejwxadp7n3knZecgYToAd9EwjgH+B2u5lp5FYmEqdew600mwNxrtkRVNKsuAkKiQnV2tI+ZBOUNFmUtm9mMc58U31RPYWb9yoICoHJmbeumhcj9iiI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629795262208802.3107896389877; Tue, 24 Aug 2021 01:54:22 -0700 (PDT) Received: from localhost ([::1]:44508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISCL-0003zb-5E for importer@patchew.org; Tue, 24 Aug 2021 04:54:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz2-00056c-SR; Tue, 24 Aug 2021 04:40:36 -0400 Received: from mail-eopbgr130131.outbound.protection.outlook.com ([40.107.13.131]:22309 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz1-00086z-1V; Tue, 24 Aug 2021 04:40:36 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB5077.eurprd08.prod.outlook.com (2603:10a6:20b:e6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:40:30 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:40:30 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:40:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dUNdRZS3tMBqM4ygZVRXeQxWJ54eBCGk2StViZR/GXXPvEh4elMAbaWSyS05tzMRFk3taSuhM16MeJ42l8hqp02ZX0rMFNCGzGCEthgoFpU1y4olIk4HwZcUvdNllJY0bIPvvxcS3duY9gzDR8hNyneDbsjwdBGKeNP6EJJRrxT7K+99jDQPRuisHyuQ7A96pykLREsoc+JuoxgjoqpH70+KBA+rir4BPUZA2Pqftl+kmlu14eH8yGldfPoI1dt/We0NyDsy9+oSKlPA2zDf5dvRwsxmdjt5qh31ZIAWoCPVlMpGDmponRqg98Z3Fhfst0uRaGxvb57zp7qrwQ2FzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HfTynrtFoOtQlEZdXbg/sqJjKgrWrpnDM9PaHle0IOc=; b=hXaXXLcib1xbuYlXIaWFe9ZhA9cpriAZA13vdHvRgIZrg9fs4ZSSOqq0Dc45AA72MbJDhk24ONGLpfatDvvCTZCIkIdwtlXy/e8TheLvIhpTu2yxnbZacknulHW63Jg7CpDLnqEGwZpW2dNTKnR8xMeHU9dTJVvi9VDWRhEMX2tjO04JlNXYkC4mwXfk+cvWMI5G7MDxy2FrlHOGmelN/Pn0vLFoQcWqPbfYxXoniXP3r1bNgEFiYvKg2KfVmodqzRJvwIZTbyF6CgciKOEXa8B/RI26ULG4DXKJIutR38ZLZA+Lrsi1kHBPG2yuB1cs8f1UYd++5sq5Fyuo72+C7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HfTynrtFoOtQlEZdXbg/sqJjKgrWrpnDM9PaHle0IOc=; b=sE+qaDLrRya1S+g3Wm9q6LNlxAnu2Fq9wDFozB/Hvpv5DueoYIQUdaEJLZyIBldQlDEnPyhNADFk/nOBKen924+HjRNFgZYWFSKtkVf6ciyNvDOVDg32gz4NKW2uhubtvX2QtJvbg4R0r3QATd0xT3hmruevxiQ+tGzfT70tEGw= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 31/34] iotests/image-fleecing: rename tgt_node Date: Tue, 24 Aug 2021 11:38:53 +0300 Message-Id: <20210824083856.17408-32-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9f0f87cb-12c4-4528-b50f-08d966dac31b X-MS-TrafficTypeDiagnostic: AM6PR08MB5077: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fOzj8zU7yPss3YLYtCzxaD4FpdCA082pD4JZl3e6HxhuFF1k7T0wCXU4ewj89lKRMv2dRkbkwaMVaNFLvooaqhlXpMke+tUxbtmS3xse2VEt8O7zUEI3d5Wm69A7G1TPuVIIpopsNpNI4xcHsPcPuWl1LXwQtwxD0kbAqhQPcFO+6Vk3ahil5w5YzZnLTkUyH/8LDnN+lg8G5CjCbj3JG0mncG08Ynpk+WtShzouY6VPZ9Hkgvo6LPMeE29UzbkSQceDAsiKxL5Sh9oOCKAm65YtUl5O2/5RekLNDm0ylTCl7x5mhE//enUxQefACV+XkO4NF/7NS9n5W1lgMzIfyqKrgP+faS7tLo32a/jo16vxeHk5pdUX643XC9R420DLU8CrJOR6MGXa/9axHsCarJ67Pk1FVHANyDgh4ar8A2emZlrL1iKfaYFxPtPjFUO63/e3GB6QQ4kLSYW32IEK1hCAeDbdCKDAIXbEBhNy2I5AUKaAo3U1mCcl1BRy29TUHfPlcATj+xn51A8bbv+SarTttgILC9l8qXvdoPXT1L0/zjPl7rh0DgOhKyha0Q6hixuiW0QjDZ9BZpyVXdlAu++NAb8QLuuYxhPk4gg0tdLUY6agNIdKRuy4W6j5NgCB00rzj/zlluaAZay6o0YsKOvrtcbAi19pZ7A/NoXkED4j3fBWnyA+tqjmE9rql8fKQ2O88ft5GASzVwx+FPXWGA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(136003)(39840400004)(346002)(956004)(66476007)(66946007)(316002)(6506007)(36756003)(2906002)(66556008)(6512007)(186003)(2616005)(1076003)(6486002)(52116002)(6666004)(86362001)(38100700002)(38350700002)(8676002)(4326008)(478600001)(26005)(5660300002)(7416002)(83380400001)(6916009)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?3dabt4TXgZoOlYn1+UL6p43dLfVJMLmespd34aOSlN+8wvkkJ+z4IKW5F7Qr?= =?us-ascii?Q?MzDvKoPUAw6Fu8WG9O3jjXmlkvx4gRDfb9F2k4qtZcNlVgj6u/bV00nlerO5?= =?us-ascii?Q?OmOaB68uCcggagPzdGWWVu1WOgFVInud53UGBTlboy1Jwlljmq+Iwk8EAkSo?= =?us-ascii?Q?LAF2VQlXQFigvqRwkhQ2yUgzTJOmhK6rC4aAe+zQUs6Z2O/2pCHV+bDbFCTm?= =?us-ascii?Q?js5p+s5JJ5/ShB4yhBjhYD8jamkImAs6a5h6Q8HXfY3AJ4oljMkskeMq/Zzt?= =?us-ascii?Q?Wi8ILJiLZRl3hQ7Qe5dfsLL9WrHntwQT4sV8bW627V92pXFEBN9uFU6xlJTG?= =?us-ascii?Q?7HwptMEkatuGos8PIlmOd7G6pWc/f7GTvSk4oY459ekoERj/w/Zs6DPZSO4n?= =?us-ascii?Q?cLfPTBml97EP/Uqx5xmNB7ZnyxP/KGw70wbdVOYVjPEJZnw+ij0nYVQFvtSw?= =?us-ascii?Q?5QiLe8JL1Q06lunujxpF8UPKAOxWzNA9tSEdKESyuWwDqLLdensqzCYo7IzU?= =?us-ascii?Q?O5iQhMsIPUGUnmMT2+OmT3dl8byq8lp9u8yIlAFsSA2MljqFoZK6z8w+6XcI?= =?us-ascii?Q?WQ/2Wggqqx6onGyJUJAp53nFHCE3LhVygX82NK7zRuUeuziJ84Q11oBndyd8?= =?us-ascii?Q?FoRQSvMv042fCmTnc8X1MUiX6Y8Km3yh1hYiWvvZ3wXR+YZflIsawIkvWO1c?= =?us-ascii?Q?NImdYmGNLwcMJxJflvgCOLIz1vSuzv0aFj3ntxhjtqWkgNEj1iAgMyWk/eq5?= =?us-ascii?Q?kz7MWelSmZrFvX0+mXqAcan+aazb665Bk4pPK+NbmWXzqNlw1MP0BMQwjH2q?= =?us-ascii?Q?T1W664rmAnhkHwjzVc+EJqqSNP5UEdK5UgPUk0Mq8E8/8jKAMdx8NKG2/V71?= =?us-ascii?Q?6IV19vQHMmICNAIFXPUcDdMdjjpAOICE/UJgTdGiTrQ3md3WDWBHWF0VTDWX?= =?us-ascii?Q?erq8+cuVm4LaO+HVkVNoa/fChKahqdw5m2VX/CnSNtnUM5BEt4sCPZD8KulI?= =?us-ascii?Q?DSAZzHndKia31oCwH6pkFseCkvukrRbU0+SJnIFfbtXaLGGa3NGSc3fmwOt7?= =?us-ascii?Q?6B+V2XfxKeSZHAPwwhsLSp6K5mMYGpzo39m1HoCEBbJyW+YyNQ0FOa27CTsX?= =?us-ascii?Q?WpTlHuKwX6JX3cloppFRMdtE2U3kUi4KVrjEKjyvmZZnPXeUrToHAdLmQWBE?= =?us-ascii?Q?2fqDh58FeBJMD72JzLTb3GyLoZqFe3MZH69ubBRpcLwqlnZ4HbfYtu+fNtyU?= =?us-ascii?Q?BqOloYp9LLmRlbMcwWSNhkXdkSrL5JQBX9YasXWS1fgr4aJP6BRkX5Sv3/5b?= =?us-ascii?Q?4YppRZz8e0KmAGLRu+93v5xt?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f0f87cb-12c4-4528-b50f-08d966dac31b X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:40:01.3694 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 07s5XGk7nAtlEFhShq3Niwghtx2LDqnCRn6kBTvNykC4ahFjDk9JuOx9+7L7aFaMeLr7TavOHsJJYIpdDrzcXz7hHOZV4eVK5vJr+LJPcyc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5077 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.131; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629795263953100002 Content-Type: text/plain; charset="utf-8" Actually target of backup(sync=3DNone) is not a final backup target: image fleecing is intended to be used with external tool, which will copy data from fleecing node to some real backup target. Also, we are going to add a test case for "push backup with fleecing", where instead of exporting fleecing node by NBD, we'll start a backup job from fleecing node to real backup target. To avoid confusion, let's rename temporary fleecing node now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index 961941bb27..ec4ef5f3f6 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -71,6 +71,7 @@ with iotests.FilePath('base.img') as base_img_path, \ log('') =20 src_node =3D 'source' + tmp_node =3D 'temp' vm.add_blockdev(f'driver=3D{iotests.imgfmt},file.driver=3Dfile,' f'file.filename=3D{base_img_path},node-name=3D{src_nod= e}') vm.add_device('virtio-scsi') @@ -82,12 +83,11 @@ with iotests.FilePath('base.img') as base_img_path, \ log('--- Setting up Fleecing Graph ---') log('') =20 - tgt_node =3D 'fleeceNode' =20 - # create tgt_node backed by src_node + # create tmp_node backed by src_node log(vm.qmp('blockdev-add', { 'driver': 'qcow2', - 'node-name': tgt_node, + 'node-name': tmp_node, 'file': { 'driver': 'file', 'filename': fleece_img_path, @@ -99,19 +99,19 @@ with iotests.FilePath('base.img') as base_img_path, \ log(vm.qmp('blockdev-backup', job_id=3D'fleecing', device=3Dsrc_node, - target=3Dtgt_node, + target=3Dtmp_node, sync=3D'none')) =20 log('') log('--- Setting up NBD Export ---') log('') =20 - nbd_uri =3D 'nbd+unix:///%s?socket=3D%s' % (tgt_node, nbd_sock_path) + nbd_uri =3D 'nbd+unix:///%s?socket=3D%s' % (tmp_node, nbd_sock_path) log(vm.qmp('nbd-server-start', {'addr': { 'type': 'unix', 'data': { 'path': nbd_sock_path } } })) =20 - log(vm.qmp('nbd-server-add', device=3Dtgt_node)) + log(vm.qmp('nbd-server-add', device=3Dtmp_node)) =20 log('') log('--- Sanity Check ---') @@ -149,7 +149,7 @@ with iotests.FilePath('base.img') as base_img_path, \ assert e is not None log(e, filters=3D[iotests.filter_qmp_event]) log(vm.qmp('nbd-server-stop')) - log(vm.qmp('blockdev-del', node_name=3Dtgt_node)) + log(vm.qmp('blockdev-del', node_name=3Dtmp_node)) vm.shutdown() =20 log('') --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629796040; cv=pass; d=zohomail.com; s=zohoarc; b=nwM6/oB+pVXAiGtbl3Y9g+DOcALX0Fdjbh1wvWiSGsZETuBgC60TGMmyZoDrZwc8c8HUbJS8slNHFX9eVRU2g7MoMGijJq07NVfcn2tq/ZsO+Fc2sfj47liOddQQmpYCwoRxPwkxV6gTlOAPzUJ4BypK90kunuZReeKbWZ/VoXU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629796040; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0Fdt/9kXHN1yQLBrMNRdUEjvnHhIP48yC5QLgDEN0ag=; b=NwHI+HmI2xW6cQCuhHuTxtsPqD4ANnhMnDI2lxPnApbznkDqV/0Gmm57Bnp4GakrC15H8pKgaDIAAp3NGpVIbKAVdvEOX8LMdyKACeB2pNBEuOZDNq5epqzrEkz68NCOjBVpCqUBt9DpzoZjdu5RTQQgQrwbEGJRl4krbdo49Sg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629796040234760.1782881301231; Tue, 24 Aug 2021 02:07:20 -0700 (PDT) Received: from localhost ([::1]:56794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISOt-0006ik-3R for importer@patchew.org; Tue, 24 Aug 2021 05:07:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz5-0005EL-AX; Tue, 24 Aug 2021 04:40:39 -0400 Received: from mail-eopbgr130131.outbound.protection.outlook.com ([40.107.13.131]:22309 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz3-00086z-Ly; Tue, 24 Aug 2021 04:40:39 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB5077.eurprd08.prod.outlook.com (2603:10a6:20b:e6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:40:30 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:40:30 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:40:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T2f6psVDq93/4AmE5mpc/MZ0merakFV+Gme176uxQpinDQ+vKCl1EzoYmYsGe885RJClH4u5179NzUtG7Amb54ueaOX90Mq7zC9PzCZHQREV7Eqvho1u9rN/Y7ysqHEe9Du0kOJ7snQhaDU785CazwZn2uzNE+jz8hf1ZwCT2OSt6NRWgSOvzQCxHnW1d7QIjBlxEWE61PDxoDMr9aJZ+XsNutufkR1rZrlsA6P3wYoozRnYGIUcN+sbmjALIvXVK7W7/oM0U8ZrbpMV80d6Xb/R7vSlKoKle5alvbliBpEr6B0JX5bn3G5RePRILdOEcAK+KtHBe1gKEtOyvhSrEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Fdt/9kXHN1yQLBrMNRdUEjvnHhIP48yC5QLgDEN0ag=; b=iQCJJyR9YZ3LpMvOl9I3gada+hoZrZeQPo8dw9MrHTqPNc1OTS/061YxY7Vdy+vAtJW+ilVgl36VmCRfCppWBleJzstJY+0b3tEGIR9chEMDqz9lxJX6hkKGrzjeokLmeIRDQV9tnwYRe+kzz9gJ+F4cyZ/e/cIpRpyN3lZWmCtL3my0w8wq+A0hMGAlyl1suGiAxHzd4sinwZ0MkaThRacmWo6rr/Yhoueaem5aE6zFOMT/Nc/mHutK49N/hoBB6jC8+h1MyKFiarMr1pjN6P8jkJd5iCofpJ/uKrM+Lydnnl8cHXcodsqunm6lhbuFOxC2ZOaLZHHS8mLQEuRWvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0Fdt/9kXHN1yQLBrMNRdUEjvnHhIP48yC5QLgDEN0ag=; b=MTw7lR8oQKrwIOaQq/srv/2khxG9srIU+DsMutqRvT1lDduEgT4fnnK7BR5GSdNJEAivLUbKDYIcwdZYPWmKiaG3sg90HMQxBpnfbmeYpV44tzZG6vF2YnoKGoToxCXAo69zVBgoYFHQcUMAV8ICpwEwz4gBMC6Hhf8eutSDgQU= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 32/34] iotests/image-fleecing: prepare for adding new test-case Date: Tue, 24 Aug 2021 11:38:54 +0300 Message-Id: <20210824083856.17408-33-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 971e8b8f-f972-46d2-c4bc-08d966dac464 X-MS-TrafficTypeDiagnostic: AM6PR08MB5077: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:478; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OhOqStHa8IEKNWMRCjbbq297njzhoaqDf5nwt8A4WKChT+zhe/+ZVFqnPyQCbAeDlY1SqJHq7syAwk7MIvdDhHhIVJRru3WS9uygJf3TpH+4BrrwdR60JnfQBUQJKnG7+muO2uFcD0qHrKHr+z+f/4pgTyXGHdq50Qh9n5wu9xhbpltzer4XE42ZDzJJl1mLTEJc2cWL/8GNSEfhYsbIgGs2dvaX/t5F3eS3c+zEkdpRaGBjtU01ohyagLcQthVZ0yE3FxsJ+8Dv917xIABfbgPS/rBFIGEuBM2EK5iFTesoAHIizMHjWCbruQL1gSgEmk+liaNbebCHEmtqFI/n44BLM3ZCenqFVgkuCIvDC586w/WuhdU7aqrmswYs2GLvAeiicf8uhnVx8wfsA/uvcKrNIhKxxuQexILPWDnbTkdIJ79bIQX7RxBz1+udF57ot/pUam7zOMaAszc9MkqmDrrfDJQ41B3+ROjFYUI7QZ/eE709A/jE9vST8M+5eMiFFm2G9rxanoeeft7v6FLdrUC7vaMaam2VWRC9qaRgD940ZdQVCtFEbI58EjPBLWOsdXZpaLn/jU0aZOiqiF8c6Dzg4OWHPtumNdwBvmFtcdfv4IXWddbMyrQclc12s8VoA9w5301ME7u2QK6zkSA36VIYA3HYcJ9Hih3xX2ugvwcsrpf2F7VqNjhSmG8CZe8SyS3XogyuM3z6LHv9rk0sEg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(136003)(39840400004)(346002)(956004)(66476007)(66946007)(316002)(6506007)(36756003)(2906002)(66556008)(6512007)(186003)(2616005)(1076003)(6486002)(52116002)(6666004)(86362001)(38100700002)(38350700002)(8676002)(4326008)(478600001)(26005)(5660300002)(7416002)(83380400001)(6916009)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wA/IqnQ/nEd5wfpjPSU6mxm8MwbA/f+GbXKYVkNLmyLH/hlfQuPAo0vbBVit?= =?us-ascii?Q?JhBJErKrVPs4t21pFEQ+BmOQ3jB+Irhh8QmhbPTvMwb/LTBOLE2vj0q3+Jwk?= =?us-ascii?Q?eqAyE6clpICK10sD/VNxdchxmDdXF/5zNR/5UWHEvnunZn2Dw0BvElz/29WM?= =?us-ascii?Q?zxew5R/p10y9+xe3g5FaA1tqmdzZMXyar0s8EoEFnbCN0Tyfaqp6Bgl1asgP?= =?us-ascii?Q?199+OY/gQ8IjNzbCnK4MIJlWhGD/2nhw7abW8Ym7qDWlONTiboON6k+32RAu?= =?us-ascii?Q?YjUbiUSf9Sc5mr13BwgoDDRkvmgCb9xn4ajW6mIcZY/KSA0BlLzfWJcKpNHJ?= =?us-ascii?Q?P/lk0KmPwnlt3vGVvF/dGeY+w+JZ3YP/EwqEbJJ/OxIb04nVUNBBCkQ9+7m+?= =?us-ascii?Q?iH9yYLU/6y9/ZyP6Ui6k/n9BVCIq2lTEkBnw1Lro0+KBIBOTRtvRp6NpjJpa?= =?us-ascii?Q?RQ8GzDWuPRS/yvqQo1wLIX/etGVBYSse/IJnVXFQqbofcxRKKezlclAYbFra?= =?us-ascii?Q?qjuCYdEFQMq7CSnw7PWI/z9dlatB1qbmMISPY9rzC0RpPVoWzgyBTby5/A/+?= =?us-ascii?Q?cni8il+03nYq67oSGkm/HHK6nfGeeeZdCaO4Z5d8oCmaBxlm/Jl+jCcU0Jyw?= =?us-ascii?Q?eei7eSnaKlumZ5mpzfceQieVtTaZ2dKanfLWOiETPekGrpLJTjIKoZ9bfYmP?= =?us-ascii?Q?ZYNLJVH5jw1QsCvVnnzdawLinbIYjsgXFCSvYdwmVHlpnKUz/4LyfZyGDKTD?= =?us-ascii?Q?gRN/8dSHvbsTL6WIxQ8x4xC0kz5XBRBvJVg5iB2KNdTLdE/NqhHbIiZ2HwjC?= =?us-ascii?Q?vMAMOZCJtzn+sL+ch5iyyJFGn4V72jgMm/+w/qEExDC6rGZJWwE9hJWltz4n?= =?us-ascii?Q?hlXc7ihHeSgXLEXPdjgwXfbCnFo6WvMNcwvfXdv0LaOspNLtBKgfhVnhtwMu?= =?us-ascii?Q?pqEMS+l2XGsYOzLpzBBbhuTEm8hr808E+f4dULNXqfAemWq8a0T/yoVbS/Ac?= =?us-ascii?Q?QOpgCpR2RS6fsqcPlydVCZ+Dm+oJGZ2kTA7OM0eDRVeCUfTEtZhtMm4u3Shi?= =?us-ascii?Q?SU+J9+QnnsHIxc/v2L54ZMTdetSxuKD5f640vNxS/OH6r68hfdDxe/wjX47u?= =?us-ascii?Q?IA47RSyKrGkPlMMtpbO3UlwWPzr+EyCXaxbSrYg/ZSSmbyXICMrgPEhJj7cq?= =?us-ascii?Q?1zBf1NxMOJ/L/3k1jHlbOocnOQoxWfad3SmNFw+T7W8JOFqHrp3mHPoyLd9W?= =?us-ascii?Q?5cQjOUNZBQk7Yuouea8bqTLtBjolJSjlpCoyU27xFbwdOZwCF8wAdcRVPj+k?= =?us-ascii?Q?W2pyd2p7pPBd1WFjDQ1xjPkl?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 971e8b8f-f972-46d2-c4bc-08d966dac464 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:40:03.5289 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yNqrI14cPBINLKAW90KsWZz5JzLdCuxInqj1ct7hlmXxuPMkfiiRuI4pwMyxcUIZfO1eF2vk8y1nORtpaiiaPv/AWJyRrnz9y+rOCzBOGZk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5077 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.131; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629796044275100001 Content-Type: text/plain; charset="utf-8" We are going to add a test-case with some behavior modifications. So, let's prepare a function to be reused. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index ec4ef5f3f6..e210c00d28 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -48,12 +48,7 @@ remainder =3D [('0xd5', '0x108000', '32k'), # Right-end= of partial-left [1] ('0xdc', '32M', '32k'), # Left-end of partial-right [2] ('0xcd', '0x3ff0000', '64k')] # patterns[3] =20 -with iotests.FilePath('base.img') as base_img_path, \ - iotests.FilePath('fleece.img') as fleece_img_path, \ - iotests.FilePath('nbd.sock', - base_dir=3Diotests.sock_dir) as nbd_sock_path, \ - iotests.VM() as vm: - +def do_test(base_img_path, fleece_img_path, nbd_sock_path, vm): log('--- Setting up images ---') log('') =20 @@ -163,3 +158,15 @@ with iotests.FilePath('base.img') as base_img_path, \ =20 log('') log('Done') + + +def test(): + with iotests.FilePath('base.img') as base_img_path, \ + iotests.FilePath('fleece.img') as fleece_img_path, \ + iotests.FilePath('nbd.sock', + base_dir=3Diotests.sock_dir) as nbd_sock_path, \ + iotests.VM() as vm: + do_test(base_img_path, fleece_img_path, nbd_sock_path, vm) + + +test() --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629796126; cv=pass; d=zohomail.com; s=zohoarc; b=bF8yl4A3hnKTLaVnKOKST6D6vW3IpAfG+C+yLU77iFSFETpZ5D9tr4wQM9sfIwYG54s5IH2XCB6gXjIgKMZ9gQaamoiHfnwamTP4MHK3Pd8mDLw9XWxU+yuM1QVR/9m7NDUmDjenV3fa5Rkwm4+Pp6nPeYU34njtjNb3JWNguf8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629796126; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=A5nciexShtPATulwjI+NVK3OnuPoB2K9ZiF+peWiDmg=; b=WRCokBp5khbQ9wUpm3eYTz8NQP2Z3WpcA/7SldjvaDaHJfWtAx1/69U8NvW0K4wiW2RUqujgKppBjYid1OWJ1ZAqf46kOZ3A43JL+zfryK4BAAWpiX3xruE84SH2Kxo610FQvIEhbiqkW6z4RbL5vceSPST2uELQq9gkF5CMQUk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629796126894558.5471847930746; Tue, 24 Aug 2021 02:08:46 -0700 (PDT) Received: from localhost ([::1]:33222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISQH-0001Ra-S5 for importer@patchew.org; Tue, 24 Aug 2021 05:08:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz8-0005PA-0f; Tue, 24 Aug 2021 04:40:42 -0400 Received: from mail-eopbgr130131.outbound.protection.outlook.com ([40.107.13.131]:22309 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRz6-00086z-2h; Tue, 24 Aug 2021 04:40:41 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB5077.eurprd08.prod.outlook.com (2603:10a6:20b:e6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:40:30 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:40:30 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:40:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LZaO8f9L3D/iYsCmNws6zWSbqqSu4FX+uUO3BADN/BRsOMIerbmaNeohgibkLdoM71A0Xja083Q5ZftzwCSoQ3s68FMuOIYGGeD11Rka6E58yK+I+z7qIpQEC8EfEWkVl2qtUd9lxRU3CWWnvpLBRNLuF8guHAgxWgrRZb8KptQ2ywb0Bbnx+CHXKP0N1tJnbuUWleEMm3ge9voYNgOQAI1xF0riiLSKGyyhJN0uWdP/U4Qg5qQ7mlWeEm2opoXLqgc5UBMETKvqi6UTx9bxi9zgFmfSlZLCb1zN1moGiYQN7fAeMZDdEyR9IB22V8EQG09PIw5gBEP65YCuOeHBsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A5nciexShtPATulwjI+NVK3OnuPoB2K9ZiF+peWiDmg=; b=I3VXzZ7nOcTXUCkDdHUsKbxytAc8f8udv/7REMK9xOhU1CWjWxKSEDwCrKSF7AEy2foUZfp+h5NEJFB7FMPEFkYN4DJIJXvCJCyW0WMO447Y1kqYTQ6760itTz5VaMPRuCmqAJLPRiyhtNcvLnqEX/TPiBW8KojvYAwso7IyYlSrtzo0llc1biYhCLyEaIVp76267oIjZcGbnuXbU3GEoxu2QLoitsdobKn13j/48w7BObyUv1vrhrh9wPsFU19O0HEU8vNkBiIuDp2ugTIJgksrMQ14f+RkWr7HT8J5UlwluXtUP7fpshSFgbaSDFUwLWaJ9jE770Jk56SD9GieZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A5nciexShtPATulwjI+NVK3OnuPoB2K9ZiF+peWiDmg=; b=d9K4fIA2weRD3upoxnvlmRSiRW3yR4voNwidEfyhYrlOZCey5+qBH5QUKF5SOk9yruuBH/+x9iFs4mRT/G8oILARuxzkVTG4kUjycHFAdO4g6bu69U8kVuEQPYx/JIAzt4nmiJIuxPM/fz2l+/SOCJtoR6L92qXGUgbei9udNNg= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com, Max Reitz Subject: [PATCH v8 33/34] iotests/image-fleecing: add test-case for copy-before-write filter Date: Tue, 24 Aug 2021 11:38:55 +0300 Message-Id: <20210824083856.17408-34-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6947f08-90b0-4b56-8965-08d966dac54b X-MS-TrafficTypeDiagnostic: AM6PR08MB5077: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:635; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hkRA3gI13LCmncn7pmyBq3PqHX0UA4bkBzNq7XQpKlaAohoEja+ZTkP+sXx0Lj1dXMmbyKPM3VkSsMBPqVKwaPhZP3ZAstys+Xljsz48biEPCPw3F+NfiiLU42Ko5gjQbrX8oM24DK+0sgP6Uyc1WJn0Hg97TuhwMcwMBySTcB1zn1/6XIpep9Bn6DMIRuCyPxqhE23BLKUhMN4nTrvKRPlC+QvsSiz9SmMZrwwO3dtOu0cURv8HSjMnezTLbaumH48Es5uUL1+wb39K+s6mtkSL+X2aUkzbM01kZTujzhMeN8BB5eM9JxgJOo6EJ/9rgAGn/gOK5WLAn2av0785rO++6/sYyqQm3hBYeSa/N1bFA2b1PaIrC6v3BR+8DHmjwWU5+Av+4f+WSLEW5q3HfGokGhtLWj7An0f25eXHh0FzLYGx4VSAJkZUtiruwFM2JXACFaNPLVa9zz4wJ75N/dmaVOQe1TBgY9kWQdQlkJcxQJGQ2y7OYHtDR8ZoxQ3N2ueDofA2Pk0Z2xMZFA6PWF5G6rHzCTB+GXuC4cRScCWdkIA4wWSvEav0cXKfvdpv0EOERam8Wa0uSDNeMtyvUwYmPh21EYtMRkcNpswnoDj/PYsJjk0vbzaGouWwx+E4BjnnIuLrjicWA4Gf1vB9AtAU5AG/8S3xCPFql0j3iLj8m/dmF2hhBSycP/CEX9X7MCGBcRejdw1UP6B1sTtSLw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(136003)(39840400004)(346002)(956004)(66476007)(66946007)(316002)(6506007)(36756003)(2906002)(66556008)(6512007)(186003)(2616005)(1076003)(6486002)(52116002)(6666004)(86362001)(38100700002)(38350700002)(8676002)(4326008)(478600001)(26005)(5660300002)(7416002)(83380400001)(6916009)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Ap6RKS08vgN+5ifn9Kp5AlegraPu9S52XbZJEto0gO7m4XzWdnJmF9zAuJUE?= =?us-ascii?Q?8UxBEymreKbEptzhOi74f5X5cAXJhnrfPFvIvYCGMHjQcTWNtHrUe9j7rNh5?= =?us-ascii?Q?3g9b6YewdQyTtZ4qT5ceX3aZ60W/QS7PV0rMI+PvbfA5WMuJ/JECdyFlH8Zx?= =?us-ascii?Q?eF0QNAj0dpHHki6CmhpLTk7Uhwp7FIeQb8ArlrpXrmk8MAxSKtoGtNavp240?= =?us-ascii?Q?eNL8S5UBG5qEXzMHeDh73CFQIEl7Ne5DkU0i+S31EZTtTpfd1ke2/NS3t7/y?= =?us-ascii?Q?bqkb4OPVCTN+ZYSKsvg7lqhEawqhz0YX3ss2yPECDp/MG5f5xn1rwTAbQ7dc?= =?us-ascii?Q?QeZZcaGOfmL3uumbIVo/11LehYlSfiEbAtQzPu5koLpsRUi4Cy9nGuyvYbRa?= =?us-ascii?Q?lJVL8mgJTLPwutwzFFVCju8PKtFq+Jd07MGzBdnax4usBNRLkOHWV8JGNr2d?= =?us-ascii?Q?gxMQWmJyF8FVKKTJ411cGr0I6i2npHnRWwQB/qSdJMUkBhqCLyCNDGkSKPzi?= =?us-ascii?Q?qfooq6Z9MexFqHNfNnWhXkrh+sWzvxAlrnXDSx2qdLNa2ScmD8QqAUZnqwhR?= =?us-ascii?Q?PnDl+gI8V5O+M69Gopkf6PRQO6XPdWdy0I14IU6sUelrBYm+mTcM9yu6Ce5C?= =?us-ascii?Q?41dyvDom9QkULjG8dbDzf2QfolCPr7r1E9F/UwMOmVH5z189fTDSaBO/qlGn?= =?us-ascii?Q?NUUf2kwfoT6EyXAFcCE1/FecQ4rgr/aEt8JCIZgbjzc1NTXo6Ie7ihGGrAgJ?= =?us-ascii?Q?5TeiMLo4jFA3SrWXhmpH6tSAmkmGESD4SXQmVzQT0CjFPlDR5Jh81B//w5BY?= =?us-ascii?Q?4zjdyG/am9UgR7mUDx1CMcR3G3fU+pj5Q1pE4RJoKyfnqp+0OBO3WKJen0EH?= =?us-ascii?Q?lM6ehkL1Ws4lyQjVhquj+A6DXt+jdn28VGDvn2pC1YbE94AxQ7hywJcZ2hsX?= =?us-ascii?Q?E6yv06TohNRTNKCD5MmlFr04QaeN1fmpgbHKNJJKl/o0EFLcfeE7DUa8Wxbc?= =?us-ascii?Q?/61vHmjcPSBzkPmx9uXIwPsKbDK5OOy2hbKbGc7RVf/LKg7I5VsthW6zmWyt?= =?us-ascii?Q?/nu2rpTQZiRuwtPYOfFgUke6HpMz18CV9uddB8iEORVCBcBzSr4vgtklsxQE?= =?us-ascii?Q?vtEqH/s/V0zCeGhrzX8d5U9+p9nUJ09CCii9Bi2lV2xIBq0jtQVdliM/tJka?= =?us-ascii?Q?JEBS9HQEh8U5JG6Q5ktA7mnAiVHjUUwhVB6bKefawcaiwBhquoJUxXjoBBQt?= =?us-ascii?Q?Qmjl75BUdhd8JYIuEqNxEV0gF/t0WDF6skkJkJ0sIQBw6FEEzyNTIixbStWM?= =?us-ascii?Q?+H3d7jgdjI+QanR1Z5sLhB4O?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f6947f08-90b0-4b56-8965-08d966dac54b X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:40:05.0074 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: K8Yw4DRAz2fnez/6lGkBbXJgUXKWBYgYB10ZPFNnuBcWG90V5HkrfwlqveKWdXAd0NoP1uungXHx5rpHvV6fAq/TbDwW6rAr/qdt/GCs+KY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5077 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.13.131; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629796127532100001 Content-Type: text/plain; charset="utf-8" New fleecing method becomes available: copy-before-write filter. Actually we don't need backup job to setup image fleecing. Add test for new recommended way of image fleecing. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 50 +++++++++----- tests/qemu-iotests/tests/image-fleecing.out | 72 +++++++++++++++++++++ 2 files changed, 107 insertions(+), 15 deletions(-) diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/t= ests/image-fleecing index e210c00d28..f6318492c6 100755 --- a/tests/qemu-iotests/tests/image-fleecing +++ b/tests/qemu-iotests/tests/image-fleecing @@ -48,7 +48,7 @@ remainder =3D [('0xd5', '0x108000', '32k'), # Right-end = of partial-left [1] ('0xdc', '32M', '32k'), # Left-end of partial-right [2] ('0xcd', '0x3ff0000', '64k')] # patterns[3] =20 -def do_test(base_img_path, fleece_img_path, nbd_sock_path, vm): +def do_test(use_cbw, base_img_path, fleece_img_path, nbd_sock_path, vm): log('--- Setting up images ---') log('') =20 @@ -67,6 +67,7 @@ def do_test(base_img_path, fleece_img_path, nbd_sock_path= , vm): =20 src_node =3D 'source' tmp_node =3D 'temp' + qom_path =3D '/machine/peripheral/sda' vm.add_blockdev(f'driver=3D{iotests.imgfmt},file.driver=3Dfile,' f'file.filename=3D{base_img_path},node-name=3D{src_nod= e}') vm.add_device('virtio-scsi') @@ -90,12 +91,22 @@ def do_test(base_img_path, fleece_img_path, nbd_sock_pa= th, vm): 'backing': src_node, })) =20 - # Establish COW from source to fleecing node - log(vm.qmp('blockdev-backup', - job_id=3D'fleecing', - device=3Dsrc_node, - target=3Dtmp_node, - sync=3D'none')) + # Establish CBW from source to fleecing node + if use_cbw: + log(vm.qmp('blockdev-add', { + 'driver': 'copy-before-write', + 'node-name': 'fl-cbw', + 'file': src_node, + 'target': tmp_node + })) + + log(vm.qmp('qom-set', path=3Dqom_path, property=3D'drive', value= =3D'fl-cbw')) + else: + log(vm.qmp('blockdev-backup', + job_id=3D'fleecing', + device=3Dsrc_node, + target=3Dtmp_node, + sync=3D'none')) =20 log('') log('--- Setting up NBD Export ---') @@ -124,7 +135,7 @@ def do_test(base_img_path, fleece_img_path, nbd_sock_pa= th, vm): for p in overwrite: cmd =3D 'write -P%s %s %s' % p log(cmd) - log(vm.hmp_qemu_io('/machine/peripheral/sda', cmd, qdev=3DTrue)) + log(vm.hmp_qemu_io(qom_path, cmd, qdev=3DTrue)) =20 log('') log('--- Verifying Data ---') @@ -139,10 +150,15 @@ def do_test(base_img_path, fleece_img_path, nbd_sock_= path, vm): log('--- Cleanup ---') log('') =20 - log(vm.qmp('block-job-cancel', device=3D'fleecing')) - e =3D vm.event_wait('BLOCK_JOB_CANCELLED') - assert e is not None - log(e, filters=3D[iotests.filter_qmp_event]) + if use_cbw: + log(vm.qmp('qom-set', path=3Dqom_path, property=3D'drive', value= =3Dsrc_node)) + log(vm.qmp('blockdev-del', node_name=3D'fl-cbw')) + else: + log(vm.qmp('block-job-cancel', device=3D'fleecing')) + e =3D vm.event_wait('BLOCK_JOB_CANCELLED') + assert e is not None + log(e, filters=3D[iotests.filter_qmp_event]) + log(vm.qmp('nbd-server-stop')) log(vm.qmp('blockdev-del', node_name=3Dtmp_node)) vm.shutdown() @@ -160,13 +176,17 @@ def do_test(base_img_path, fleece_img_path, nbd_sock_= path, vm): log('Done') =20 =20 -def test(): +def test(use_cbw): with iotests.FilePath('base.img') as base_img_path, \ iotests.FilePath('fleece.img') as fleece_img_path, \ iotests.FilePath('nbd.sock', base_dir=3Diotests.sock_dir) as nbd_sock_path, \ iotests.VM() as vm: - do_test(base_img_path, fleece_img_path, nbd_sock_path, vm) + do_test(use_cbw, base_img_path, fleece_img_path, nbd_sock_path, vm) + =20 +log('=3D=3D=3D Test backup(sync=3Dnone) based fleecing =3D=3D=3D\n') +test(False) =20 -test() +log('=3D=3D=3D Test filter based fleecing =3D=3D=3D\n') +test(True) diff --git a/tests/qemu-iotests/tests/image-fleecing.out b/tests/qemu-iotes= ts/tests/image-fleecing.out index 314a1b54e9..e96d122a8b 100644 --- a/tests/qemu-iotests/tests/image-fleecing.out +++ b/tests/qemu-iotests/tests/image-fleecing.out @@ -1,3 +1,5 @@ +=3D=3D=3D Test backup(sync=3Dnone) based fleecing =3D=3D=3D + --- Setting up images --- =20 Done @@ -65,3 +67,73 @@ read -P0xdc 32M 32k read -P0xcd 0x3ff0000 64k =20 Done +=3D=3D=3D Test filter based fleecing =3D=3D=3D + +--- Setting up images --- + +Done + +--- Launching VM --- + +Done + +--- Setting up Fleecing Graph --- + +{"return": {}} +{"return": {}} +{"return": {}} + +--- Setting up NBD Export --- + +{"return": {}} +{"return": {}} + +--- Sanity Check --- + +read -P0x5d 0 64k +read -P0xd5 1M 64k +read -P0xdc 32M 64k +read -P0xcd 0x3ff0000 64k +read -P0 0x00f8000 32k +read -P0 0x2010000 32k +read -P0 0x3fe0000 64k + +--- Testing COW --- + +write -P0xab 0 64k +{"return": ""} +write -P0xad 0x00f8000 64k +{"return": ""} +write -P0x1d 0x2008000 64k +{"return": ""} +write -P0xea 0x3fe0000 64k +{"return": ""} + +--- Verifying Data --- + +read -P0x5d 0 64k +read -P0xd5 1M 64k +read -P0xdc 32M 64k +read -P0xcd 0x3ff0000 64k +read -P0 0x00f8000 32k +read -P0 0x2010000 32k +read -P0 0x3fe0000 64k + +--- Cleanup --- + +{"return": {}} +{"return": {}} +{"return": {}} +{"return": {}} + +--- Confirming writes --- + +read -P0xab 0 64k +read -P0xad 0x00f8000 64k +read -P0x1d 0x2008000 64k +read -P0xea 0x3fe0000 64k +read -P0xd5 0x108000 32k +read -P0xdc 32M 32k +read -P0xcd 0x3ff0000 64k + +Done --=20 2.29.2 From nobody Thu Nov 14 07:06:16 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1629796247; cv=pass; d=zohomail.com; s=zohoarc; b=N6IGDG20v/PV8lVRdpfdea3MenMNS5IRiMQTUcXbaLzWcA8eOp1ltZbUBynr4wAm66JO4jBIlQfo+nQ3ra3Lp3MBkqWPiVjl+qDDZui61qImAa/NiJWowbyPVNaMpSchcpFwnNHG3iCi8ElCyZgUQMzmHt4UebFSGBZjdubV4JY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629796247; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6MJJJqh6X0tyOPN5k2fzpZeTLqTuDiYYFdTHsgugpz8=; b=IU5p17fRZzeFC6RbJ0j8JcrN0b9ylL6EbVj2E11iFoLbgXydNVeZxEMS81Afu4LYvQweWM8Gruhqwo0l8xdgV44I1OJdsg+RdluDq8YjVikXOXMbjouuiSXv6PgyEdCwO9VWO9n5XutX7Rw2to28AKgdC+6QIdBwRU19/NsAUJs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1629796247928349.0401670576164; Tue, 24 Aug 2021 02:10:47 -0700 (PDT) Received: from localhost ([::1]:40282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mISSE-00066r-HM for importer@patchew.org; Tue, 24 Aug 2021 05:10:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRzG-0005oF-CM; Tue, 24 Aug 2021 04:40:50 -0400 Received: from mail-eopbgr30097.outbound.protection.outlook.com ([40.107.3.97]:41120 helo=EUR03-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIRzD-0008Cr-NI; Tue, 24 Aug 2021 04:40:50 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB5077.eurprd08.prod.outlook.com (2603:10a6:20b:e6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:40:30 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::3c5e:7829:362d:1423%2]) with mapi id 15.20.4436.025; Tue, 24 Aug 2021 08:40:30 +0000 Received: from localhost.localdomain (185.215.60.249) by HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:40:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pqnqegrpq2VVdfrpdcUq9uKZUwi+szWx7HOw2CEuEh1sHTgxXm96vXjwqmBqnhoq9mM3kXtKcnaGg5JZ3AzzbKOiaXHtcTUKudozuDJtNtDT+Fl+VqsVSHCllswB4iDdBFSwzkaPU00a9sUI7/4ZMoGMSNpnDB+aEMSePx9JhLt/fRk3RQPjcJNru3uJYYl52fQAlfUB51I5esbmWCJmo1Ikm640vp03fnn8IeFG7bKuAdhyPChpfa/T4aMQdpMeBg8+vLGY3WEZwarEVRw8Kz4tEPK2vGhWJZkC0cqvOGtn+LRfxgrLidlKSkFv4llkYsXVjSk4OSlBMxVFOL1RCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6MJJJqh6X0tyOPN5k2fzpZeTLqTuDiYYFdTHsgugpz8=; b=fRLVwzHEfGjnx/DvjMvMKiR46AsGRm5oEHtKWFs+tVs8cxZS2WceUr6ZvucAvP6WFp2qtSwiMrAw3KZaxnewp6zxaJdtY20bWTv+7Oy1t3GkkCvseOLHVerKiWmsLvp6XC7Cmvk8J9B3lZNEs46snUw8WfqdFxHO9oQkBUqdmpVyRtZx222T6QC+JwEpvgXNIPIueiv4astzUCBpfVdWjAGF85O0YXxrMcmZ46C2NyJhK9005XWb/NcyGeINjJccJ4ActoaaCsR4yEc9lRF1vsqY4M7Qn0BmdG3xs2482jNTQtmIxbng276KUl3TKoMIKLxCxKfBysPjaHDAA2UsdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6MJJJqh6X0tyOPN5k2fzpZeTLqTuDiYYFdTHsgugpz8=; b=mk0A9ToQU2liNanOaBfuSPCQzcl3YGqYTNnYzq5nXjwteAG6Jtr8Kd97hOOpqOYGWxxBpBZybe6rlCuAwPj1be6e+FPlPn+CtszOM46SLUu/4hMaQGdycZaM4Ueu1rrgaMiVPVvWXVkZLMIVbdfehD2Af2exxha07NWQi0HBg+E= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=virtuozzo.com; From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com, crosa@redhat.com, ehabkost@redhat.com, berrange@redhat.com, pbonzini@redhat.com, vsementsov@virtuozzo.com, jsnow@redhat.com, hreitz@redhat.com, kwolf@redhat.com Subject: [PATCH v8 34/34] block/block-copy: block_copy_state_new(): drop extra arguments Date: Tue, 24 Aug 2021 11:38:56 +0300 Message-Id: <20210824083856.17408-35-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210824083856.17408-1-vsementsov@virtuozzo.com> References: <20210824083856.17408-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: HE1PR05CA0178.eurprd05.prod.outlook.com (2603:10a6:3:f8::26) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e55ab463-4656-446f-5adf-08d966dac62e X-MS-TrafficTypeDiagnostic: AM6PR08MB5077: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:185; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j+HsiGOPjMz9gV4rRwI7jJSbCkH3vXsUDlpycjwd1BqnXaNTk3fEaIMDCjH/MnJzYvHbuzsdqaBcDkDmJX8JLaNU6Pe5HXzfXH4+JCWSehE2bZmlT1X8ZNcvncf+CP6IdgBzoQQx/szGePOrMKrR4y714aqRUhHkQ6rdVexKCUiCfrc9Ngsa4/SOmJ9sIAwDHKO2JaHXLKwqc5ofjZtKHSqLN4o9vAtt7nr7LbGoLZnZY1YVWLyexOJJKvJTlxiz9TCuZlI6EiKIOTy/lG3s4zz0xS/JZ0687rxDoWrgfIDdBPGJgzyOSRr/nGd3+QmvPGzyklI5+UHcUaJy6WwSFlRKMi/NzVcGFh4eL6PAkrOp18RgAZyVaZudyo1jxMh7O3TR/J9e9BxVSBgduqNpxvqi9529atjGooXlUe05wmUN+EnustFyb7Bou2NsRqQzpnhRVhDREKWAXEmTJDV97QrpGV2+ZU32nXUs/7QzfzyRq+J/Ui28da5wrh2MBwF1bp1xX/6B9lQMVAmsvM4E8PGsjSRR15SVvi39XGOZNd2UST/9XEkNgUkQ63B9Gb2Pj0kCn0Xuokwh1vLKorOFfVpE/szRaAT7VKRLDqk2LEy5I8YffJC1uQqLjGQolFCOPThP9DzQKTIQRRCKwFoRubynuY1A903DjDF1BflCtNcOvH06T2gFMQmXWz37TqTrVqNaWHL1Q9jf6QozGuNJrQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(136003)(39840400004)(346002)(956004)(66476007)(66946007)(316002)(6506007)(36756003)(2906002)(66556008)(6512007)(186003)(2616005)(1076003)(6486002)(52116002)(6666004)(86362001)(38100700002)(38350700002)(8676002)(4326008)(478600001)(26005)(5660300002)(7416002)(83380400001)(6916009)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SrH1+7BegGV0v+Gqvrkv3+hQRdSbbivLFzorHqQWzZ1Z4tqJ7ra1ev1+8eQ0?= =?us-ascii?Q?oVGlscd7bS2C6hoo8FJ/XvzlYg9bLFsyZIuliuys6aB9mg/O3Y53aSt08B9f?= =?us-ascii?Q?WutgRMVSBHy7nagCRI7rZQM/oGshjJNYDDubvHh/zP3lzsa03cJiXZQLu9Ai?= =?us-ascii?Q?SWlO3sLw+UUx4nz3jjbMMHYNg7OPsd+XxhatkABoC2k/uNfYnxpT00HqNJyn?= =?us-ascii?Q?1BHivh7A/8G+soTskomzMmretFe09N5RkusyVPs+AIKaZCxBeqXFm5fg+aG2?= =?us-ascii?Q?sP6zRdYp2tCoBAkwoq3K38QB57xFhyYPWyd6L3mAHfqbCCObo88Ko1/Mg2/t?= =?us-ascii?Q?UzmL1aOrNIIM3TeI1s4onkuGZV4w/9Za3ShRH+50Yjemhh6CJVXaT2wuHLFB?= =?us-ascii?Q?ct818du+qQs47LzZG+95JBuJWu6bqEGvcYo4iXp1xVlXS/GfSxQTXjG2GgFh?= =?us-ascii?Q?FPcqMgi5IJAO7yxaiZ94QFUtZJcQ/SLDC/uycxGe5KgNOZGkcLbRAlNVJIkp?= =?us-ascii?Q?7qUwirv5orFMvnUMDswiibLEQ91xQHWqHOgZT+ODTn9/uN/fRfNYFGQ3fpSR?= =?us-ascii?Q?eOV2ydEFtYFe3flqN6ccdPv/9I9Dofuf5gVv6DJ9L0oU9aE5OZ2fBqj/4+zz?= =?us-ascii?Q?FY+yBoFjtL0RYieRrUiiA0c+gtsH6WV9urWDSD9fI2L3Jxml8EamiO1puG7Y?= =?us-ascii?Q?J/DCJlAzzQj2ASLWEI8IG/qhkpOFOlCgUMtrPXxRMZzgysA8+pJva/rWtLe/?= =?us-ascii?Q?7/vpA2IF6wg6Oj41SZGqyVRI0JAQD+AMio0VGhxmlTGMtHLLXe80I8v9mDft?= =?us-ascii?Q?QqqIuW7Ayk5KBgU6IYBI2VUiVbORY16aNDPwtpgmjcPL6MCZTIbJGqXABVHu?= =?us-ascii?Q?NKNRuuw+C9mcbwTW819OwcgNjYvNYiWWa2VLV0dlTJs3zAMFYVgAK7025NIt?= =?us-ascii?Q?qGSYLt4Q9CR05/0Fs9T2VoTfldmiLlI7WnnsIEwbmJQYT923kVBfKJM7H/Gv?= =?us-ascii?Q?pNWxAydmA44exbUDdBb1V8Y1QJrJ3HFV18M+twvX+WqyLaOw6V8tJI2I0qHj?= =?us-ascii?Q?RgRWx+n3g7tgfY2Kd/Rv/yvbfNZAZkPs0xzhcUu5hDd3rfwNg2uMYA0lZTvp?= =?us-ascii?Q?PbsZW84RD9MIPoyxWm0WisGue6j7z8lB5ccWNr3eyjUAsrVXreJutDQEDMBs?= =?us-ascii?Q?LNyVZl69a53MzkqrJbwFndp1rKGBWqn0z7rC+b1n+pJBYoLZJQoOTGT/58EE?= =?us-ascii?Q?cXVQIEF0S6XM8xKDcOIyQGA+ArI+Nasp1G85rMzl3jUEG6tpGwMfY8QaPE1e?= =?us-ascii?Q?YDnVeGbdnnCSmxNi9lhbIHmj?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e55ab463-4656-446f-5adf-08d966dac62e X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:40:06.5457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Qp7MadVGvQ36mE0torjEUV2sQFCdmkcFJpaIU5U7P7bLwiOFFV9BBoyGAO0TVgEl6Hl5zRurkZfZ2GTTI+c6a9PMbL9wqnDDamTbpVKa5Tc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5077 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=40.107.3.97; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @virtuozzo.com) X-ZM-MESSAGEID: 1629796249716100001 Content-Type: text/plain; charset="utf-8" The only caller pass copy_range and compress both false. Let's just drop these arguments. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Hanna Reitz --- include/block/block-copy.h | 1 - block/block-copy.c | 5 ++--- block/copy-before-write.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/block/block-copy.h b/include/block/block-copy.h index b8a2d63545..99370fa38b 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -25,7 +25,6 @@ typedef struct BlockCopyState BlockCopyState; typedef struct BlockCopyCallState BlockCopyCallState; =20 BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, - bool use_copy_range, bool compress, Error **errp); =20 /* Function should be called prior any actual copy request */ diff --git a/block/block-copy.c b/block/block-copy.c index 975f9986a4..37d804ec42 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -383,8 +383,7 @@ static int64_t block_copy_calculate_cluster_size(BlockD= riverState *target, } =20 BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, - bool use_copy_range, - bool compress, Error **errp) + Error **errp) { BlockCopyState *s; int64_t cluster_size; @@ -433,7 +432,7 @@ BlockCopyState *block_copy_state_new(BdrvChild *source,= BdrvChild *target, cluster_size), }; =20 - block_copy_set_copy_opts(s, use_copy_range, compress); + block_copy_set_copy_opts(s, false, false); =20 ratelimit_init(&s->rate_limit); qemu_co_mutex_init(&s->lock); diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 2cd68b480a..2a5e57deca 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -170,7 +170,7 @@ static int cbw_open(BlockDriverState *bs, QDict *option= s, int flags, ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & bs->file->bs->supported_zero_flags); =20 - s->bcs =3D block_copy_state_new(bs->file, s->target, false, false, err= p); + s->bcs =3D block_copy_state_new(bs->file, s->target, errp); if (!s->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); return -EINVAL; --=20 2.29.2