From nobody Thu Nov 14 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520713; cv=pass; d=zohomail.com; s=zohoarc; b=UY20rqb4yt4ZKV+/4crVJdBEEmmVhCivj7laqH5op3qhEAkKIbtW9IExG92y3OtQW2WHPOMznmYiI+B8OJcpY8jqV9kMFhMgRKGFjK9Ziz5fbMtywW62pMpCJw4bcc/jG8eT810fr+Ggx/OceCtThCKoiq+AT6P35avNgPeTPz4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520713; 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=FbeZJghXpTBf7ltG43ob2l5zO8fXwsqOMFDEznaWEN0=; b=CbWMU8rKQ/YrTd/54MOewMyxv88pPzZcDxzlzITZ8qA3IYYEFhHEa7e2KDmPF9kZuxS/wEbf6wCyA7U6hKzT+4wcWPNUt19e3jqdMgBOlAuAC6AdhjXvPsaTqiLV0hI3cyNiNnuGEJ4ORhpVW3REIWYnHxTAK371XcGbRryGC2A= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520713499270.07484059123203; Thu, 20 May 2021 07:25:13 -0700 (PDT) Received: from localhost ([::1]:45676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjbs-0000X4-Cg for importer@patchew.org; Thu, 20 May 2021 10:25:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZM-0005Je-Vy; Thu, 20 May 2021 10:22:37 -0400 Received: from mail-vi1eur05on2112.outbound.protection.outlook.com ([40.107.21.112]:56810 helo=EUR05-VI1-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 1ljjZK-0005Wz-WE; Thu, 20 May 2021 10:22:36 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB6309.eurprd08.prod.outlook.com (2603:10a6:20b:29f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:22:24 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:23 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ab1oHJHXuLNeg6humdCzDtM9+EnhrREJvXuhVtpat8TqpmXIUeZCZbR2QcQ/xOKaWXwxsS7AF5rALl9kClDLLlIGyo+yS5Pi4kEXYjn3irB1Wo0At9fojixF0e+k28OHs3mlWVLAU8cYWwHqzRJc2LtnHLH1bdrw1PtqDhiiGYbOeYFcP3pYR4MGmcMbKnkCjvLYyvthndRJvf7QfcYX49IdXw3tmE6bDVg2byiORD1HsOmur8IsXaK7SZwammjuOXpeteOQM8ERvOd5gVcYE0zKIZaCBUcdzDxZ3nsH4NltXHCgr5hstFzEt18uPwquwDPSefN84p/mtHgaxo4cPQ== 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=FbeZJghXpTBf7ltG43ob2l5zO8fXwsqOMFDEznaWEN0=; b=l9wjF5kZXJVRspQJF4syORM1/wZX0jWv5lRcLg+4DvxWT0fuPTgNMdxYIJAJtK/oe3e8ztccoYe3DT84Xdq4bNqS7FhZts6NVOZyrTVGTusdVpcyuud70wUvDdOF7HzwrO6XVZVbZDWFK4ocKlnsa7pq0qYnKNVMLvwmjnWnvbMX7Npp9ArqoMoAe/FmEhGt2/XY6gKCxgh7hnTfCwucW/nMXYrLNxVS28dAHE9ezdhb67quGC8GqoTcLYuIQlrb0NZKw1FmxhIZ1J93oLuumSvsHfv5eN+YyTZa2buYKxdGBj8N72qUHrSZUI3zP1ZqC3wktnQmxDHqb4sUaazM/Q== 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=FbeZJghXpTBf7ltG43ob2l5zO8fXwsqOMFDEznaWEN0=; b=XCnSaj7vYBM6e85XFYGbwMUaf3yAjAxycvgrk+pyTaZKlVUROv4S5UzEwyVfSHHMAmIqrLGjxpKk/iNes4/L55qf7KLN7SRxZpNhD0d1HQKmg71ZpXJBktwGoQ97iRtRfkxrdrGejiLU2pKLBEsPUvJLnUdsFks13lSZ9jy3x/8= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 01/33] block: rename bdrv_replace_child to bdrv_replace_child_tran Date: Thu, 20 May 2021 17:21:33 +0300 Message-Id: <20210520142205.607501-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 415b33d1-880b-47cc-d93f-08d91b9aafc5 X-MS-TrafficTypeDiagnostic: AS8PR08MB6309: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:53; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E6mmxn9FnYMYjDdQnYH4KkZO+xg3DM6tZHYYFbSoTWJMnb0/89vyo/zwkAi+Gv+kKFGS93pYTew5XPf8FndLqSJ+f/S7Tg42K/UidkyH6RhMdWFf4VvQwcjfEKXo4gm1jtYFdtvzHANiZImWoE6NjYkOkScmb0G01vEB6oBgLziIG3b44k88tvrYAywuDLfs+raW2SKaF/ot6LZqd9TzhQ+eo1vF94Sz/Fo1Rcyk+ny2B+ByZJ6UqyF9XVADjGOTjkn69817ejmx61U4UBFLrhOnTinRbzY6vhsDEKaSopGEZPGEQ0Sk4kku4cqH47jXraG5+leZZFgzPlyy+gXnIxP3OEMlSengw19qc5kH7XyclzI5SHk4qyssi2oGiHxvmPVpxeK27zkPqYQzKzgwyNPfSumGGoeHCcE2on+qIksnsz08E/hSD8f1ayROJeqhCB3tGYLdkG+qYiNY0sl8Myzz1nz8vgGn0IqKpl74Q6hzfpZdtGLgvjR40GHK8jrLqgKbCv1nEAhAlxr5cDImivp/6dX+cV1Hu7F6ypC+UM9x9CMIHAMggq3NfTQmQ6oIf27KkBpH1Gqot45sM8QGibv3il6WdvLAf2qXtPGL8cw0wd6lPltELDUuZ6AZ5h1VvuGHu8UD1ODvfShc3g3tURECjY4IVvcDtsUb9x5TnO2Yt/956AqiWxMEB20u3/8x 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)(346002)(396003)(39840400004)(136003)(366004)(376002)(6512007)(26005)(66556008)(107886003)(2616005)(66476007)(956004)(86362001)(6916009)(66946007)(6486002)(8936002)(8676002)(16526019)(186003)(4326008)(36756003)(478600001)(5660300002)(1076003)(6666004)(83380400001)(52116002)(2906002)(316002)(7416002)(6506007)(38100700002)(38350700002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?pYkK24k7ipkkidIl/2LyO3zq1aBwQRmvPVWEbCfeA1sg1mCAImUZr4kn3YCK?= =?us-ascii?Q?XUMjOVQeTjW8eRpYWVWcswCPfgaWAD5mtXf3uHNIh+7Spdrk3YclajI7dOOK?= =?us-ascii?Q?f3cMttZuY90oQhRCWC2MOnUCQcyLxkiwFPwWY9r2W0nLU1pZpQBJ5fr3xc1/?= =?us-ascii?Q?YuPxpCJuGuXCDUoKe3LdfztaMQzU2dJiDa1bd452B0pnelVTTU7WAvsIC0cW?= =?us-ascii?Q?SJ6OuSmpxzfOj4j/VUfVSlU4DrIXKSozr1tXgW1Hj9jS7gord8pNQzUiSiwd?= =?us-ascii?Q?w8D8ykGUTOJzVXdSGyaXO0BZOZvhV9Mx9qJqpKsxEN01NI7KUp/ra5m/MYf8?= =?us-ascii?Q?nwk4WckqxsnOEjGIjsfBcaVo25R0y5I52aapBUT/uBt2sVDzixtJ/N+otmZX?= =?us-ascii?Q?LaRYabjjRLR0QYR5G6ClBo3cN7dzh/A34VRDUHASGNGVDnYBfkH8ZHc6k0cr?= =?us-ascii?Q?JhskgOo+sbWIAImva9OJ63K3nDLiL5J1thLPgI3UC62yl5u5v1yl6ZwD0qcT?= =?us-ascii?Q?IFNl0u4bmYEcpzRrk3G8CS03U+26vY1yGKhvz2xeE8vm3fg9rm3OpnTLwrS1?= =?us-ascii?Q?uQUYXOV3A+h1/0Gng91UTTX9Yaui0Ges2KpxcwM+LAHvSV6EbURg2tyHGwac?= =?us-ascii?Q?niUcg5D/j8tL0D8giy2To889e2hNME5S8xdFwV/qEaY9pUzKDgJD0qH+RpuK?= =?us-ascii?Q?oSQeSnn3Wb1S0o0KKKj4EuLFxbF8xG3RIW76gFIaR5rIRq00LTqsQL7FFwVF?= =?us-ascii?Q?o9DUfrdEThhN7ama/d0OdV5pUWoYica6eOE1Xlq2n7B4DidsN+MjVuW3oxah?= =?us-ascii?Q?2VXUfhFTB0NtR66XT208++5TBPXB2QwZV+anInt3Wenf+Itu7EgkCp9ZwTAi?= =?us-ascii?Q?fbOoMFNgr5Z3ZBSrRWW+s3c4xkoZW0bSUSw1yFheMQ2T2tv1MH3yUmmSHqTx?= =?us-ascii?Q?CzBRrP8wPI0tNQHz1C6WRRtq9wrX8gECuLcClrVlLXLqlCHs+mV/jTa+eEHU?= =?us-ascii?Q?7y8qqxZZzJYznJWdqyNh2+U2sK+ormvTKSYbOFfO7wj54V0LBG93p8AK3PZg?= =?us-ascii?Q?LkgpBpz9Mzd08f9oTuoe/nK5BXdvkbvF3eC77BHKG+BpPn/G4aPrmshYv7z0?= =?us-ascii?Q?cF07a8XsuVhTDUmiXjeTKrkuHt2OH/NRAHQSD+OYwCP9jZmBwQknvfVgtcEw?= =?us-ascii?Q?kpCLYrBBjGilpOgnXVIMtAhI28Y3UD8mhA8WfypS1LRYP5IoiWgstREQM4bU?= =?us-ascii?Q?3B36YJ48elI2v7PDkllHHIT64AuRMfMVBt7vQF2OqTEKlxF3d3MwGyDS2a7i?= =?us-ascii?Q?ZZ9FyDxyT+WdBN6DQa9JcOYj?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 415b33d1-880b-47cc-d93f-08d91b9aafc5 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:23.8982 (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: 5kfIlA+oc1ZnEfS4RL1SyWMrRNSjdrJIoNAEil3qNNvUy17E9//GWugDnaZaveuQnruSpe5DoMdamELxnbChNSNldg3dXl29XwxrfAKWTI8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6309 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.21.112; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) Content-Type: text/plain; charset="utf-8" We have bdrv_replace_child() wrapper on bdrv_replace_child_noperm(). But bdrv_replace_child() doesn't update permissions. It's rather strange, as normally it's expected that foo() should call foo_noperm() and update permissions. Let's rename and add comment. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 75a82af641..384413c578 100644 --- a/block.c +++ b/block.c @@ -2247,12 +2247,14 @@ static TransactionActionDrv bdrv_replace_child_drv = =3D { }; =20 /* - * bdrv_replace_child + * bdrv_replace_child_tran * * Note: real unref of old_bs is done only on commit. + * + * The function doesn't update permissions, caller is responsible for this. */ -static void bdrv_replace_child(BdrvChild *child, BlockDriverState *new_bs, - Transaction *tran) +static void bdrv_replace_child_tran(BdrvChild *child, BlockDriverState *ne= w_bs, + Transaction *tran) { BdrvReplaceChildState *s =3D g_new(BdrvReplaceChildState, 1); *s =3D (BdrvReplaceChildState) { @@ -4749,7 +4751,7 @@ static void bdrv_remove_filter_or_cow_child_abort(voi= d *opaque) } =20 /* - * We don't have to restore child->bs here to undo bdrv_replace_child() + * We don't have to restore child->bs here to undo bdrv_replace_child_= tran() * because that function is transactionable and it registered own comp= letion * entries in @tran, so .abort() for bdrv_replace_child_safe() will be * called automatically. @@ -4785,7 +4787,7 @@ static void bdrv_remove_filter_or_cow_child(BlockDriv= erState *bs, } =20 if (child->bs) { - bdrv_replace_child(child, NULL, tran); + bdrv_replace_child_tran(child, NULL, tran); } =20 s =3D g_new(BdrvRemoveFilterOrCowChild, 1); @@ -4825,7 +4827,7 @@ static int bdrv_replace_node_noperm(BlockDriverState = *from, c->name, from->node_name); return -EPERM; } - bdrv_replace_child(c, to, tran); + bdrv_replace_child_tran(c, to, tran); } =20 return 0; --=20 2.29.2 From nobody Thu Nov 14 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520703; cv=pass; d=zohomail.com; s=zohoarc; b=PjzuGYKvhVnpt5o4tkQLUSu4a/mRC+7TuoiawGZdGmZTnU7VPI8eDKYPJ6HYnoJbBlCPz9Y22MorPqNnJHqEdvrLAOV8iiNVbSws7B4vBmLr7ENGO//0akDLx5nZ8zQWJnTbY0RyJWKqdHVZ3Qxp8MgzwZQ+RdmJvm/DElIcOcY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520703; 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=LsKTYdUhfz5aXAPxnR4e3EH6X9KCoJ/fdrQ6tP9RJ7A=; b=ji9sfpcvNJyFk9XxCWx5rSetpOUqUHfSD2EVuR1h4+8gzBZJ4WCq9s14FXDXj1AgDO+NxadbwYXimmfk0RO2DhacYl4Q/KOut/JOV9dTcZIi4nez/hDl6PyJTNriGGi6F9T7DEeXF1MLFfBGNXzNIdA26bLx+rPOXVMNrzi5Sp0= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520702939640.7307440970735; Thu, 20 May 2021 07:25:02 -0700 (PDT) Received: from localhost ([::1]:45034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjbh-0008VT-LF for importer@patchew.org; Thu, 20 May 2021 10:25:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZL-0005HP-Hn; Thu, 20 May 2021 10:22:35 -0400 Received: from mail-vi1eur05on2115.outbound.protection.outlook.com ([40.107.21.115]:23648 helo=EUR05-VI1-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 1ljjZE-0005Yx-QT; Thu, 20 May 2021 10:22:35 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:25 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:25 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OuRP1VU8ZAks+CWir1UpyKbxDKCp6ic9yBqrJLcruE9bI44QkD+sD9Vo23GJVdFJ/6Bd0wilsKIhkOPtibp4NfQqBY/9fVLFbeT0J9gA5xi0tS76jV4BcO/NHstlB5o2sxn3FC35jw6jSNt6P133dOfPbUBAfo1XIiJc94taA79+77uru5VwKUliJzypH6go0768YVkq76ZSwMQvJFLRsvMj3P4wONk5n05jxPy+wygC2d44VdrFweQdl/lKiuzI00CC43hVkZwERUKQIhkvmNawTLtn5blXENNhMgj7RpwZ7v8qnVgdlS280/svNN4DW6DtPl4YHB4P+fm1HhnGBQ== 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=LsKTYdUhfz5aXAPxnR4e3EH6X9KCoJ/fdrQ6tP9RJ7A=; b=lTJUiRgXxDv62+Z58bPcsmmGCMSP7IrUDYElHqbgYeKjjci3IJNgYw+B2iU2tZPkKG0lhU0CuKwOJfRGrLEWuyP1ieUEwsqCKrWmQDQ4RzIc+Ioh+2vUJQgBx0jaTBqRJ4eI5FM8yqYj4GkE7xBtfElpjicp3WPcLcJcpnnc4OTGXOeoJ0q9ZN7Wiu9ALfyYng4CcsTPy7+XesKbsV2M7ATeD7HON73Dd83UltU0cb7eisdV870I7qmNOrRjJKRBhz4GgYJiQDRlxH+Q+BqFvLqBokPp0l0p0VJ1LsedxYNpsoPHoKsX8eyLX9EkVsVXoT2BPaCOqhfhRyIiqfyDww== 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=LsKTYdUhfz5aXAPxnR4e3EH6X9KCoJ/fdrQ6tP9RJ7A=; b=Phkrc8MxpGOW8goGuyEB7cUfBV2hHC0cPDVZ1nsDh2HSWp3delebNT6DsmV2eBgdaDdjkxRtWvwXIGsChAMMVfezxIwG2ERtpA5PbOwx5tqQtgNiG20al+F52Auuji8ngqsJlX9oCoPC1I2u2+0KB6bUnk5Vc3hKoMqknBNcpk8= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 02/33] block: comment graph-modifying function not updating permissions Date: Thu, 20 May 2021 17:21:34 +0300 Message-Id: <20210520142205.607501-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: a64a62c6-787d-436b-79fc-08d91b9ab0a5 X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eENwWCQ9De7PxNM5rW40qtOhILOMROsejpTN7ObHkl8/PfANqKgx5k8ECyZ40e0I824B4JxhBW7ktgTFgZZo1ChksPzuiPvGfbrRcgueTwynI5bQgLuE7nEpjBQN1tEBJiSkrT5Fgxf6ynhSUi2YdhrwLGp8H0LtcjFd2YryIK4VwAp3SydqE356InibspqTFScwrndFpLmvuZe/FHtWSQua2Rkb6vbfG1dWuUBRDbUQnkbRnvoarCg3fp54Q7k4Z1cSzYgkgDqQwfnTHl18sTv0xBAkJLx/jHz+pgS9C3cl6ePpaNXlxT8XlLISWmIV5DzxEZ/CaEE76o3XcToK6P2WVJU+7qlw3L7ewl8VlxGaqiL242MNUnTlpLQjV2ciJ9plOe4Txdhpw0bOXoCUQcUDFe48Uc8DOSV2+TqI1WNVeBTPWukxe8AeYhKEsu+6YAPIbwWOzVbfw6+CVORKdBHLcqEVIBmOOT3Fwg0DN3V2Ta7MGw3/iUsar3Bgk84Oqprl0+JzoOyO0GDbnQHy8s4v1l0LxWmbF6rUdSFdLi6FTU4ZD9OhBgIvU2v5KvIDIca2RqfUxsBle7KmXOOeyGgBtI2h7hQQNtkMOpv3mAMWDzd6Ra+CCpB1Gu0hV+tu0+nekSacRPnEbvU63glBhkY9n5OHsUst79quQVvlbwOoNmtK7bKdIlXGsUPGo9b6 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(107886003)(8676002)(186003)(6666004)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?oeA6Ix8vCtOSsLWonKw+hyg9EQ6Rh2GUtxVxHOWpaSbOUv+KALVVMzhV3Yqj?= =?us-ascii?Q?BMoB3zHM6/PIeAjdDoPinajLjfjZXwdCUac8qUc4SqQpwDBcbRn31yLIQlma?= =?us-ascii?Q?vuMeaBKxXNb1VpduW/ocTWc4zTZGTcRWYAXqBQDZA0eC9fhD1d1+u5fdZ9Yu?= =?us-ascii?Q?2jZ4JOvcsjCMhD5xNjDJ5/YiMOMM0dsEhaSoRiRsxa3VvXz+Vid6QJEjd5Ar?= =?us-ascii?Q?p03eb1Q2Ilh/M3Jw/GWhb5BVDo0Aqu+FqnDBU64iEicj5d2/jjPubqsusA22?= =?us-ascii?Q?Ri2uc+HBYUDoXpWFv0kRqcAdC1ZrjYCgLQ51uNVWCgvXoTApltWW3TKJLMRh?= =?us-ascii?Q?97N6oEhLSZigDNw1CaCzkGEYjz0S3YK8pKXdiBlXFtzZ62AtIwNokLZjNs98?= =?us-ascii?Q?La2pAo/hWYGNqIAhaTRIX5hal5kVKWiIbX9kZq1JP8KMO9xg7pjnqVbhdbwz?= =?us-ascii?Q?vxwswGOMJGcr1+W1H/a8AHrHShE6mXOry95BYLagGSAEX8wkwMBWeiXol3NY?= =?us-ascii?Q?/XG9yMr7TJLQV1H7vDiQvAx3LWNIocIXplzH2ZzkUmeEPVEUU38ziBTttDgQ?= =?us-ascii?Q?z4bP5NEvkvhp/kJKmr3Ls28HB06F8i4x+hxOcN4FzwqS7HaDFfM3pLg66J7H?= =?us-ascii?Q?/iZ+iHybi90VzJmwCAAjy3IpUWNct9Mi5zBoIubXW2at/6cY1KOnNeSrLKkJ?= =?us-ascii?Q?nvqtEuvkC/APKoH1l2SfvlmGA97LDK71un+USzlrOdRfIupFyVmSuo4y3o5m?= =?us-ascii?Q?n9LKRegdSOKNKkDvDdpVi/SE6pSZYsM0IVzYNjReg5/j/qYcHe4CQ/yY9IGf?= =?us-ascii?Q?3Wzi8tS078EU5+uE/PwSW7gwqoyHnsqv2+AHl/4/L5RM5P8s3y2yG54dwcFN?= =?us-ascii?Q?2ewGHz98nyR/66dRzlr4xmRKFYr9vUz03BNoLgQzZBw9tFXqeOCLRU01IUty?= =?us-ascii?Q?JR+VIn3Ik3ixiIqrfkNrX+kSkK0nQXreAbibalXaLiscSx79L21FYQhCcEZj?= =?us-ascii?Q?s3H3lvIOnyems6kcTMSdBWfVrhfms75SF/dVc4plSj5TExSAzmC6145gBLiY?= =?us-ascii?Q?W+GqXdg7W4ZeulM6UKBNpW5Py155sDPCAyrZDfDHZvMvH3BYRNfED8SiGXA/?= =?us-ascii?Q?l8Vy5fAxVy4IxIWbwFT/YRWUDb8Rv4BkgnFxTku6kMVosRBsd3JQoTxFXyJb?= =?us-ascii?Q?uBqB2Vx29z7EkTmhORWxWHPDUst9/PEscMERjS0nxo/u2ywP5u/B/6W/SJgv?= =?us-ascii?Q?EpD5OL2OhfpRsgc4AxYjg/oWW3cFhhysQsralpNymXfrGV3+JNPdEcCFy9WO?= =?us-ascii?Q?DrXylNwqTpx2YHhEfJb6ALsW?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a64a62c6-787d-436b-79fc-08d91b9ab0a5 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:25.3289 (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: gFMcsEmmJccpRaOtrBVojcTwJD0lPMOkbC5PZ1Nhmz66dtwFFtUwwrdHJJbnMM6C4oapc5E4j93z5c5xM3i+JG3HKvvyCFVBbyIyv23zLbI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block.c b/block.c index 384413c578..8aabfb03ec 100644 --- a/block.c +++ b/block.c @@ -2762,6 +2762,8 @@ static TransactionActionDrv bdrv_attach_child_common_= drv =3D { =20 /* * Common part of attaching bdrv child to bs or to blk or to job + * + * Function doesn't update permissions, caller is responsible for this. */ static int bdrv_attach_child_common(BlockDriverState *child_bs, const char *child_name, @@ -2836,6 +2838,7 @@ static int bdrv_attach_child_common(BlockDriverState = *child_bs, return 0; } =20 +/* Function doesn't update permissions, caller is responsible for this. */ static int bdrv_attach_child_noperm(BlockDriverState *parent_bs, BlockDriverState *child_bs, const char *child_name, @@ -3097,6 +3100,8 @@ static BdrvChildRole bdrv_backing_role(BlockDriverSta= te *bs) /* * Sets the bs->backing link of a BDS. A new reference is created; callers * which don't need their own reference any more must call bdrv_unref(). + * + * Function doesn't update permissions, caller is responsible for this. */ static int bdrv_set_backing_noperm(BlockDriverState *bs, BlockDriverState *backing_hd, @@ -4775,6 +4780,8 @@ static TransactionActionDrv bdrv_remove_filter_or_cow= _child_drv =3D { * A function to remove backing-chain child of @bs if exists: cow child for * format nodes (always .backing) and filter child for filters (may be .fi= le or * .backing) + * + * Function doesn't update permissions, caller is responsible for this. */ static void bdrv_remove_filter_or_cow_child(BlockDriverState *bs, Transaction *tran) --=20 2.29.2 From nobody Thu Nov 14 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520841; cv=pass; d=zohomail.com; s=zohoarc; b=gS/Uk6uhOpUsI+pVY94svwCgTijF+mo+DNd122THI35pKH/5rlf2BxhK1MG3MVSt9DWLLPg9HvW7wIW9HhB7fCVp80ft1+6lx6nBLnr7Hp3N+sYJgkfbLLUBZNiLWIIkUHHsC3sLBSiGBMkEgJmUxXWjsn/lCJ+qVEWWrcvEICg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520841; 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=ZJLrl4iLJwsuLJOxBMYIOcq3jd9yXVy9xI6DwmKRPj8=; b=FP1jTHRSFKdlJHMGfsQvQKyiZgxmPYOlB0hBd+Z95Pm6eDgszuQbY8HYlnUGqPc8ur9l6lgqVosxmN1ZqvwPIT54WNDiZq6I17JH5JaRlJPBitMBhoxGxetU5XVT9T24pDKe5HIu4s5ToDPFWIVf3FVy6CNEvUn4jxYIq4bem7w= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520841607724.944951807515; Thu, 20 May 2021 07:27:21 -0700 (PDT) Received: from localhost ([::1]:53424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjdw-0005wu-EE for importer@patchew.org; Thu, 20 May 2021 10:27:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZO-0005LT-2I; Thu, 20 May 2021 10:22:38 -0400 Received: from mail-vi1eur05on2115.outbound.protection.outlook.com ([40.107.21.115]:23648 helo=EUR05-VI1-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 1ljjZM-0005Yx-86; Thu, 20 May 2021 10:22:37 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:26 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:26 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B98EIt6bZUBeK7pZIOYjXpDoV4RP+Htey+9Ap7h5/l6LJ6QudJjFys0yj78wwzOSDU2W0qAL4zmt2x43lpkK4ZwmFK5+yImvYsso+lpIKmW60ZAq9IICTieoszdbsMeTaJ51tHBTeERapcWn7oKJd01SMR+yf3vHSRe0jCyDHShd/Vla+lQCp7QR1ytvY5m3gmOmz2UNY802dEtgbPZj/zM6gnVAkYl6Wnfk9BfAmA1IbDCbJ9qMFwKps68koaQ6nSIvw1DNjaPCYbdXewM6rFHdPLZpKZi8cJU6HsqRHL6KHYuWzgZlug0oM8WoSm1S1SjsfBC7NwtxzlE4p5O9qg== 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=ZJLrl4iLJwsuLJOxBMYIOcq3jd9yXVy9xI6DwmKRPj8=; b=HFr5Rq7uwj9BU74EXBIwnMwmJ06qAE+os1iQvQs4SKDBLCGjut3Zic9nzqNBn07yF9T4/pu/BNw8YL8QBm3KfV6jIJDscq5X4yUvCtnMeYeFsct+jHh/2NT0qAmecGqsfk6dUr/Q9B07UTAwVY575RGA7+S1VshaW1WgbjYuceUNJRHGpAfg/Ga1k6daSBA64/JwYl0staQmvqnKi7Jk744ODxB/pxCbDZ00+yjLWC+tiTXL5S1jj2zf1Q7MUvjrkGi1zTQaoxS83C3txA+Gi5JNxRoozNqGwrIK1W9cCEbI4GB4kS51XOcMFyBs1xOKNpd1vs+h/fHKTy7JQjrCsw== 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=ZJLrl4iLJwsuLJOxBMYIOcq3jd9yXVy9xI6DwmKRPj8=; b=YsR0OSqsx8X8R0bxUcsby1TBdyLpsONMBY4pCNy+ptBbKLmJDayTUHRnVevSlHq3ts4/2IvRw6xv4QrqTl3gsthSELsoYogNfYe9OsTJFlgG0CoJcL6fsjZIF8ZhwGoRaIcAnKYfExC77zV0UZivPXDrIUOXDAjMOuifICqpgTg= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 03/33] block: introduce bdrv_replace_child_bs() Date: Thu, 20 May 2021 17:21:35 +0300 Message-Id: <20210520142205.607501-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: af0dc043-96ac-40d4-8883-08d91b9ab17b X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:489; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sBDqnwG6i7177qL5xrx7su3YL7/4FOOYe1bi4OJa7wibqX8szIT+w0GdIfn0KhKHYfdf4t9VJFJdSSIqI9MqhbljpNf6xYC34CvgL4MtX9mIJbuMoqHgMktlnkDFnGInkdpb3NrfzMAkyp9zDm1SyzaJBJptSWzQARYHb0FHW0b3YqqDm726fen1uSohOoKPJWFnFve7ACjWoKpLYUJ8niZwNiqTj9SMX8Oz/n/pTRtknLlS60M7S7QcMx8JCcSIb2veZzHGjudgGetdgwkDKyotU3sHC+/vk5Yq9WCAI1bxEjnp4zvbITtd/bwaNZQxhvjv09UtN7WhY/rjSkv0hVug2QdZY3xHaYIlW2VDBjaB9NYypSBE+M0cbBdqBT4ourF2WDhwlTCGrwQNVayyY4+iAsJ0ekzPz2zAAUkI+Y4Eks6pge3ombywrTosd82qIIuvvDKvZCXo7CrqtKEwCQHETkEZzGdIfqeZKp813/o8EKuZJEWwfNQOO572T1GgcvxpmjncXXVZiYGRYCNvFEfzg+ec1fzoRCAOsrgx672yardSzfOI+lW164uuOQFIsu+ek9ptvIm5XVMYGwXbVOCo1BYKXbNke9knrxE1ODhz7x3hs6//hQL2Dfz/DVT/YGbQLF9SkTcPwiEvM40B7m7Xw5lNT5GwesS0gooMIEXVUxY4mTNbJUPue09GS6nx 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(107886003)(8676002)(186003)(6666004)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?rUyeoHnaF9aanKUjBfipLDTbe7RqrtBUPFlp5/kgtyIL+NA+94g8hIioKAV/?= =?us-ascii?Q?qGBCt0ySquStgrJv5JyHumZXFv2Wq9jG99ngZm+PQcElJTIiQ5HZ2LV6s3zM?= =?us-ascii?Q?zoT2O7KLgvK8AP6cQ9+T63IzgIrPHYaJLE5aJhpuhHhLKvB4Ba1Nq3ELpstB?= =?us-ascii?Q?f7GZxlaI6dcygTq7zb95E4Y+nSkJuYOl5stSXakVx0RDEywYzAhG4A4znt+l?= =?us-ascii?Q?JjmtydKNvnn2TlZYbnfvqehpz/QLAivyw4YhLFKani3QrDcw30rS1aup63i8?= =?us-ascii?Q?thK6LxAqGpKTdG8zxcS/Ns/vKoLyZuVxhtOhet0wGHuV8933+aH2mjxtUb8b?= =?us-ascii?Q?ttS8i+4Isj+g0vRLLZokn2UuXjsmOs8W9O7maDygO/0EDNljfnMnxhBFSwph?= =?us-ascii?Q?k9fiBd1ccNiY2MiYMGHW196p4mrryYaTkJvIe9j691jvpT755kx3A9evqYTH?= =?us-ascii?Q?R+sFCcRZNbnx5Qy2wnlMK42vuF4DRekBN4IxncTqmE8e5L027C+OvF3OYGXB?= =?us-ascii?Q?zuL6jIa9CaBiCRJnoj98IVmkRPeviuAt1+q9YAJia4qOjkEqqunW0gfXrivP?= =?us-ascii?Q?tD8g9j0QFTFqJf1OMZtjero7OHtHqQGhOChChYvEwkL41j1GAjCWr0Vf56rf?= =?us-ascii?Q?F14JkNwnwycfKPb4GpdzQbj2UN+AnTFjl3qYfuGqpNUqR/rOnHQ20hvbg2oA?= =?us-ascii?Q?p7NXM8zyrt5iFOSGvgL3OfyjqymSB6eZ47YDjf6p9Ev6PBSNdzObwsJap5ON?= =?us-ascii?Q?I9VBUpdEd16rjitR21YjQCquM1M6JPXN8EpRiz87WBkyVvrTdiD4MI9fTv3S?= =?us-ascii?Q?PM2VmEFl4zl1U42771qMvD/Yjq8eFdEd0e3qi3WJlYgq83OrGTXkJ8stasI3?= =?us-ascii?Q?lE6sGQKo5OQC2X8RvNWH+AaqviRlF70Ill6ehLkshc3FjXdNo1JdUa5BOl2M?= =?us-ascii?Q?RM1EJVUEPsARJXC5xA9ut1h3N5aWAN01MqZfFOto5D51OGtJ5zkvPqW9x9gz?= =?us-ascii?Q?a2GBrmlhDSPUC2kyQnhv6xVgcxDvgboooSjCnXYDzAcN7POmZNQyelR51Fza?= =?us-ascii?Q?mRcqZkgeimzK67k+eCwG21qGXzWl9FdbzmRaVqrru51He4d5l4yZ3kb82r8v?= =?us-ascii?Q?YJsiWHvVMuU6d5tCBsOh4Ux03CZSygLiQFIOB5EFnQZWYa6RWPcdbIEk7DeV?= =?us-ascii?Q?qo8Z1GDG60hHzi9VvDvj5uSGgr6TgM1l/j6VHaGCk0iUVIQU4AI0LF+Zb8Hx?= =?us-ascii?Q?B4YafyC8OqiT8AnR3A/cqHIDYRw+WdgPgH3CZ4ZZJQrtNrSxJBZmrEjPeQ0o?= =?us-ascii?Q?uiQe6WPWYQTmEqMPPBR0oFtI?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: af0dc043-96ac-40d4-8883-08d91b9ab17b X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:26.7437 (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: DuceCfqHCQxuw+X2BkhOuWelfOvZI/a90SZSwt7z6vRdPXxUBHF4h6dkpAqFxwQD3RoHwcIg2FmVhtjvQWnyEAWGK+AHdjzHyTzIre2NQCw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-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) 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 82185965ff..f9d5fcb108 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 8aabfb03ec..39a5d4be90 100644 --- a/block.c +++ b/block.c @@ -4969,6 +4969,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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521135; cv=pass; d=zohomail.com; s=zohoarc; b=inAulcK28Zi2ijC/JRQnBWDgvtwYlAz6wFw6/ANFw85qJSBah8ZtRlOcVi34TZEU8G5pdjZahfvNrmr0RKzqYFI+5IWsCjgjC7LjXBPxfmFDxxRPBLYos+pX9RoxleeNJtzr7VOS3m/u0YX5J+PXvfzWlXl3IyVOlC2rtZfXVxg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521135; 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=Vjw2x0AL6IcxYWcZQRo8Yg0F/zB3SZ+NFGL+4T8bkhA=; b=gSwDRnLiMg76e7K0YBsAjJUI8xaBOSPxC0un1yB89AXoOQsyPN24ESLpRq7vqHBU4joaBPVobRM8WoBxV7nEV4+lTaM1MEK6K7yBdDXLRUNESmT1c5UMmVkj5F0+Xh0Cb9HfvmZVqA/TC9kUm9sxo4Ax0f6x9k2hNcZzChhuhcg= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521135787537.4407198995207; Thu, 20 May 2021 07:32:15 -0700 (PDT) Received: from localhost ([::1]:41764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjig-0000aX-HM for importer@patchew.org; Thu, 20 May 2021 10:32:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZS-0005Yf-Hj; Thu, 20 May 2021 10:22:42 -0400 Received: from mail-vi1eur05on2114.outbound.protection.outlook.com ([40.107.21.114]:6785 helo=EUR05-VI1-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 1ljjZQ-0005ev-3J; Thu, 20 May 2021 10:22:42 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:28 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:28 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czpm5TlWumaRXaoXiAGrf97A+NmDaa4wP9/JmnVeDZfRxc27ppCROMScWe+82lYFFFtcViMyywH4FRCx0Nq/LYI3yuKwZB7g02w+/+izLwWIU/w+bEyvWW2svILfTDq2shWnr0ghXbQqjCT4aNPIqFrmacA5gnmVPMHB0pK4JQ1r+z4qkV4sammnx2jyCd8Kfq1O5Hi87GoZR6vDZ6dpGBVFqZ70YiEo50HLO0sq4fLlUgtQ69f24/Taf4mGIT3TActyrRjGCPoCZQCY2K6Y1FpALTYinCfv/yul1mrhRKEctTqABDys3fWA/5uHJSpsSHaE7sItzEo8QC2bEZDbCA== 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=Vjw2x0AL6IcxYWcZQRo8Yg0F/zB3SZ+NFGL+4T8bkhA=; b=LWNhF2lHbTenZHiV+y6i80lmeUaX20iAstXMeOATRLPHPkNUH80WriOcRSqrgEEVTV9lIvf5nIl+XFz8LQEHlPZK5CCFZS8JIBUwBm66GydT1GoXy75aGImHm7nOtpKP7nsCdNC4zSPhW/EgrHzV+b+mb5e+DyusOF/0u6cw/lWhhdVt/X9a4zRe8v0YiWuvHcqIQL5zLN7NNO4Dkk5hBHS99BLeQ5OJKsvR+3DkO011y1rzODw5YWtp2MLqnCeAQy3XINkQSuqBbJMxpFFnMmrno0AGHYtqbiHK1JDKgrjvXu7kc3mdkP8wksVx76F6/e1nx2jTsCLgkz1+6IWFqg== 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=Vjw2x0AL6IcxYWcZQRo8Yg0F/zB3SZ+NFGL+4T8bkhA=; b=hsBngYXupzavkPqE0ZVxsUbDMQALN5uobZHKSOse5rFr5AGOWw8efERLPJ6i38SsLxrdJ5XnlUl3gkmrnxNrCKw7IpbeHaNzQSAbTNx2s4nDx/SXTZ/UWup85lvnnl3YtJ7ZdRIhEn2lt+P//a23msljT5fS0jkV8PTDf2vAAPk= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 04/33] block: introduce blk_replace_bs Date: Thu, 20 May 2021 17:21:36 +0300 Message-Id: <20210520142205.607501-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 86338855-0557-4bf2-1bed-08d91b9ab253 X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:352; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cu347g+CeDF2H1jBW0mFYrvKWcjiEdXLRCMiCLJLuoSSqOK8sAheX81OhnWqOLtCXB3la0sN/1DxwvutKiRBFA8fAb2NSQFRTKI4qp57dKvJbNYpNdHz76uvCuez3h1oU+y4Cx8v63Cdv9iz3LB9V0FSr3Fgtma3ph6wk3Xkda6UC3WXolH5XyRdna/fOrknpHxXsJ5xevMB/CN8B0ErKXkZgZuo9n45UVwhfW30JJhsQTdTTijlrykmGHSyVv09M6cyOWVm3+Zcg9uVkickJz8eGza+qKU4hvc3Vv08Kd4hf5+9ElwEjuQCTJkrE6ifETIGnMbQAp25d+TU4BVmSgkopMzf36kMIiFbcGRXx454TsBtX11QvHee5S1iUaHBJ6l4OFvwT2HbpwXOsA/mvrwix4V5jzhTEpfTwWYSj58aw+d83h8aj0C5Ur99Cs/TEk4Yhlgv90rXTpE0OlvoDZXkT/SBKKkKI5AMOF7SvmVw2MiD8JI+rHS/BaSMFHWLahDPbtb8zHhVhjSmZ7SIPD9C9hFyI7DISs1b9NX+Z10WE8R89fV/LclYN2nQnCz2JaaL7sSCuqjYZr9WOiVzR3E/4oBayloxI2csLqScP0H8wrHDBO3nG50gc5duFN76lgk98fRxpAia0uSada6TAGe6RF6YzedPFg3nKvh/dAyELvdn6SOlfVd9QU9T4bll 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(107886003)(8676002)(186003)(6666004)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?DTCT01nVMMgATQUwzaY2eybokIvIQteH+nowOgaw54EPEfuPf3rynxqyqCC8?= =?us-ascii?Q?I1Ap4ShbmQK3b11jrwmz956gdGwXQ+iA0Es0WKkJON/Bs6oOkNKbU1IhXRlv?= =?us-ascii?Q?/jNzB8hLckXedjhq6Sc0gemIa/i12rZHF6KnPPgu8JBPdWfQvMJTSbhAlTXG?= =?us-ascii?Q?JOL81RB8/NGYTx0jt4GjB0t23vsF8ErFpOOGTqbAl63WMcOJYGnar+43975/?= =?us-ascii?Q?hHzbT8rNs+67WPVHTGSKFkevHHJiaEc8SFvI4sKyYas+mG/jO72Xvkg0zePO?= =?us-ascii?Q?sEsnw0qH63vGFR3vVs5JP4Ab3orLgS6gBUMnqw9n+XKLi7R7t50k+EIagXA2?= =?us-ascii?Q?S96WfJ1eakY/l6zwshfr3h9BpHa9xM4XkiSRSZquwA6BbDy6eWRnXZuCR32P?= =?us-ascii?Q?/XdOYr3weGwqluF2Lp5Ws730+mZkc4LHvdHp2HVqUJ7LND+1mD6ecOmjwskr?= =?us-ascii?Q?roZw/9oRMiHfyHaFXw0LaBLezv3cwfXkUvdL049Zbmrq6njnTcbunZFSpXJd?= =?us-ascii?Q?bcN0WbO1T7L0W+nqqpRcNZUldGRlDLi7lW4LI8HasX/+JV5IC3Qqo1OdZNXV?= =?us-ascii?Q?YUezWZ6II6ojgt1otpujpLu8e5AwTqB/FE2MddjT/Xi6P0tPLvHB8DGwKCQw?= =?us-ascii?Q?3ghCE/ScRwo0Pp87vj44/5NbFk3W2UD9traUWzkotQ2zg7A42zeI/PKjjgcG?= =?us-ascii?Q?U9Qxte4HteDuBHJfWNpnGFHYSJpMu53JN29wWey0/eTi+xUrJz5ber4z9Y3e?= =?us-ascii?Q?kVNOtV7veNbGj9Cy2ANvDyMIF2dZB1EbghzQZwszxk9c1AtPzymBz/C1CQ0t?= =?us-ascii?Q?B+K/YxxKp9/Yw/ZaHYl/by7uZD9wzReAuqKqvGbtJ3dgg8E2DtW+iS64g1s8?= =?us-ascii?Q?Mqzgb5sU/+XIVRmFYNU7B5ueW1EdgQ1bRwFL84XtcI+PW7cBJVfsJtyox2ql?= =?us-ascii?Q?FDmrgagC2eNN7AZssqfGxFgqP/cvr4rNzQX+Yp7VihmrpEP6UZFhwrv0bp76?= =?us-ascii?Q?BnxBPMgOAECl8n6SAnEE/IenVcsgjy3yed562e+hDXxUtNuu3lQmK6JxTAaC?= =?us-ascii?Q?63xWN8HIeiOcHF92trJaavOAwoQd/rMa6hbUsSYEaY7W8vbTxJ9dOJlMaRmp?= =?us-ascii?Q?HHZHZaXTIvxcORBxj5UDoiHi2yFODpeGqCa+ypsScXrKLaU5aC4l4y1j1v3i?= =?us-ascii?Q?tAI2zUGgem3G3yhx2kJrx3SM90PFYVPBucIbXTPgEqdQa6H8dFm2Y7XUFTFC?= =?us-ascii?Q?su1nNgKQVOn8tg//MTXBeQcbl8XLgMsHB2vs5//2RnkjnDDACKsJAkFVM6cb?= =?us-ascii?Q?jkKRLVkqO37AmjHr2eZOf8Ro?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86338855-0557-4bf2-1bed-08d91b9ab253 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:28.1555 (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: Vd0i3+jBqOL9ssL+kFBst38XiEsjdKdF1OXk927mVLWl++gUQi6phhQmeZF1YZGyefhQ8OVvGCtFHMU5pq01u13B08nVlBtcODhviBQ7Zys= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 880e903293..aec05ef0a0 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -98,6 +98,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 de5496af66..b1abc6f3e6 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -870,6 +870,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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520954; cv=pass; d=zohomail.com; s=zohoarc; b=VUSBeAivSgh25NbPKkrj67zgFj39dxiu9ksceJl/sXey1Wi9nzgj2+x6FuIixi0UdB0cJPyr9Jg51Q7o+ABdl0zEEqqtu9jEcCwnTNdFJdGre0Fic01pKWoAIqDpvchhs+RwxijvQEphwTrzgirabiWEA1fQgseKbrFLknP3MA0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520954; 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=jzDbbNYEnbdBoSVH23LkmSfDqFedKSi8vW+/wTVhglY=; b=FAEqB+bWAitwKpQRIfWuSV07Eizp60BlJUCx/VNsGQY6p982/2vMd/g+pyVhQiW0BkxDX8iMdLaaI6K2wc2wjytd1j8TW+GjY/P065OdYgW4yhTaE8AKk9EoRmLuYw7A5TSEZi55fU51l34GLVkT0pT5G6gYH+fAiZ5QH2ATuoU= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520954335905.4479314085565; Thu, 20 May 2021 07:29:14 -0700 (PDT) Received: from localhost ([::1]:33424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjfl-0003Bl-8E for importer@patchew.org; Thu, 20 May 2021 10:29:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZQ-0005TB-LX; Thu, 20 May 2021 10:22:40 -0400 Received: from mail-vi1eur05on2115.outbound.protection.outlook.com ([40.107.21.115]:23648 helo=EUR05-VI1-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 1ljjZO-0005Yx-Qe; Thu, 20 May 2021 10:22:40 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:29 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:29 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K2mDLhZQtIHTMPyen9K3ok8C7tSsTysLdCXbmzEl7N6tPL4+SeLDG9D8sU08cPax7QtKnpdazvbzkYLnnzfnAkBUrsmcrh32urNZKz7gON/4c+psZrYd5kde4IjDGkqcJABz/h4Kc5T1mLyLXTwAVAgquj4/Pjkl0A8n5GpIcZ/rHQ06888C1hNFyH2nlLKwy2J04iSeXCgvoavIwxGNJdd9WYte83Ts2RsKSKQ4wJMM1UMLnjo6r6MlV9wqkqZOxHBvaOlwgp1J05bgIMKIYaAiGXGRSMMysvJgtpgPlsOOBTV0OZa7qWQBG97huiSFXzTF7HUZzjqhMRe0R0bvsg== 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=jzDbbNYEnbdBoSVH23LkmSfDqFedKSi8vW+/wTVhglY=; b=UbX8hJSefybfEfV+l7BS1UzFkJJMOqRUd/6yifoBglR+dtKiUUPWyYvxSmTnlnxrQJGLNCvlJzk8sYfPzPcJAo4Ya2PUgYfbQPICFHjFXAb5U/yCzgBjSKkomkzNH7yrpUo/g4GRUXDydM8Tx9LsTbD8SXhi3VYSh7dScakUt9tOzi2jtiNGlsBoBLn5gxvVd3JFnjgY6LS73fYoE1VPQ9wXXV+5+0q+bWqOUpOv9SDHBa12b3a+d5DBH0ugAqlTVyyoD6dUA863YGJMoXNlkEaSMtGGK56uOOEAY6QaFnLxAiVvHiICkZabM/7sceoPsK7A6SQfzcKnLvoUyCVevA== 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=jzDbbNYEnbdBoSVH23LkmSfDqFedKSi8vW+/wTVhglY=; b=EY+2S6W2UYSbvf5pLgQNnftr/HgXdX1QEifCmnljJl8sNcTRNjAMcmX06brFJODTmFKqq5b25jR6qedmw+2zfU/VU4cw+B45t44bRxic3O/3bLBokun0tuIIfWH1zr/xYEw8sl34+XShbCDx/lanUeKgSAcsziFEuQbDT+9LFaQ= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 05/33] qdev-properties: PropertyInfo: add realized_set_allowed field Date: Thu, 20 May 2021 17:21:37 +0300 Message-Id: <20210520142205.607501-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 76a90f6d-cdef-451a-dcb2-08d91b9ab328 X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:595; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BH0cQtrRTu08FA4F07BwG4rJtP8B5Elg9TpI87lYm7V+p6vOh44WRl4mtmojqSjvfd+EPHLNa41XFPqPhwCOltoR2GUQUEU6FfqQY76xtLGxYvytYcE4uLsTn+F+mW0UVxlsZAfXapjzMj/WfinL0U2DuuWgSdMfdKUTj96LmJLmUQa+NVQy0fCtN96GO00FKdrNEskaeBniXRjD9lDRJW3+amZRPaCHAiPLqNt078rEuuBKPHUorAqawQOXNchVxgYIwSVbWtOM31wiKLsrsXcnxW0aWCnnFIzii6tdwrjfdgHNfUtixlOWJgboyyKb0x47v9bUPxIYbdU4b7M4MP05LpSmWdQDGw890wNbVQHtFaXxS/8wml/3okHL5UvEE27cGoR6i2DYfOstZSF+dySxkv5rPr4/LZityIkRrmhkzI6xL77lD0cBB3ZId5QfOnhlgk23utIexRMyCGM0KoFlbfsRBQXItzziVd4xiWmcAnqqnHIxwUZiWw9XssTODS2yMofIPdUshZ265jzQR5UhbyAkCkX8S74PfXISdiAnFMX5+m86Fjq/vlwjUQnylHTOIlbSIhyeu1yn4ljLqscB8WVDYvuJ7pMJr2+pcDzOdvrejhZcAD4bUw+ULw2W31bQP0zEuj5OKtqTtz/WwwXfqMQjOpUW4uB39ODKeedsycNVGnOtE+wQB6uGcvuT 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(107886003)(8676002)(186003)(6666004)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?ziioi9qmdrR2Kgj2mlX+2ud/gVBE/28aINtK+MzXBPI9F6c0derFrneXvXoG?= =?us-ascii?Q?4nCFIzLw4YQmOU57yTirjIQDIWw3fwbxvo7uNaveiiBrXSMm6gIq7/BA1zzE?= =?us-ascii?Q?ckTzpRA26cwC9q5K9o39g7LFinAVkraJ+pdZg9CYHKJRBbQ2Fdmc3AdGuNqJ?= =?us-ascii?Q?+W+ytySjsg48kXW9bR5mDMzO42cvz2j1i37ApN56omkoTtq8B/taQmbgMEJk?= =?us-ascii?Q?5Vg1z9BM1oQh0Vl8tPGwm/G9B/+cvZn1o+fosERsB0Ito/qAODvMDXRvKH4m?= =?us-ascii?Q?ESMwCVFZGdxZ0OL3LFJHTs287mKeENC2D8FFhZeb1LXPAeTiVxItIUxLC/lw?= =?us-ascii?Q?8+NhN5Es2epv6ldcGx8JL0Cyd0/2FB1E0SG3uFlVH0PrFgLKPLmGdkaQuaRT?= =?us-ascii?Q?tC8z3XG0ohfMyNS3Xp9GsBb/1c81guMd/a6YumBwDGBDhGYl4wQZzI56UlTJ?= =?us-ascii?Q?zgsu9pwF6mRW9uwu25ppteIW3Zon2inRtFncTayhukIjImYnyz+h2VKZ84l+?= =?us-ascii?Q?jwBkeXvIDtS5p/ZFgTUO5V4X1x6nW9xed9pUitDbcZrO4zKOLTugCjHNRqnp?= =?us-ascii?Q?2uWjL1gkR+lDszPEG119/ZyxC4/4vKpWHoYTTclgfKhICgzW6FEb/7w7MYRR?= =?us-ascii?Q?xYPAv3O3hJ+hLUv3UosQG3gPHsH8jW501WboRULWoIKxTp+xz550dilv6X5y?= =?us-ascii?Q?RUZ2rrbpfvwKszDGR04iXmacWU5eTW936NUVPzCLlYyQ+UaUXGsCamr141H4?= =?us-ascii?Q?xuHVnPm6XW96PFTCNvoPjQLGHm9y3ezy9g1+2Hm3gPSOpU5ItFuWNfRMTXYq?= =?us-ascii?Q?oJQL3o46DqJZOdRsqfF7b7/8SXKfGTMl8AHa0zW46Vu6I5s63Qv3ZDE6O+p+?= =?us-ascii?Q?QTqadN9I35r3qh0IvaalywmzZYsCuwN/yalczI20tgSIU0Y8eGjkL43oVtIN?= =?us-ascii?Q?rifubll7x5M7yE9apZiQ9w+cA3UYFkv0l97m+Dy7P3FPXH2dxZgNZbfoPq+l?= =?us-ascii?Q?yAL0p6GwX7RRDoagbbG/7bHVB8ScmLQcbhcB1cNXANthoXGFuCWc//iEf8iP?= =?us-ascii?Q?d37u733Z4owNkIQ31sZbT2SOLb3tNThBn+bsn4Tt+lEYrBlRrzkky/KPlQA+?= =?us-ascii?Q?cBKHozx9Vt5jcEhEnKF1lj1O8BRTLCaV61bK0lU0PbkwIqZ99bq5aIgmWuVm?= =?us-ascii?Q?OjqyhdLJzKFbaTAAsBOuo9n7IcY0nFDcDN5A148yO7Ko6ftJ9+L159xrK6t7?= =?us-ascii?Q?+Up1fqV12mCtQrBbUOzDberaKv3gbyOhbU2o31yJqyvjwnxphjXctEjXsk6W?= =?us-ascii?Q?zmz185rrsX71DWA2yjgJBylk?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76a90f6d-cdef-451a-dcb2-08d91b9ab328 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:29.5603 (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: yBwXlASC/eYF/QhFPn7D3hM0wjxQ13E+FDj3but9pt9VtJp2wmEmTYMBeGHQANhHjv8xTcf+kia49F4VpFlqoP9MpUu6CzpSBEaB3H9VWlc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-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) 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521388; cv=pass; d=zohomail.com; s=zohoarc; b=M3TltobkiYRjN2H7iQd1iRqB0wPS060PDia/tNxeb6JujnKuSLA3by7lVHvuTV64AZkOgqLUj/UxdhDEueQOt2zEIcXg6mUyCkHovAlfC+CEU83vhQ2Pa52tBrrOwwC7jbUNQbP7UjjBmMuFljEJflFETiJG4hQeV6Hz1Xnx/j0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521388; 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=Wju+SfsauUACenJq2OTqYcEloKj+ejuPkMRtJMC1fkM=; b=KWr485plLseY/V2sKZJbPs5mq9/qiFEWVHLFT25I2xQhQzOi2RHt1uF7Lqqjq4F0GgYFKwD9a8ogQgsQSbHfagGj8NWO3ezy+HBKY01BHjQC8OL1L3CS/O2JrtF0gvd0X17RCnmsUbcuIo6GIirFLMr12oYe3fWjBU1H7UdfsxQ= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521388706913.113044947588; Thu, 20 May 2021 07:36:28 -0700 (PDT) Received: from localhost ([::1]:53864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjml-0000pm-BS for importer@patchew.org; Thu, 20 May 2021 10:36:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZU-0005fI-EA; Thu, 20 May 2021 10:22:44 -0400 Received: from mail-vi1eur05on2115.outbound.protection.outlook.com ([40.107.21.115]:23648 helo=EUR05-VI1-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 1ljjZR-0005Yx-C1; Thu, 20 May 2021 10:22:44 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:31 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:31 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mR+5MCTXH/dP46CLPRV8CtBvp1sdU+eE7zxNwUKMXrRVHhc9sfEZGiZoWk2qQSN5VR4KyjEI+GoRFBDzZlelZ4U8c4ydZ8fILkN+FssnxzbDkPgHUeyEE7dZfaSzEq6k61QUh6/CHLk78/Q3sx3eQmJZAXQPCIW6k+ARYUtaCRBWjvYIsrn0e3BUOVwinVVFb7o/ML7+4Qf1uvPWJbg9xegM64cDchUzbkFxSk6jbtPH6BZbhMVIWbvvIs0q2fX8UHKSmuDVPfn8zhRh1oS1r2HzrAdNJecBG3VgQpUNWhZ+xxoanq2hbayvmtbgIfBXea8/yknQljovcunjx8/XuA== 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=Wju+SfsauUACenJq2OTqYcEloKj+ejuPkMRtJMC1fkM=; b=m+/P933C4VB9FCv2gyVHmT6HvW/uMVZHXBd1aEyMqVR1WUVziaegSp0x6f/05f6iBXq17+n/2a+Pv9jqnCBujO8EeXEWFL8WU3DsJd2nXOubwEIS38I5muocTgzHrC0IZIJ3ebc8zRf0wjBo0WTBT/1sOYp00cFRk+uqcJqPEZPZYkX4Bh6t6yUvJGIsQCZOuNyFK3wnTT24XZmq5QRgiRG+nE5n4Op9MKUHBQ3W5OJp5BoySaW21nAJtE6BKVR7UFp4vagbCZveVBeaI2MkfEu6FP0XvoOnOzvnqHI24Lf6VfLzGdCW+vi4iCrXF4C4Ru0+82D1I9LzPBt13o1Xhw== 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=Wju+SfsauUACenJq2OTqYcEloKj+ejuPkMRtJMC1fkM=; b=Lqqv42GjnkJXe3TqbrXJZMpvidBO+nhLW6+Lz9Yj6u68HAWu/SO1F43i7ZhJa3e/+2i5cBn20smf98vtfhu2pApGMNHSY6Nntfs5c/ZDCMrbPJRftyMvyyxc6BR5sc0fvl9qbZ7PqogpaU9wXfxvrzpqHoTmBJq5u3FE8laK/XQ= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 06/33] qdev: allow setting drive property for realized device Date: Thu, 20 May 2021 17:21:38 +0300 Message-Id: <20210520142205.607501-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 866ab2d6-75e3-4296-2257-08d91b9ab400 X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W2FhE+xw9RqIj54NvDZL1ehZH3w6yhaJSS0Ci+fOogYeE61ETeBbq8ZXPho24a8JVeWrdrp8kXI5Uv+6SG1IXqnUyeerswWiHnKZLckb8F8REI4nnn5f55mMAXD90391LWIGqUSC1bL+UNNkCVvXiB/ydZlT+xdHEmI0nRUdCd13QLdINXUH+pdsik4Y9ffI5bkoRYyWZTz5yGnOGNywTM2crPZWW2ISrwlK6UFgJx+N/YUfxT6usVvDx7D5rIRYTT1x95CvDQhH5Xe5bLmA5TJcL5bnX0dKo9XK0kcxyQBmQfE6YBfIN3rXSUhhVqGR91wdQEapiiffjuZJRNyvGO8JWTviCvybbiVAXiGm4VgOcma9g3noHjmennRxQt/S/AyhqGgihTkf5sGbURmEypw0yX1svz8PpNc9Rx5DgpMcUHAZmZXtBb7cVmhOB0ZstKPv5q9PIWYVwQO0I76Q1av/V+zgStFX9IyBuoBNb/jFk4/QHFFOCh7ajcUT/kZig2SQdExKpvEmCAJxEFhMXGn4WC09D1fDN9a48sM1zfcTB9HkH+vV0wAqs+D+AAoEL0hp+uLog7rlPYxFrHeM+y2t4domvnxz5fyHVIkrGBwrmqYEbiLE9EOHsmLW7pzwbalv/p/4ia2ghrlHYrFyag== 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(107886003)(8676002)(186003)(6666004)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?VE5ZYmd4RUlmRHBUZ0VvTktPQzI5ajQwYmdLT2hmV1JtbExoWWxpRWlMeFVl?= =?utf-8?B?N00yQ3ozd2hFNnE0TVdRblVGTkVDS2lkUzY1YVNQSFMxY25KZDg5V0trcUNn?= =?utf-8?B?TUU1ZE1sSjVxeXdqSUZ4Z2hIZjNVaEdBK1J0RER1Rk0reTdYZFZNNlYzd3Ux?= =?utf-8?B?eVUvcjNZRTcyN3lFVUw4TGduUExCaFN3ODk1WTk4eGxqcmkreVpCU2lxeVRv?= =?utf-8?B?aXdwZWcrTTE1bmQ3Yjk3eFZLejlhTm9KODRlcnZ1bUZBZXdWVlo4VjlrYXhQ?= =?utf-8?B?M2JsLzV5MGgxMHk0QXM5M3RyRjBRdTBqaFBhaEEvVmI5WjY4NG5oVTlPQnhT?= =?utf-8?B?K3c4TnFhN1dVekJ5ZEZNa1lFZVRUMmZWWUt1UCtOSGtEV0RhSDRwM2NRQ3dP?= =?utf-8?B?ZVBYOGVnT0lldEs4em1OT1V0WmJoRW1SWG94ZkVwQ1hDNldhamgyNEpnL0Zv?= =?utf-8?B?SlJRc0o1MEJaUEtGYVQvYVRIR2V6QmJVdlkwUlFkd2h1bkFwYWRUdm8vcUlO?= =?utf-8?B?TEY5OUpSRjdWR3A3YThmYVBxWEIrSjFuR0VhaFJhVHNOU1NvSmRTRXVra1pa?= =?utf-8?B?WWc3REt0TWtqcHcrNW01b252alRETXp2bXZ4R0Zxc0xXREhZZE1JUmVLa1oz?= =?utf-8?B?WU1BeFpFc1hYTDVPVGRETTFZN1lodGJkK3BnUUw2c29Ca3k5MUpRY3luRDNV?= =?utf-8?B?UWZIaEszK1hhWS82dUw1VWZTZXdmRXRLWlAyQ0NKT3p6aG02K3g1KzZXeFN6?= =?utf-8?B?Rm9ZWEEyZUVid0ZDSXU4TFRQa20vakpsd3Fra2hMVFBJWlk1Q2JJcVd4d0ZX?= =?utf-8?B?eFdNWFBWeU55R0pYUSsrU0Q4VGtSSDVsYTZQdzI3RzB0TTB6R202RHUyM2hT?= =?utf-8?B?M2J1ODRQSmZkV2NUZnRxV3hOdm9VeC9XTmFGQk5Wa3VGZHRxNWRDNm9rdTho?= =?utf-8?B?WjdJZFNBbnM4REFYbE9NZG9saENzL2NxZEs1L05FMklrSUlSMktCYlBPSVg1?= =?utf-8?B?SVBkVWV3d0FiSVl0ZGgxaDFUbVNFTThVaDQ2UmFKcmdhWE5vcmhEZkNmaXZE?= =?utf-8?B?MTNnMWIzQlhIbmRTdytxZWFWWVR4Q1lvOUphSTlJeHlKVlczdEhSWjZKZVlX?= =?utf-8?B?SHFWZ0t4aU1PR255YjlZNGdQTHFSK2JqbXVMelh6VjhiaHBmaHJXSk54VjRW?= =?utf-8?B?ekY0R3pITDVvOE16NGZDU1QrUVdGcnN1d1dIRnU4bVlOOE9CSHNjVGlRbWR6?= =?utf-8?B?Vk9qZjBhSmFTV21NUHJ6SWZEQXk5RXN1Unh1cnpNc0NrVFJuNHE5U3BHeHVN?= =?utf-8?B?MnFCT0FFYWN2YnB1T1JoNXlhekI5Um9zaCt3OHZaazVmSk9OOVVmZG4zT0Rw?= =?utf-8?B?bjBieFVWSHRxQVFuZmpES0l5ZitraVFhbHF0MUtTUksyOFBlbWN0WjlOMzIx?= =?utf-8?B?bHVnM1dYZnc2TWhaclNTd2RjOVNUTlNidEdPcDdJYUdWeTZJelJhYkIvTHdR?= =?utf-8?B?YjhudXI2NEpkMGtRSlZjMXlGd0NhVmJNWEhNem11bHhWdFFYd3A4THl1ajda?= =?utf-8?B?U0VOcE9SUStrVEZwNVJ3SWthbzRZTFlyejg5cTZlQk1ZYm52cUNjUzRFczhO?= =?utf-8?B?VlpuclBJS1A3U2JKVkhUTllGUVZRSU9TY3ZwaXo5aWVFbk1LWWRrVGtPNGRF?= =?utf-8?B?TUkzeGw1OHJiWENQclA3anFWUVV0Rm54UDNZQ1poYU05cFFGa3BaTHREcko3?= =?utf-8?Q?Wr804BAQUeGoGbWiGZracS339bSBWyA0gdL2R7/?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 866ab2d6-75e3-4296-2257-08d91b9ab400 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:30.9681 (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: DV1wP2xHSxyrOB7q1WxYOa2FxQC6yO0ayegFpW9AzDQF1NRE8A8LPYUhSQ0IZ686ejRz05AIFGlu2GBOINZycqcM3Cp9SZLGqGql3Iujyew= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-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) 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520876; cv=pass; d=zohomail.com; s=zohoarc; b=if89jpqMy8DXxQwY5Q1UFHSq8Y1LC9azOnyJWTcNYLLYLDbvqQIiqZPuWzD7lQxhla6/1PEpyyAmdxZmWrmJU/CPmH4JAR/861kRSxbiA24fVDCB/7chEual/Q0wgvsFEL4/WHtZgAuTAWfoCYmS4uObjGrRhO1zq05Yr52ZNOA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520876; 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=x+PPMW0bKxl0RZ1QpA8WjcYdMcmKpRY0dxrKJhQ2dW4=; b=cB71kFIUMFprSOJOjIgjiN/IwqoeHzdoZ+XW9edWX81D34dINW6oU37uCP+2oeI2JsHCNU77TItnacwwf73jCWjOZEV8vB0U6mG7pYS092dNfD8iDBAMCim+yahbgIV/GRC8ILJbsbjuntFqLekcB2GwpbRBgonce0/xnAW6HUk= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520876043468.77643295352345; Thu, 20 May 2021 07:27:56 -0700 (PDT) Received: from localhost ([::1]:55590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjeU-0007TE-W8 for importer@patchew.org; Thu, 20 May 2021 10:27:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZb-0005js-51; Thu, 20 May 2021 10:22:52 -0400 Received: from mail-vi1eur05on2114.outbound.protection.outlook.com ([40.107.21.114]:6785 helo=EUR05-VI1-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 1ljjZT-0005ev-76; Thu, 20 May 2021 10:22:50 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:32 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:32 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nm/8yhHbVZCCDrZAB+DcFazbBp3FpUJvoO+WNVM6jUFudugLtob/0gNStJ/9dM51X/u8rIMDdbTcGh+Q20Hap2UE5jcfYYG4IkD4AGyYZ8bn3NFOL8Yg1MmXaTsgPTcMDEX6cOWNjmMH2jezlVTOWnUOZccRuqO1FGZH+cMiDI2UP0nGZ0vGzuDePBxwBRCedBYuegmHRFzhzFs1/svwMbW/FB8xoBmmpx8fRc0TWckwmdUNoz2i3cBTcOrIGOsUuK7QEZjScji5grclWbfsWeM0l+BFr0M4EH7Y13bujjmlv1gJNHAwAc/J4VkXZT6tERGNBvTnKE9NjmF1mOv+KA== 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=x+PPMW0bKxl0RZ1QpA8WjcYdMcmKpRY0dxrKJhQ2dW4=; b=FA8Xb1+AgI/A+ERTMPlH7gRr0Ifh2Mim0axb7ZEWn5mzgQdIhk6yKL0POpOBeOjDmT8X0Q/GgfclUwi7wPV5/TL+dimaFQWQO2HSPVklodrxudxofHQ4VM+GwDcq2+LuGdlpSAIEjUxFH6X+qdXmoJEV4DQPR1SUXq249/h2EbcCEF+Rx4fiOjgrDIbis5M8J+geJs76RO34oSsW2qqQU7T4EIsiLJewrftLzIP3pdpTa0O8Qm2JjxvBG5q/azYCBx9WtJbZY0D7osYnGSVG1WW1qu5zUVjUWTJwfHpeNURl2PSSLq1qXsNon1gTn7QrX186+M20/m+IJFziDISHew== 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=x+PPMW0bKxl0RZ1QpA8WjcYdMcmKpRY0dxrKJhQ2dW4=; b=AmLChAlPysTw3m34jPFpFk1yQJPJ6+jSTalO3uKw7OPGb0vkm9FqMqZUYCIGR/fYdhwvp8Qr+zhpoREthaKsZtTm4eWx/QOwB0riqIndUcYktNLBpbZukQAEyOfSGotBjgbioPqlfQAkfPQ9T9Fnq744HmEVUnD0EjEKrIseCdA= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 07/33] block: rename backup-top to copy-before-write Date: Thu, 20 May 2021 17:21:39 +0300 Message-Id: <20210520142205.607501-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: a10161c6-95b3-4fda-09f0-08d91b9ab4d6 X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oHFB/VL+lP9ZmOxhHuP5ZEUtLuo0JLrvIi2Nqe9ooebX9TjexSRpb33wrRxDXcub/a5O5gjzTqeF5w1pZmI+SEZwO1Q7AWaXlpCxIK6r0sXzmKkUJylTM38hqidWkioRuVKfwfRtpcSza6/gq88w/r88Ti+6X9uzSCJo8CIoPkTOikJmKWSAPwv8BTrTc/RhZIlcNipOmZChuN6dIhGyC1daVBVypJ2UYhjtZhbZBqDxCeMEM/R/qh0dgB4pXQqggfMxWm6HMQVhjT0ut+TwB0/pnJ8xLjqA3FaNPHuYZ1IHdOu6V/jhpmtls5lElw3am9MFkVw74mNlT7rLzz8cAHink17lwYObczppoFjuZRlZQTyThfgIN5/rHHZdvkYCFcmRji89X7YC148ycNUMRfUr+svZ9FOYHWRVZEhFYMJg4AyfhZV6tfvE3KFEqfNDvgzC9Tixwtb0mZhWYR/3IXg5VyGiQ98nNqNKKZHvST3JMymWD6Zsmevp5hYvXrMX6BNOU33cUwq1quDb8rQuG9fkXkGQJe3EkMDGa/5niqyuEYk5X08+B6BmluhO3bzjRNhIlLXDie85gT9cRKLwc65330yIy9Ewe+ZGvdGUE8GnMoDOeKPOIevzQipvhUsVIUgk6wUu/qfleHa8Atfea4NgXf2Phno7bXf/Lch1I6WmcZ0DOmcXnvKkpKFeOBNKblK3qHKmAE3gjysQAMqqHMVgUpPPGEFS8aytZd2rRTVJ44cfLEqq7eKzWkS1eUOMwIIrSoUGZPEUuwnIZqk0Rg== 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(30864003)(36756003)(83380400001)(107886003)(8676002)(186003)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?bnZJcjMrUHpaQ3NzRHMvNDdvVUpXVlFtY2xISDYzZ2l0aHR4N3ZLOERyMW8w?= =?utf-8?B?QVZVTEh6K1dyTnFPUGpWNVUzNmRjblRRRkJETFNLazVHNVNsNjlRUTAydVpr?= =?utf-8?B?dmdCeDNRd1EzaElla3VGbUNpT2RiR2h2VWlkaGFYSW1iSmQ3NXZmRnFidnhl?= =?utf-8?B?dzRwTkpMaXRvRCtrNVpHdU4xWHpZaHFkVnlQWjA3ZGk0RFBPSWhVSDAxU1NC?= =?utf-8?B?YVVvQnlJdlRXOGhKOVJHOGJKaWdLSWtDbUFqNzdXNjlrRjNVOWs4ZDNmM2xx?= =?utf-8?B?N1pZYVBITERoYmsyeWU2VWpZdWx0dUxnYnhHZkU1MnNRSVJsWDdydzZ1OGFC?= =?utf-8?B?L1NGbUJGdGJSc2xPbGZoNUhJMXZjN3JVOUVkR0J2dGp0dklBTDVJN0lVc2d6?= =?utf-8?B?K3Qxc3BjZ3FYOGUvRDd3RThJM05ndVNJY2FMZU9vdGdubWdGOGhUSGtIT0Uv?= =?utf-8?B?dHA2MWE2T2d6UXpGWEpMSWtzbXMraFVIUzI0WUF0dUxSSWNVdFRlMnY1S25N?= =?utf-8?B?ekI3KzhvZjNNSnBuejZ6R0ZlV2RqT3VGdHI3OFlFMEFTTVY3SUMxdi81ejZX?= =?utf-8?B?YTY0L3ZoRjhXQ1IySVMxTHNyR2daVUZCeUJCY1JjK1V0YmVNRS92U0VSTkg1?= =?utf-8?B?UnRsVmNhMVNlQW9maDk2MDI3NEZTOC90bTBtOTUyV1YzbVdBbXBZNEhhcnBY?= =?utf-8?B?V0JHeGMyQ3JjS2orVDgzZlpXRyt5TlNGeDA2Z0xleStVeFpxNHhoOFFMSHd5?= =?utf-8?B?WWw0VXJRMFl0UVNVVDdUTmVhcitPcno4MEZidGgzL2VrcnREbVFvNFdLQllJ?= =?utf-8?B?UDlRL0d2MjR4MnFyWjgwS1pOU1VPcWZxaE16TWlYMXFJbDE4U1RhaUczU3JQ?= =?utf-8?B?YUFoTUxKNHhBZEtyTmtrRlVCbEtCaHd3U1BTanp0d2V3MXo3T0hUQzdTamhO?= =?utf-8?B?VjQyQUZmN0VCRi9SSEtTcU1XNm9nUTAvdHVFbTlDekhoQmFacEhhMzdNMGdx?= =?utf-8?B?THA1clY5SWRkL3FRbCtjS0NmUUwwTFpJdHhVelIveWlZWnVOYzByZTc1NlpI?= =?utf-8?B?L3UyZ3lvMkxGdlhWQi95VElNV0tFaEI5RG1qM1NyZk1JWGgxRGhBSzdJQTYr?= =?utf-8?B?TTFqY1lIZkVGZ2ZKd01WL2t5bzlwN3hNVXpJbTJqNzU0aW1qQisxWGdUQXNF?= =?utf-8?B?TUJTVVJmTFVmWkZNMzZJai9KaStzWkswV3ZzYWlCL2hRQnd1SWp0MGM0ZlYy?= =?utf-8?B?TEdQdVdZVjJMblc0Rkt6Zmh1dyttWDhlL2FrelR2ZGFvTVZtSGNLMWVTZWNL?= =?utf-8?B?WjlVR3YreUE2ZjBjUFA5TFk4Q3Z0b1pZZzh3ck5GT2JXT2MycDY5dFhvMDZO?= =?utf-8?B?NTNveGhNM1VucVhTaFE3TVVpWWwzMWE2RjM5RmhWeWVidTlEbmxka0Z4UVpa?= =?utf-8?B?blRYZVpZSmlhdmU4Qm9NdXZHRmMvenF0dnNuNHlZZVNhSXRBdW1xNU5zUmNu?= =?utf-8?B?SEc3OVBmNWdGQ0xaN2FGMTZjRzFHb3dPU1Z4MWE2eVUyY1dXWTJmRXhGb0Ni?= =?utf-8?B?VEpsdlFDVDNGTk9nTDg4cFBrNjZIem9VbElnN3pHTHE1OTdHbkVlMUZKcFMr?= =?utf-8?B?dGZFZnV1aExkcGdvRnZua0RMUC9ESFUzbndOalV4RG1jbkIrZ1dlZ1dKUDlD?= =?utf-8?B?a202cndwVmRNMkFKWk82SkRlMjZGTjd2WGJoNU1CdENlem5LV3pKakpkOXBR?= =?utf-8?Q?mwawUcWYsKTQPHjELCbD1BSqXX4k6FmG9Yl9n3S?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a10161c6-95b3-4fda-09f0-08d91b9ab4d6 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:32.4795 (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: hOnMkReecLETnPkXvYkiyCJ4hdHAwmCOgSZqR6GdiVSyc0xJAOlU4BiFB2W0fkiPxtuxx/9r4q2Ns56ZVKfXfZmDp3dpgygOmK4kpm53Qh4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 eab178aeee..bc59f8bfcf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2281,8 +2281,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 e687c54dbc..6e27aa9624 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 97e62a4c94..e08f807dab 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: Conflicts with use by source as 'image', which does not allow 'write' o= n base"}} +{"error": {"class": "GenericError", "desc": "Cannot append copy-before-wri= te filter: Conflicts with use by source as 'image', which does not allow 'w= rite' on base"}} =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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521070; cv=pass; d=zohomail.com; s=zohoarc; b=OATCIxkhjImXk5q+gBEAfntanuGZj1KP7pjoMGkrFqpH8GwA+FjcpN+Mx2iCP2Ztc+2LGQEbESi6xghkmZFqBELx4W2vB5mck7Q8ejvZy6NuXF5q57AzGYhLcWVgn/iZnPM7Wl0QTWWu2mN9yDxKJ7k9aw6lUVnI8wkSjedQlFE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521070; 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=Y4//p5N7ll/vHhmjY/CjreDZ/cNRAI1XT2jMBOZoiJY=; b=NTU+1OrSh5X/SwgrFg1mMegWupQR42OEsArU9qBaIk9MyKrQ2fVPe9jMd7XtL593O4gx4ZuwEZTQD3hNPV/5tinkJkQpSO/YKo8DAI1Lq/0tCWUja7ZxnDftMo6qBJXodTxCH01mMIqfv6n7X68SdqABIBv/xqoDA7HgCW5S8Mw= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521070410694.4579267440881; Thu, 20 May 2021 07:31:10 -0700 (PDT) Received: from localhost ([::1]:38240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjhd-0006Wf-69 for importer@patchew.org; Thu, 20 May 2021 10:31:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZm-0005qQ-RA; Thu, 20 May 2021 10:23:04 -0400 Received: from mail-vi1eur05on2115.outbound.protection.outlook.com ([40.107.21.115]:23648 helo=EUR05-VI1-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 1ljjZV-0005Yx-Q7; Thu, 20 May 2021 10:23:01 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:22:34 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:33 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GIHM9sUa+WBLDw97EM1yUTELVuDnRSzFlgW606hPizuSypDsQK418JskeP7DEMtEHZiEKnHsplk4bQaeWsNeHxAtkLMskCbM1wCzaDV8TRB6I1x8BqnqR4hLtxoqECMgeQUKQUa1i7xDsMP5hSv7GU5zNBXxTs1y2FbqysgmpPHBusGS2s/iTiL1GMSN5QRKIZMTG/XPn/8+Ab9BFU7mao+2/kJ2drKIlAwE/osjTZOq+0yJL+WkCDUtBnHqwDA+Gh5t8RNLngNJtwtozv5YNN+Bd8u1yE0Rw/ut3Bv2VRUvzk3sibs7BkilLRvJxukx8m/0BQmRsMZn3mit9yRKug== 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=Y4//p5N7ll/vHhmjY/CjreDZ/cNRAI1XT2jMBOZoiJY=; b=AMazi/dMCkvGbdAqt55Skx558alnZBmY1Rrqrl1drkadBUWeJ5XVdpG4rJqLThIrglC5ADHtOQfseEPA87R/7ORsGKOA0pJmaDbAmEUjFYxN4oYYmKQfwg6FsFBR+wV7uLO/o7UYJkaKTIBCE+/ZzZnf47IjNDYA79Xy4iUZhPCDWUVyZ1ig3mXIxXgKzfLwZM+gpEhkcEnxn2OkxVoldEg0UbfjW6nl5Z5L6ooGggwME96pGbgPiXwfQ28n2+jEFRYJg81+TWKUfungl7eHORisAsRTepaazYT47wnsBs4r82AEufn0ow03n05xaroRknJ/+QxkfvPqez18mMkz8Q== 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=Y4//p5N7ll/vHhmjY/CjreDZ/cNRAI1XT2jMBOZoiJY=; b=NuGamOgtbusweOzFB+rnouFYpWbIl+cFSrM9ZYyI/2i8t3pvfA9Nx7zCTPAv5ICSZyroTNx2pMy/A3bMyOq61PAi5lnu2NIIGdiPIAlYFbnQ/NXd5Ps2N5wmBaymEIuJZLvi7qqLAku3QQP/djunn0eShEc8j0Hj1IbUU7LERms= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 08/33] block/backup: drop support for copy_range Date: Thu, 20 May 2021 17:21:40 +0300 Message-Id: <20210520142205.607501-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 516be566-65ce-4fcd-a7b5-08d91b9ab5bc X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZgIz3D/DhtfwMS68gdOm6J6pmCezRWD4YfpeRJ73/6spWu6YKCCV4DU8gCs0AUpcM5Bcwm4jcbUC9Tai3JfbPPuzSebwYYSj++9rqySCa7QsdUbsuDif03ja6kwux30U40aqgh5nuyzRuB/q4GEzj24qHCIIuiglqGvYKPYspuUPLrmz3NxG+VwhFLQcVdKQ+CN93yPSMFigvl60Apx+sIrXi+stQSNiPS2eJFhzZK1yiMtuO2vfQFL117D/6dxq8XarY93QjbmkX5IiIvcmDn7LeU8ezh3SQJ8XISDK/WrjrG7ZFgse7tmp0vjLksYesVkU2Y0pFuhRimX3VVYk0V9vBShDwnT0APG//b+ybEq6LF8jowtK76xfGCY2UOssCCnHTuPTv/L26jHvNbQNeFNZ7QlRMUYSeYk5IC3F9kR1GPOSGNfRgQu85GsPbl0pK6SdN7UiSCpgkfvPwL3vZgIVIK6aTIEFPSIXp8jRsefq3yNGxWzLS83fhTCOgY4vy3dcO2R0+HVJgDMewP2EQV1Z35ofA+LBW9/HFNXGM4B5s/Kv2Mmaq4npEH7qxDilo5BRl8PgrzeBgWRkPBT1MJiNFsYnmqWOh8TDFqaNksnoX7H2+f6NIV0Jdhx7UZgQ9RYfIyR2T6phoeKjhrHqHHoUvmi4dFXur+wtHHCi4cYp/2FDXEgPnUfjs+6BumWJ 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)(136003)(39840400004)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(107886003)(8676002)(186003)(6666004)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?X1dAgxrOT/qw1mE15MKHul5mmWWGo7bj1YM+yK2VXz1NxfLGPF4uFL5uOLJt?= =?us-ascii?Q?8sp4X+37DrBWV7RwgTGar1yN7Sj2tJdo0cCnWFiSWPlGIm3Epi8DJdJewg5z?= =?us-ascii?Q?DRh8VF0Tu39FBMT6lmOhrINBYcpg6tBWfK82r4o58dTYIVFUeP0w4U3Aj3iz?= =?us-ascii?Q?j5oZXjNtGc/uJOw+QzK5pRXHkJIxXH9t1gO4gzvfDyaXR1vqNmYGeQxVk/K3?= =?us-ascii?Q?OU4z88RpIgFc3/Fjv+//FQ6K/eMa5jEWbL7Ve4B7xcvnufGtnSaQ8lYtbDxE?= =?us-ascii?Q?Tu1+XI3KtR+EEGq9pV3VMYhQ8igl/qrIrXcxIOc55tlSu1PckTFAKJtwywjX?= =?us-ascii?Q?NlCW6nA7DtifmNssa5zy3JhMS2JvWYeArhZ7tq+axecZt/IyJtPHb7/N93El?= =?us-ascii?Q?ANDzxzeneH4Isf+aTCZRfRPaIFBD2rDnF/77JEAiDh1vP/nWwaUlDJN3LPAR?= =?us-ascii?Q?1XTVcRVhnRz+2VNsbpfJYf+UGuUbo6GuWmQXY8bi5IjVq1eeZBDTZzrxaL8y?= =?us-ascii?Q?Onpq7aj8i+EeugpTKf6Mu8ZWpv5Idz0YA+PjFgeToIINtoLB4ofj/1yRytgQ?= =?us-ascii?Q?kWEIOYIyX/cTPmWFbbGypa19Ml9K9FVKF+Jx61pLUyE/D9NXnt3oQnHMRjS0?= =?us-ascii?Q?12feHAg5HnbUWToc6I+OuznLvSb/CuRs1B6GpqgPAcWFvcbV4Ae0+5wpV4b0?= =?us-ascii?Q?Hw1M8XwL66W8MJhvrVZah3V2lpNZojndbC9bHbRzz+XnYIyt4i/wykUKTlYR?= =?us-ascii?Q?jIqpVQLWxoKQy7iMJJEpRenwf1sZqmjQ/KVZ4nT6wXy1Eqmsbpotnehb7g9U?= =?us-ascii?Q?uVDFKgNzhNLb+sDgcsp3MzjU4vo+cHsOMCkhhcs7a93UdWRkNw5+TL7VnMRc?= =?us-ascii?Q?9zNeLFiGMWNFtc7kg44xji7CGJxsvQJak/VqCwMW2mF+TDZK0Ag59BotTc2m?= =?us-ascii?Q?w8JHioo/FgQcXWzejfb/ErzsN+TcHn4Ikk0DkNVFinJqihU0AsuLshui8uUx?= =?us-ascii?Q?8H4eXQadmHh9t+ZhBA9hceUEfO+R9kdq2joD0A26SUUr7R36FP8XBdImiBo3?= =?us-ascii?Q?HNuJ0hhJfJzFes/8JildanZgQz8h1P+CXpqzq1ZS3DkNmhsR+jpnha30GFj3?= =?us-ascii?Q?kOjDIteHr8jfbiMiKQUX0SBInh+0lRNIEHZKiIfuZCAGpbXrEJJ8D8OG+FSy?= =?us-ascii?Q?M4/WuSYGKxOmYiE+nZ8sieyxELioHz6wmEKyPoZ6/3lfEst3M0GBCeVinagx?= =?us-ascii?Q?SXtMYq89L0r+3rBXoHPO8Rx4DeZclcxTa98uQO1Hp0LAN1Z4u7WZSsdYzlQv?= =?us-ascii?Q?Ceh+Q/MsMN/GGakDDzoDqI+u?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 516be566-65ce-4fcd-a7b5-08d91b9ab5bc X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:33.8734 (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: +j38BSq2kv+n//1ZZSgF6V5iLMsG2UQE1Qfgt8pUXYrRv/pBLAmLok3mtadUEh4rX8k42u4J9VScUwj/CiPw85naiQBX8ZTErJ2rNozI5Go= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-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=unavailable 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) Content-Type: text/plain; charset="utf-8" copy_range is not a default behavior since 6a30f663d4c0b3c, and it's now available only though x-perf experimantal argument, so it's OK to drop it. Even when backup is used to copy disk to same filesystem, and filesystem supports zero-copy copy_range, copy_range is probably not what we want for backup: backup has good property of making a copy of active disk, with no impact to active disk itself (unlike creating a snapshot). And if copy_range instead of copying data adds fs-level references, and on next guest write COW operation occurs, it's seems most possible, that new block will be allocated for original vm disk, not for backup disk. Thus, fragmentation of original disk will increase. We can simply add support back on demand. Now we want to publish copy-before-write filter, and instead of thinking how to pass use-copy-range argument to block-copy (create x-block-copy parameter for new public filter driver, or may be set it by hand after filter node creation?), instead of this let's just drop copy-range support in backup for now. After this patch copy-range support in block-copy becomes unused. Let's keep it for a while, it won't hurt: 1. If there would be request for supporting copy_range in backup (and/or in a new public copy-before-write filter), it will be easy to satisfy it. 2. Probably, qemu-img convert will reuse block-copy, and qemu-img has option to enable copy-range. qemu-img convert is not a backup, and copy_range may be more reasonable for some cases in context of qemu-img convert. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.h | 1 - block/backup.c | 3 +-- block/copy-before-write.c | 4 +--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index 5977b7aa31..e284dfb6a7 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, BdrvRequestFlags write_flags, BlockCopyState **bcs, Error **errp); diff --git a/block/backup.c b/block/backup.c index ac91821b08..d41dd30e25 100644 --- a/block/backup.c +++ b/block/backup.c @@ -522,8 +522,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDr= iverState *bs, (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), =20 cbw =3D bdrv_cbw_append(bs, target, filter_node_name, - cluster_size, perf, - write_flags, &bcs, errp); + cluster_size, write_flags, &bcs, errp); if (!cbw) { goto error; } diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 0dc5a107cf..bc795adb87 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, BdrvRequestFlags write_flags, 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, - write_flags, errp); + cluster_size, false, write_flags, er= rp); if (!state->bcs) { error_prepend(errp, "Cannot create block-copy-state: "); goto fail; --=20 2.29.2 From nobody Thu Nov 14 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520900; cv=pass; d=zohomail.com; s=zohoarc; b=OmkulT2b45ZljxtWFjIN6XplnbVtr3keaSgAvqczmepYCl1rDl1eNS1OfbRVIiE4JjjQ0Znt1At2alxk1BPK8QlRRMYvuv6VFBwyIXsK+H77SPY5H0wlgYKrcZxiAm8gVZvcxQflEcT1CGdjm4dviVjL2VXILOWvVcikpqwMqio= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520900; 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=sxT6FWcotG79jD05nMEM7Td+0QQE4Du0GrafUXopPTc=; b=YaIlEXMjrgs9U6wbi2E1Irta7vDuwdROvkhE8wjkDieOH23nXkqBzUR2HPfL/akdQCYvr5KVWvsdp8qevLWDLZ1UT5d2b71E0exIads0R1ksRLHS+yIajTieVJsXiYCP4IvNaF9mn7YH0bvZMwemtFlOssB2lBbxg9ESv57j0DQ= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520900878337.11926461223163; Thu, 20 May 2021 07:28:20 -0700 (PDT) Received: from localhost ([::1]:57320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjet-0000Bw-MX for importer@patchew.org; Thu, 20 May 2021 10:28:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZd-0005kL-1s; Thu, 20 May 2021 10:22:54 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljjZV-0005ij-O4; Thu, 20 May 2021 10:22:52 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:35 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:35 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nQ0xueFitIevNgg78/X/Y2jd2/Ntndy9ndxen5kODTXBYT5yrclMcv+XfN5E+pZ4FqcylIfxEyE/661Ks2Az/hyShqRCa0q9VrjuovLPe8PH5F6ro5ArM1ZFVTfOBjjbHhcxzW5ESDkgreybMf0g1640nhSHD0Lg+w6CXBssB5JUwUrF1iZWZ2S6/tEbFp38cRMITTj1MfotXaDiTDy6EAG4xItQGppPGJdbM0WbMFGAwzZli2VCkrpw5H3m9EYbSTltv6vhpNH2F6oVTRtdzHDgWtExozbGt6jd8PiqvNW5/+7N8+1UaIQT6uZk8DNIP2XvkFQQ3jZMJe12iRgP1Q== 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=sxT6FWcotG79jD05nMEM7Td+0QQE4Du0GrafUXopPTc=; b=mXnKPmgcxIp6BcOGa8qlRGgtF7c1HeiBA3JouwNoQ0xwjbnrbgZwE8IoBtlIdw02KzhoGyL16xWlE4O7IT2DrN4pD8v0HsYvaXE8N538srOU0Cag7DSECmPb6rX7/mceR7BaWjszDr6e3l0Ch6eU6SwFDh2nGSMqVFhDXaPgfYIQz48rci2MXP4U0Xo9DMcQ6KLW2l4iHG7bm1VJjRe0ct5GUIlXBdV9cBBzsrkxV6BbAhvu/EK14mnqHdkIOSbSk3bVr1cBq0wyuyO78egr9gf9/MyRKiqm6+ilvewdayasyAkA/k/NM8bHVMR29SaIs1rh/q3w/k4mBSuVGCBxUw== 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=sxT6FWcotG79jD05nMEM7Td+0QQE4Du0GrafUXopPTc=; b=MQEk8SUufXCT0k6qlZAjmZURSlBrkxq2aNXnHAjPwTRm7hL1T2bT9YoqgFyNnOoj/+f+gjmhQzURmWtfRmYefW+AOS6OPsJ5Rn6jU1j7bp4gC4+oJ9EdmT4Ramfsu6vu+i4dcFyTOdIigyCDFFg5zu+0+YkU/Am275GjG6qpRX8= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 09/33] block-copy: always set BDRV_REQ_SERIALISING flag Date: Thu, 20 May 2021 17:21:41 +0300 Message-Id: <20210520142205.607501-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 8cdedccf-a83c-4eee-7f1a-08d91b9ab691 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MktdVsnGj5CX2Met4QTo66WVBurvcJ8D0Zqte4rqLVNhdl9mrxdpemD2ojVCQq7nPao4pxKZT3145emE8DEcWx4y6xW9gmPUWgBq4xW+cuGUr8fgx4WjV9dGAPU+TnnuH98rsrF7oqVoF/nyumfHYPsPk79fRXNclK4o7eszDuRPas+YtWseJcU7nLwFjrkSQTt55B/y1LIaOO2itOYgzl35dMIEBg1EeWpdZexMz1OlqqIcS8cM4y/RIkQozdI3d31mt1wMHMNOZwP1cnKsr7fKBI+LVzUpmxV94U+Z5Zw+056ygrbbNX/ujLh4ogSpB+7loXXMVcCTWWofvSDG8DKe3qKOb5qDr3WD9RKBXkohd+qr7Ln5zPVmCYNnD7qSw7Z22zCOcDrNNOK9fUJb+zBPhTldDIYJ8elbP9vfpVl1w0eYMqc1JeQlGOqqx/1AKPMEf+ogOsZTkd9+WnzX2V13/FBB/x9XqnNf2hpsY7osbxAMagDiTpytKklSd5xMym/OTK/qYbrVrioV21dNPUMazTjv+ZgclT6ImOSlWz/OEd8PKMAeWO0terYDT5f7eJzfGMUvZhLSSda/K3pUFl0MGardwD9IxJZrxEE/RbwD0nhdN8ZNDTgmkqpVQqNxeVBHi0Nr5vBtqFgglVRCxl/FyowFEw9R8IpowYxydKL4R4jsgRIQT3gGni3R7ZX1 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?QRUDt3xvW71iQBHHBbwd3vOB4yQJd8EP9UdPzHoen7h4k55t9NVgaChvrYRn?= =?us-ascii?Q?zXkMqQfH5OiSJIsxWNKMP9WKk+Y8jqqj1tRFoNLf+pHI+GiJFABD3DU3+dW+?= =?us-ascii?Q?P9KvZTQbrp+P3RaxHP9sG4TObPKL2tuihKRe9h4+5V12pImsmqDGMfvRMliT?= =?us-ascii?Q?P9kXqfxj1HOsSTOz6QH5sZb+EaoOkhgyH+r07OySYGI9Mdrg2rBpxuxbNDgg?= =?us-ascii?Q?rE0E6iz8rjeQjH+PXvhHxXtNbk7pH8OFuyms4H+6SEcbucUyvJuHh9F0k3x6?= =?us-ascii?Q?3+xQdYox4rP5e7h4GBF2osZe3cdVhodUC7qL+4fEXnqhUXETh1P1/7nk+c3Y?= =?us-ascii?Q?EQb9l8H2sl38omfay1rY7fHiWdp1cDawkP4okTq1r8d4vSifajTXF8Sn37PJ?= =?us-ascii?Q?8zePyY+6d9wbVrTvJtvchMVHgj4zDE4zv9Ko4e6iWpRiAhEy+D8mIdFRS8ps?= =?us-ascii?Q?EfgY3ZIl1x7N+zZLQtOX071wft4ZvIwVoJEqHKVxIhYyUWhuWxvyl9ql6yRM?= =?us-ascii?Q?C3fh5FwNLNXCGg7QQXK5jeW19Tse02cuFrVsRR02NX/rQtbAiHgWPDX5TDCx?= =?us-ascii?Q?RkQ1o2uTQlKg53BO3HpRLanTHWeHqzT9d2bkSnIM0uWREnP7GpzHBDCDo5+/?= =?us-ascii?Q?S4o/4sKu8CEvYsuuxQJPAZoko/Z6lwfcI0kzBzKInpP8fQSqjZiowmR90rf4?= =?us-ascii?Q?SZFaxCEwyGyIbaKo67OAwzVR8AenpFRaVQ4XVsvzX83Y/7FjS6laDEykMdnq?= =?us-ascii?Q?6hPsfwhBn8mmzbc8SbK4G2O6YBxLHnW60A29eer0CiU24P72PmIkeYEYaXjy?= =?us-ascii?Q?/YjBLYjCouqtc5ukV2/M2D2R6/G9xaYu+TSF3qvHQhtI5z0ABV3KSNd/X9at?= =?us-ascii?Q?FDfsj5bcgtbAoDkPiGT8tKuKDW22c7ezIU7OQoSsVO6TU9PCr6WdqzZAQbd2?= =?us-ascii?Q?QvhjcBlNB8YZy7zLrBFDolqrL+6BrZ5hadz0XtJMJRkI/dpXO9Dpdu7sdNc9?= =?us-ascii?Q?lqfFX3wdX9T2ZjfVP3fkYzuohFQaepRqYoyCE8s6dKEm+CvbZsJRaBWJoq0c?= =?us-ascii?Q?2rSIMPjmsMTtRyNPf1XJrQkOAJF3wnOQbZGof+Eg55/he1xtvMy6P3ESlkAe?= =?us-ascii?Q?h/oKTyhaaOxfauJZKwbMo7/OSZ7oKXo/i6Nfw8fblxnTgkH8MSTgAnxevUyQ?= =?us-ascii?Q?TZ3pwBb5Rg9X7bN+LTFRq5PFGdoXmhIwQMUhCScGqhJuhEYn2tdW6GcV9rsL?= =?us-ascii?Q?Clt1r4wiR5eaY7O8TsYTkw8dJhLW7VIwGG1/t/KsBG+HMvZquyLEWsLxJ/ul?= =?us-ascii?Q?rEi3VoVYLsWHvmYbtoIty0OW?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cdedccf-a83c-4eee-7f1a-08d91b9ab691 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:35.3130 (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: i44tIXvEVMKymDO4dMunpI0F1auLzk1vdB0ZyZpMevOehWGxZ5uQ/C0KCbQUw7AfccV6iiGmj3VsC3daHGPT/z1f+AwHtpBnCg9CqhnW4Co= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) Content-Type: text/plain; charset="utf-8" It won't hurt in common case, so let's not bother with detecting image fleecing. Also, we want to simplify initialization interface of copy-before-write filter as we are going to make it public. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.h | 2 +- include/block/block-copy.h | 3 +-- block/backup.c | 20 +------------------- block/block-copy.c | 29 ++++++++++++++++++++++++++--- block/copy-before-write.c | 4 ++-- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index e284dfb6a7..538aab8bdb 100644 --- a/block/copy-before-write.h +++ b/block/copy-before-write.h @@ -33,7 +33,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sourc= e, BlockDriverState *target, const char *filter_node_name, uint64_t cluster_size, - 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 338f2ea7fd..c013a20e1e 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -24,8 +24,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 d41dd30e25..29db3a0ef6 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,25 +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, write_flags, &bcs, errp); + cluster_size, compress, &bcs, errp); if (!cbw) { goto error; } diff --git a/block/block-copy.c b/block/block-copy.c index 9b4af00614..daa1a2bf9f 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -245,7 +245,7 @@ static uint32_t block_copy_max_transfer(BdrvChild *sour= ce, 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; @@ -257,6 +257,28 @@ BlockCopyState *block_copy_state_new(BdrvChild *source= , BdrvChild *target, } bdrv_disable_dirty_bitmap(copy_bitmap); =20 + /* + * Why we always set BDRV_REQ_SERIALISING write flag: + * + * Assume source is in backing chain of target assume that target is g= oing + * to be used for "image fleecing", i.e. it should represent a kind of + * snapshot of source at backup-start point in time. And target is goi= ng to + * be read 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 + * + * Other cases? The only known reasonable case is "just copy to target= , and + * target is not used for something else". In this case BDRV_REQ_SERIA= LISING + * change nothing, so let's not bother with detecting the "image fleec= ing" + * case and enabling BDRV_REQ_SERIALISING only for it. + */ + s =3D g_new(BlockCopyState, 1); *s =3D (BlockCopyState) { .source =3D source, @@ -264,7 +286,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 BDRV_REQ_SERIALISING | + (compress ? BDRV_REQ_WRITE_COMPRESSED : 0), .mem =3D shres_create(BLOCK_COPY_MAX_MEM), }; =20 @@ -277,7 +300,7 @@ BlockCopyState *block_copy_state_new(BdrvChild *source,= BdrvChild *target, */ s->use_copy_range =3D false; s->copy_size =3D cluster_size; - } else if (write_flags & BDRV_REQ_WRITE_COMPRESSED) { + } else if (compress) { /* Compression supports only cluster-size writes and no copy-range= . */ s->use_copy_range =3D false; s->copy_size =3D cluster_size; diff --git a/block/copy-before-write.c b/block/copy-before-write.c index bc795adb87..235251a640 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -170,7 +170,7 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *sou= rce, BlockDriverState *target, const char *filter_node_name, uint64_t cluster_size, - BdrvRequestFlags write_flags, + bool compress, BlockCopyState **bcs, Error **errp) { @@ -216,7 +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, false, write_flags, er= rp); + 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520733; cv=pass; d=zohomail.com; s=zohoarc; b=iRMOp2cmMOBUGuO/yi4jrsSgNbGKGJWBFm+6AhfRKMd5FeX+yV/N+rkBnX//RQ3A565ug0x7KXsyv8KFFjgSR6akjhFjiZc7D7cC+e6AElw/93i/ha0EmT4V0XWyG6QM/9IuFg1+dqiYTtSI8ZgrX6tyWLXWaGXs6zmtu1uPQlY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520733; 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=ag6HkjN4ZORgbMSu/sVXWoLoxMRBtbVFZ1425eoP0wY=; b=Q+IhFJYD46WCmmLIPrdmx+yLrD4MO0afrUoTq5r4X+BqbQFK2lz8zhGEXNGjfRIEPsX3lplUTjrMj4+mHgDNNB4m4aWeyT+c4A+WLHgrfkzzV4Pqq8c0z1y3KF1fWrcXFNChdB8lAfsMfHNZB9Bt9E6ztmmZrNrgTLwWN2bCkNs= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520733088716.9103136089573; Thu, 20 May 2021 07:25:33 -0700 (PDT) Received: from localhost ([::1]:47404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjcB-0001jn-Qe for importer@patchew.org; Thu, 20 May 2021 10:25:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZe-0005ln-D7; Thu, 20 May 2021 10:22:54 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZV-0005ik-Ne; Thu, 20 May 2021 10:22:54 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:36 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:36 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ThCfbzf6wlAoVFG1ADQs87SX+Qa12tgqKgDXTEemoBOnqGsAeboygsLPSjzAskE7J5153TwGSLkyL4MZZp1yHfVUKnS/SXKQdBYWtVH1cq6p2afW8NQP0lTBm+UkALBa6GoB3XXZVwZFrlPnf0OrkRAKCXqoJYkGv4Ytj1g1AAnCYzWdEfJd9LshpSUWyuCo1USGDF9bwU+05OvyAZT0fihf9TwAtBr8P/QRwDaKw2WePU8LJrh8sZBDbtOGCOPDEgngCfp+IRr0yTxqqFafSymtDEeD2qeWKpeBFrREvjwHs7HS4V2d8pgNzCJ0kv/pjfjCeJ7KOt1fvMWS0fLRtQ== 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=ag6HkjN4ZORgbMSu/sVXWoLoxMRBtbVFZ1425eoP0wY=; b=BkKwWxg0uBd+R9Qp5oTEecFy3vSX/AZcAO5o3No+0OVMpTpPguzE24gnAFVlWf9ArXTxTCp8+GcnCj/EliaMA+DjR/bZhskdXeKLuhqlqadTPY8OA7rvDLVB+R/jbsXh6O35mZyj7xwcE9HvXJyjG2BjQDCR8Zt2W2x04utfjrUTvP7sCGl1SJ65P+QB9QrGVj31bdcW8nAX1iag5mE1Z1LIqj+s4XV/Es1Q3pO+OQPPgWUTioE8P3n1ty5GCk6JeFTh+sgkcJjmQk+gsB/SgYoxyRQDhkNivOxHzON8LU1gWOLw79QBkaZueFc/Bxiyj86LBxygHNCUVy0viKpsJg== 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=ag6HkjN4ZORgbMSu/sVXWoLoxMRBtbVFZ1425eoP0wY=; b=YQzv2cjfgqCx6AZVI641FDnTo9T3p+xzYDgpqAPxyndE9kBzXZhrXcBOs13iLy77e3BCg/Y0UDIc/NI9boboEyIpkY353zdwzIYrKDVl2WBWVls6hzz0nkVlOwYKokXamVegDJAPoRAB7Vr7Hn72+fJJHA6oXN9TGoza1GliU5c= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 10/33] block/backup: move cluster size calculation to block-copy Date: Thu, 20 May 2021 17:21:42 +0300 Message-Id: <20210520142205.607501-11-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: cdb14322-c59d-4efe-c1c2-08d91b9ab76f X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:88; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +Fl5TZVf7HUT+5GRt7Qdi91uvaCgmEnWxA3UdYeOrrGVzyb9LtnrK5DLhfWoC6f0MvYZMgcBr+Nde+02w6+CUpr7H5HAo/g21zf9k20PgqSHj+Jx31tvi66IDcpMFmS+afrKrOGWKgpzWAaL7RkzZgosRxOMcG4xyJwnIAju28DbdMSlGIEGY6l8Res+wS3G0VaVrY8cU95pgWscAEYgjT/w/FrjEIx11axe6de0lRn3EcLZtCcroIZYI4Jt8rhy0guYi/maqS+j1NS+7wotz90NMAfyHK0jY/Q8Qk241wJcsrlQi2ZRhwsN2V85LfsHWA41j4zVwesZTMGG4A9Myk70l2Rhg75ySRuPtyngOqytWKUCVtYVUB3+MLWvc/yYomLbUnzqtBiRybJz+9ev7yOYAuPYn8YMBZOYfj82hOBjpi4eGamiotWXPzmB5FoxO9vlTUAo3NkMb5RQgnMb5YWimjqi1cATTXW5W/9wB97hS3jBrqa7pgJc3pC4RR40r6QAIJmhWqzdAvCY5auqbFg5gVYGmkYorP3bvtjSB1i8JhIHXKi/+RRJaEO3V4IdV74GN3OdWO3/CajCQsK5jbxEepnGGWpwMsI7fQtCP7tBR7gVptTX6TBt5T/0EoLabCID8sbFuFP9ERsrWzyVP5rmumTgQEQDGr8tx25j5e2TVFwB60RlSYoSBx4WpYSg 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?ROIoQS+Wt02CQSyJucB4sUGHNuTZjcSLbkpuSIJBizLP3jTbQ69uxWOGDGsv?= =?us-ascii?Q?Gf2QRAHS3ld5Sn4jW1bD+vlmG7D4lwj5hTXaWylny/fBflWOr4thI+wd3N/X?= =?us-ascii?Q?d+YOejDwtVTDA0AYYuTjV/vqk2uWQspNQjcuzGheCmtWHeH84WuH0aw2Wn/C?= =?us-ascii?Q?KZcDWpk8gxmUgrYsfLaMhqeJXCs4vn5n3wCZDEnTfeEldxe6YJwC0SsAo+4f?= =?us-ascii?Q?ruB2eBPixvfuAx3jZSDBPev1+gnKYV4u7kIDH3iGcLQlLJljxROMfkNKbn6r?= =?us-ascii?Q?WfeRmK9cF0BXc8OP9xes6Jvo5881twZ7u83Av/OKN5t6WC4BDUCjcxYa6Kdy?= =?us-ascii?Q?EBXvyRfv8QuRfA7/4eBME+ZaNGnIX6slZ8CTNHHYjrC/u05GFkRUyG3aozv4?= =?us-ascii?Q?WjtZi5ep+Hem+JkuIaFKppgakBczZhk7QDKVWKFDI122Ag/0cJQBlWFrvFQK?= =?us-ascii?Q?E+IHBbtpiYJRV3ygi5TsJyGrBg7KvNjsnuocqJEuuQ86XeRabJ2qDRDEMomY?= =?us-ascii?Q?5CLSEKZjRoIlQy5+Dl6ByHpw5euJvDCPs38eY5mFnARD0cHSAVKhlJDhbzPv?= =?us-ascii?Q?5SkDnApFVunxDfB8TlTFFWTo9YAWDKSIcP/3NlU8RjYmcZoJKIdKOYLkizqF?= =?us-ascii?Q?4DQttwRJq5ei/A4iUCw1FFAQaKHXb1QqXN821FHOkcb2WxmIe7ppDjVlpnXu?= =?us-ascii?Q?kA2T5kItp1C3UuWMDz47dH7/ejRvYQE/OcwpJi6bf05lN6a4G4KznnLgiSMj?= =?us-ascii?Q?LBIU8C8TeY8w6nkQpmC9dXVCzPwyD76I/Tc+Tb+QSXdo25/p5T7tKU7iX8qI?= =?us-ascii?Q?UODQAowXOTMxyER0wI/ME1UqRgE3Y0Sz+NhfSGgHQz2Hke04DoPFP/+YjYTx?= =?us-ascii?Q?TZzaAzh985VZ0qELndIBsIq+KmgBTOoFGV8Kr9Z87PfnRo16zAl0IkRc4AH4?= =?us-ascii?Q?36uW2/SovaRFERFux50ug/ZVP75xogmIu256NTfFtdZ/n6bB7xJ2eTchfuAj?= =?us-ascii?Q?rhEKAUzGgPwi8Wv1Td87eMpzG8F/68UDdOS1aSUgOLZDpxGZyT0zxSsL48me?= =?us-ascii?Q?U4Pbz5jGbHSzVtcoPsMlk+bDpCXP4PwfCOv3tN+Y7XSYi8G3EKUWIdEvnkyA?= =?us-ascii?Q?QKtplxMcsYeLc1x33eSbCcutGSYXUtGTyADGoiqcWSaDY+7wtjoII7QBpbYc?= =?us-ascii?Q?g+YG9Bfq4vxfxYxWKlcH1pzRtfMOTFwL6AvuDGoqAbHATvY2DIO+PRIO+YvS?= =?us-ascii?Q?7GyWQgliiR/GH2UQvCI393N843TiWxK0Fcfa/7imHaUUPxFSlYKjANBHU5/a?= =?us-ascii?Q?S+bMPzLMj2Tyb7JsFjkq75GU?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdb14322-c59d-4efe-c1c2-08d91b9ab76f X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:36.7637 (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: 3/K/wigVNioD/nnxN/nZxoYin5iBjqvP3/SB51cke4xj8MTt/cTWTriiGx7mV6pg2R6Q9wgum5jqDrz+r/rRF6ZxHm9uv3vN6a/wS6+dzcE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 c013a20e1e..8138686eb4 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -23,8 +23,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 void block_copy_set_progress_meter(BlockCopyState *s, ProgressMeter *pm); =20 @@ -86,6 +86,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 29db3a0ef6..af17149f22 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, compress, &bcs, errp); + cbw =3D bdrv_cbw_append(bs, target, filter_node_name, compress, &bcs, = errp); 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 daa1a2bf9f..9389c7c6c8 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 static coroutine_fn int block_copy_task_entry(AioTask *task); =20 @@ -243,13 +244,56 @@ static uint32_t block_copy_max_transfer(BdrvChild *so= urce, BdrvChild *target) target->bs->bl.max_transfer)); } =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; =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) { @@ -843,6 +887,11 @@ BdrvDirtyBitmap *block_copy_dirty_bitmap(BlockCopyStat= e *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) { s->skip_unallocated =3D 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520876; cv=pass; d=zohomail.com; s=zohoarc; b=a1Qk9peeoCYu1DFctErMjxIWyvWAb5f0Rf+f3UuMg8Dmi92MJiGUIhomFI2j3kon7rguB5uhQSin8z2hctd1TKREOUKgzmpkGkW3KmZbnhA5Pd7vv5OHBZpOkcPo2GCuUE3RS9glc7qmMXMDOzVpnet8uGzEEvjX6JJv5SpPjk8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520876; 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=vFZ2N8HbuZD1E5/sueLbbBtUq4xdCLJaWlsPftjA7no=; b=H/4jkOqjIZxLw6lL0m6IpaRYWI0FN2MDZi8Idr/+CKHIbsRne+zcJteDpd/WA8SDHiD2oI3Ju3Qo8V0FjU34j3RqNBusqZSr41AssjIzGEsMWuY/xkmTnHb4I8ubfsEPT9wAeGPiyG7jOrhLmV1nhRDP23Myjw4YirPeXN/GeO0= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621520876473716.0165175337975; Thu, 20 May 2021 07:27:56 -0700 (PDT) Received: from localhost ([::1]:55668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjeU-0007Wl-8a for importer@patchew.org; Thu, 20 May 2021 10:27:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZm-0005qc-RR; Thu, 20 May 2021 10:23:04 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljjZe-0005ij-I3; Thu, 20 May 2021 10:23:02 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:38 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:38 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T3BHxCTY+pAE/rjX1Kgpgfm72MucrENZpeiMjQQ9UAVyIKvoLuzV+xWeJbenmG38sytnwbXTxjD8t6Za1C2XAyuEIR2JWnmrsAHFHzjbio6dpx01MM0nezpiuCslJ3z12E7TAtI/h/hFc2brCYfA1gn9RMIrAzF0tqmTdtlcu+wi7Lk0LlyfjxRmqsUyDhrzuQUzgTwTh7GYNW1kM/p8dOd8Ubpftq0r7PGdKfEqboOlJjx9DoZ4pHzFBC+zdDZDeqa7HO9dzKqNJDiRRMN2dLEhQ//k/2YFQipCTvplWZCwPYgRyfkt5R1OQ25sHw3QlDUsObxp0VU3bmKCCnn0cA== 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=vFZ2N8HbuZD1E5/sueLbbBtUq4xdCLJaWlsPftjA7no=; b=dQuoDXhu/MRzd/5J+Y4r5m51gIWNX61Am3mcN6uVVoq35weWQt4i+LvKrbawIVDCUFtvONGBeGI1rzhiWRxJW2mhgrh4iR9+1SAngxkxYqWaM6Lyh14yoki4/NLZh4qAWMj4gm7KmNYkPHSJYWxA7MalRAJgmNIPDTdaWDzB3UaZE+RIHfomEQTR/nb1U52fhPfCQLe2VTyGFKoaAG/PppCqGBA9WtwqHqozWQn3UlRjUTwi0EVED7jHr76XW9evklRbhAhb+jXjB9bxD0Ddy7nkCIn6JBdCAzg08IVcgQ9kjTqDilu3TWkkQfu075gi3HMLZg4hK1ecROJdkYNVBA== 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=vFZ2N8HbuZD1E5/sueLbbBtUq4xdCLJaWlsPftjA7no=; b=R3DsTEb4QvtdQC+m4jNEuoiWbXuTRFiH0RZ9tJu8VU1t6XdcgEcsvvvAnKRWjoTNUHkNYh/QcCf+TALvucDuBDbbvCwDCkU6UxXWzXDiYIkN/UZqdV2BFr86e04HYNJ8XgTg9u2zopA+r6vrYd9UHXlzY6u1iBvgfjLVpDmd4Vw= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 11/33] block/copy-before-write: relax permission requirements when no parents Date: Thu, 20 May 2021 17:21:43 +0300 Message-Id: <20210520142205.607501-12-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 1bd68a64-dbea-4f34-14ac-08d91b9ab84f X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6Em3VFMXvcuc49C/Ixstyx9I+BSe32uoQ9J5dVsZY5I7hz5JT+KMI24SqeXZU7csClcxvH/XO/2JDlFQcCOVBN5IuX0XCmmE8ppDDJC+hvM7cRiBGUuYh/cOW+w/HS1uPU+yOtGNwVc7BF10j8b/g9Iy3Itrh+SKLlHvUdPFzRZH4Ju6yMMLpcmr7KK7K/u0hglg7dsCvS6wNQLIPP1VlwDufy8NVjWt0VA5KVwU5ewMBlh2r24sI2z0EVLHV7Iqikk+06Os6lvcEYrX+FElPwVW1kDg2chCcE7ZBsr0LU5EsMHABsB85bfwjK8uZxy2WngYn4R2/hVRrLcZMj6/p8GJflhphgFrnq8ZXSggVvsU7tmvo1tlLsgJuwE3MaEOR5hJ7CREPNHIBBxxmh51Q8LSg3BuNyjog7VHAQnbhKx261tyUMjYUtC4itZpj/o1KmrxUQY7qnyYCRDx48RE8MQQR4FckhydK/wZGj1Q6KUbu6WzdFnomR8NG/dHIMTRHsECYaEsYi+br73FHyxLg3psUjGP9aODNnstvPmIf17Rw/DCGXOjbvh/92KDDWFTnuy1dGizjw+ai279SWvRtW03x3E4qxXelSpOGVnu7Gltd3iZBKJZTdWglZkD5eoBAfYomRGqXGOvzSteUGdFPLR4WTJHPAOdXO+9MOckrMXwidJPfVrSZHyX70coiUpO 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?68G5Wb9clwyRdbwoNCUFKOHetPhLJ9TIvGIGsybjJg1NKmdCMv2edkWj8h/j?= =?us-ascii?Q?7hmcoxggjRT1qkgpK/KEhKqPo2pzpLuux4pD2i6vw4qw22CTn/6h/r8TltmP?= =?us-ascii?Q?sdOSjE8HQgZLGkwwWBSBsfSk/DCsQ8IPSAhbVhzQdvoUS7OudeeFT1I1DXwg?= =?us-ascii?Q?WLLioEmeVt2NjGJ2e1H+ZMBfOfPgpyVM/pFO1PV8TFALjTdlFJDEqFQp7BJ6?= =?us-ascii?Q?2b8c6Gql3xKjxUldvc5zQbQIYlCWUHSNjuXSjMsED4MwniwUbqqy1Z5f6KoK?= =?us-ascii?Q?wgg/zQV+vaYDx497S/Y9nKRXi4LXPeeYcDcV7JLT0t+SR6/8KlSeUNW5C/jp?= =?us-ascii?Q?oE8Jg5+9qm0aMKihBZGV5STqtm6jusytaqMEYd6Grk1zHFdNcIpFfSz/kmOX?= =?us-ascii?Q?DncreeVANPh/uQ6wCUnd4eHaJr2M+zlHJMSXim7mnJNPZkHZ3vx4NLt0LaH8?= =?us-ascii?Q?rKYJTSH5RvmKQ0s2Ug+lFX4ZQNWcmAGKmA+4Qg8Zjv3kZsStK/6ci46ThOLu?= =?us-ascii?Q?Wnj/LwA7xTqWNgDKfnJ92LT4X1coS5sewtN5hD7UcZF0BUuYVB5trbNOES1T?= =?us-ascii?Q?GFo5D7Y0BteK9ry0JwkTaoCQmlR6su5LQ7G3zdPPBvGrp9kJoceuN4ZHCXh/?= =?us-ascii?Q?Fb/rN0Tx05byQj4US7GP/mZrr4atVl5pmjh4M7cMAPAXk9jveg4bMnvbVlnz?= =?us-ascii?Q?sbbFjIwaym0YYfCtAUWJ2CZoeiUTw+JSE8f2hS/iZvfC+bGNV4By5mwG4Z8q?= =?us-ascii?Q?sIlNdDvG8sNa0sCCp7lMN6s6mhrGtOlcjLDUq/m6SngILgWGAo//FUhXM+9g?= =?us-ascii?Q?x69rXkCjqAiBKIqVbAXpzKs4yryBsIMp7qxjKfqn727sBFIOeZ7Wi9pGvkkx?= =?us-ascii?Q?h6HMFfG8qd0ZTZlaFrMAqDDD/hZ3t0NwjY9/glE5AEILC9f50dflsA9OMx4G?= =?us-ascii?Q?EzunGGtTKphwoU/X1rEU0QKn+M+cu689C5KRS+k/65NB+eTtygimmgYNzrtD?= =?us-ascii?Q?OJCAHoJ2/I7Kl29xk9rk5pm/loSMiuXO6fnH6PYxfrBPdaN668Zd+f5MHUFp?= =?us-ascii?Q?m65QVKZ2ieVJHyfG+zBpFhy9zEMqE1OxtWVc6knaD4yOk0pScp11QEIOs0Jk?= =?us-ascii?Q?nM9TqENZ0RRv8YmHWxgdkgY7oQYutEqw4+Qu9U0KUDqQ8ZXauPHuXANiqdhT?= =?us-ascii?Q?6duhnQWGb7G38p0hDLC+0KVkzzyG7Vv0ENB341moe13Ua7SMs7FEA+CtnoOz?= =?us-ascii?Q?Kt40qvc0SuebHw38XLkaCFnOrkUGWA5EyRYzyf5NIwH3jJ9mVLrkMeHzzcfG?= =?us-ascii?Q?6yfSOBzkZVMwmHt0+E2fESrL?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bd68a64-dbea-4f34-14ac-08d91b9ab84f X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:38.2073 (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: UCZBDrMsq2wdlNFsgY63uzipcEVX4rR9h7IBZn1uOHAUWhN8sdvWha7JJ2Cmd+wrFScuEsBUJFT80Kfe2E6CN5B3MoTHiVfGFHj45ccpZSQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 e08f807dab..d5350ce7a7 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: Conflicts with use by source as 'image', which does not allow 'w= rite' on base"}} +{"error": {"class": "GenericError", "desc": "Conflicts with use by source = as 'image', which does not allow 'write' on base"}} =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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621520990; cv=pass; d=zohomail.com; s=zohoarc; b=RPIku7vdWKlZRZ0SCpE6a5BvvMPhBmwEXL0Gl31QZfLbhNaGRK///UGaeZJru7Gz5gl3A7+Og6hwkDBzWvmxgyePnhvNkbxMfvAZ9LlPee/+c0AYpSFNh2t7+YNX//iKAoBws+4wH55hdBFYCE5DaCiVz+M1376iQo8qoSIzspQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621520990; 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=hoJsNy9IWl0hzQSrb1isa0wceMU5510Tm4LF3TQOTTw=; b=iIBWYNs94xSdCTty4Ex2fQN1aURx2TkM3jzQke7C+0vaEbGisOcyXXqG0SubruYur9k4FUPJwoABMbFTJ7+PBs+UdbDtgHJfkt8tvbFDl3tPCFZFSwp8ZhZ8xV4i6lK31cAeze+tLkpyc8FsPcnm461uF7MYm95wi97vHNJu+5k= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162152099059654.75631416745466; Thu, 20 May 2021 07:29:50 -0700 (PDT) Received: from localhost ([::1]:35840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjgL-0004qU-EB for importer@patchew.org; Thu, 20 May 2021 10:29:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZi-0005oG-P0; Thu, 20 May 2021 10:23:00 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZf-0005ik-3K; Thu, 20 May 2021 10:22:58 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:39 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:39 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=deawXR/MvLOI1FBSS+2+ngTHjkeUuA6wpvPWWfyOrLsXDW41se8BrJG+JC3CEAxG6YR2DNdP9j3W+TSDgDk6UPYXdqSvinYYQV9nFWxBiQNTGifyDqqwgwFbRgDqqpWMkwWNYhUXpTQ2ecI1Mv4Yke1CLe+i3d26eVdY7vpD4czj0DYvgUHsQ2ufye5mlX4osGRHLzf8NkXrbiagQptnesD8ffF3iBkT//ZE59TTznc8GbtVThbPzfaUIn43JsHyNtRUXath/NRA8jRuJ5TMpPj83AcP6I2wmpIVrZTg50gJV9G0c52QODcHdVU0uDplAEVtip88OWWfO+x7u6kBEA== 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=hoJsNy9IWl0hzQSrb1isa0wceMU5510Tm4LF3TQOTTw=; b=c8SAr9Lqfub4S+NYnzQArPT3+IcPzvGTD4mSAX7DYVB1HHyU0/Sia4dshRPOfhBrgmcWMCL/Fvti299ZwjsAEa7HSBbq2YXZJ/KqXYYdlHePJG3e6BvNdVjPk06W8zw5XA0S7QSfrz+teQ6R9LtvuYXsFZP2WK+lsD3RVRsi4UvaNB2NynnVuTfys72SOdUH6d9xJG1am3RMkz0I4Y3+pF+V0iQcw77sJd5IKDBEDKgRoEti2H+pd7X6iOfqaNcJ6hY7CgKg1kRkf75BTH1J432SpDZRfUDHew5ltQZ3x6+ga/8wSmYs8a3ng2OSsxKGAbduTkEuXaWP9BF0SVmfRw== 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=hoJsNy9IWl0hzQSrb1isa0wceMU5510Tm4LF3TQOTTw=; b=o/DCGopEHIIqOq8kWGfs5r5WTyntWnpTdO2bR4pvdnrGYYtu7r07quTHRiTvaCkkidWR5AnITZ7LECJfVpXH5QBkQCMUsSmBGKSlLJJtL3ugPpTH82x2tIN7DibtLChylyMNhbUfpwJxYY1VhuB/n/qsY6PBw4BI56FlS37qhR8= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 12/33] block/copy-before-write: drop extra bdrv_unref on failure path Date: Thu, 20 May 2021 17:21:44 +0300 Message-Id: <20210520142205.607501-13-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 781dc211-ae53-46b3-1003-08d91b9ab92b X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:243; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vF+my1UpRXJSqy5a0Muy2+QNCr7hSmMA3A/ndpwukS/eGFxv4ZKd1ByEFHMcdsTEN/GXc75TVkZD8aiM/mTJLTLnJdeC29Z3kYStxh9UFviN/Vo7lW3kuQqr9Q7BWaStKH5G5a/uyVdiYrK9st3LVUCe0hFsgHXCbHYYV/RDyLpJxDPdhLwBGbKRPfOrEzQ6mx5VlEL4aZS6xdTh4ZDgYq35J2Pq0zNc+aWgyHDtdUrMS8ERKlMC2LYnajzWDVqh69BJ1vUBydgK6tliiEWZEIOgpCnQMp/CsFd/bWv/5Dbma2ArjbZ7LQj2E3agmJe5UWcJBFawYdVTdsMRKVLWVqOtLD7IQTD3v9Gp/Iy7OZbcZWpoLhNxAkpB+UgloPJ8tV18iyVYiUXkbDKurXqXJ25FXYq9Zu4Uk9XWrk57p+vLK+AcXM2/mXjfBVsJ9Gib5KtrdiledDo8c2Zg2V7n76O6UEqZa9+D6YR5DtYDiSnnfrr7B9P3bOvutjzMdi1lB1pg5ZMn9xWVd6tHjkB0nszaRv1Is0GxnMAa8I0pbNfeSgr7PYRCZpMbkmRLsdfhWXCs9XI7NQau1VgMpohW8sZkJOmuXx45KBj2WMa+MdK7fUT6r5QqymjsPWZAIdJVlLZy1HGXyHnGshu9f64AoztZslzY2W7XZ7/vaQbBv9afSKhc6z+EYXpv69ABrrzO 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(4744005)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?oa0FZQRr3Bh6V42vCtytETRr0yEgb2mQgeS6joh9glLmoSIECksxBtJeFtzQ?= =?us-ascii?Q?cO8WOwFygvFlEvK7IldWI49M2XI8ZULmwhpOLmVJebZc/SUOlIyqn23ofRCL?= =?us-ascii?Q?Dj4iKUF9Wf9LQsXecjlW6BzyurCpi36nZT6IwyuYFPD31FD32X0frdQ5y65c?= =?us-ascii?Q?AAfez/7ZSCp5ojn24OhZAm/EFaMTnpQ2lbSyeoIFS1M4Cjkof1P5xvmRqh6z?= =?us-ascii?Q?APwnUMJx/JrnqPlHSo30u4OOunNxX1TwfJbW/w5tjNdaIhvYYPodrWgiA3XQ?= =?us-ascii?Q?1y34mNhMw5sMKWB2oQhXtDpGrW2lourCNw7Xjl9Q7Gf//REC7DEcw1sb0cwz?= =?us-ascii?Q?vaCMV9DCsxX15WB2/3mFddqHwfaZNaoXV/3wqKyQn2Ku359Q1IKFBIVgF6o4?= =?us-ascii?Q?cyDHWr9HhqsJW6hWE1Go3p4//ErnyqUYPWju6yUDyJ8cOFvUxy5h7efPrzxK?= =?us-ascii?Q?EEs7olpE7cKHyB1NFQaFo38C2MXJFgdAu7bXkKaHs9Drdrnh4T29fUDtZKG2?= =?us-ascii?Q?JOjoe1VIlJy5RsTS1i8OHZmDHOt6XTaF87Efp9uZrtANGBDb3RQQwGA2lUDj?= =?us-ascii?Q?r3blG+UWqcrkp6NNtZ6bbPnncxfTtCXoMv2IuLzXvCiq+qVCqbYzHel8wVtn?= =?us-ascii?Q?4pw6JSj9H1M55luNv/2w3uqqNRd4NnrszGF4BuKzHINZU+kkch2+fax5q3EB?= =?us-ascii?Q?mCCFv7uwX887U03+EPiduArOVr1nagGo9bxSLtnJ2a4/8qO0CfVVc+Igg8pz?= =?us-ascii?Q?afHH1p4DPblGrIE73lBoObcVCLnDYq6XAdXgqKaIKiXX3DpXUYx85N3fxb+T?= =?us-ascii?Q?jpksvy7QOM/EnBs2JWhK+dVaagJo23IPuyxlEZDSMwu7PmIrzxE2/wfUSR5a?= =?us-ascii?Q?7yWJh6tNRulCy7vcHMrywgpBvJb/UOf6BhWwdUCTjZbuNv8gQo457zTlrIwK?= =?us-ascii?Q?GQRWfrjLGvBgH5VhcKNDvtsoOFzF0aRhUVfSwFULxvvIjGISAtenm5CLsnHu?= =?us-ascii?Q?jDmX7NnzkyJGhaGy/uVMlOEjspf+a2h9Seb1vqS6vrG6uNFVwh+e1Oe3/1Kl?= =?us-ascii?Q?YQZxTi7ewB6v1cBhuUF3L+gciTCATjxcxQ9PsbbqiLFaS3bGaPIjiBzMtxYp?= =?us-ascii?Q?ToGGKlJ4+cItzcXmJppWmZw+MBAmtnjr7EFg+FQ1CZ59AEzt4lpPl031RYWF?= =?us-ascii?Q?QwVSy+OAed8L/sami421UCqm2nfU6T3mUZyV5hKKr5FeT9Kd1rUknTqWwz7T?= =?us-ascii?Q?8fB9qcgHXsKzz5VisQaVEETYFjm3XXJo1DCQxfwCcmDJdBvu/0WgWhgqrOsh?= =?us-ascii?Q?fLMmnwOVv1FaA6D6j5hm3kYO?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 781dc211-ae53-46b3-1003-08d91b9ab92b X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:39.6410 (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: IFE+NZVYH1hFRUKv1ThKIP3SNuZf32LfVSqgirWQeuctcccKR/i9dA3tVCRd+EoC0T1CSDpWAcFEQQTJSynHFBtVhUNf3qR/8TRXRgJpQfo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521249; cv=pass; d=zohomail.com; s=zohoarc; b=Gi5tvCpZG6CVvVKx4CLOnFN8kcY913XJAJyD7qxJzYP1KILXfeXQPNYkSSJqghraADOYxnLhkbBPxwQf6TqOYwcddyy6zRbyobqFNBIxG2e/jYMWaFRcF5E5zlizW4HWEpUo8d6/Aq+YgJAwC9ZzUOXJovtkBCe7GIKCapQTKo4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521249; 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=pZgryinUWsEnTniRHXmcXGv8tiYyMz+B/34hKyg3WoQ=; b=NwtZVZXg8O9ygbY9I9O89Dm5YRD0ccSRc5qE/5NXq27iU1rZJz9gIwvEkHj7Ck4kj9dGPc/mXnxTfHvP4j2eaVVLPTgz0CJYnm3Ad6duro06sEIgIctesb9ccUwzA6xyUa4yQqshUsqotDh8UJ9MO7k9fRzZilasbgzPlPkSxbY= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521249852983.6718023886672; Thu, 20 May 2021 07:34:09 -0700 (PDT) Received: from localhost ([::1]:46580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjkW-0003wi-JO for importer@patchew.org; Thu, 20 May 2021 10:34:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZo-0005sL-V6; Thu, 20 May 2021 10:23:04 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZj-0005ik-OE; Thu, 20 May 2021 10:23:04 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:41 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:41 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LREivY4QZ35ED5uMcdRnIDc0WCVZd4OO0pwh3qTQse0N6gm4eBc7aOhkolkLRIUYRKrIdxRcKIV/8In3J6KwcEhpHTOvV0YWf1RpDM6XpXDjwfZiu3kNHT1/i14P7v7YneYiySdev5Q8R+h2xmBJckC/I3zd4tl1gAGZ84IA9orFn7vnCrezXhAi8IXw2RC5PJg11jTYyjZhZ1RPX1tetLsDYIueiUwBT9cl6mr+BZ5dq1Js0//1LMlL+X3wiQN/tvER3m+Uh0cHbJ7PyLzXebx2e6n2jVDsVdJKG2CnatHAKYuyrLp9q5WBF6BDQ2i0eQDXkyp5LCyGedQ3Rq3kTg== 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=pZgryinUWsEnTniRHXmcXGv8tiYyMz+B/34hKyg3WoQ=; b=R87kMcvz4rjwkMrZeeeuFXDMu+LqoV9hwJ5h5mFNDXn/IDwIfgiHuVpS8pKrriJByzi+QVd5RSR/poB/fE9K5nCdZbceuC0/HBs1gDcrkHOHfSHdwnAK+UwOa50gCl3gbibHuDBd6COiT9EzPfxd/MBr1OADh1jsxkfO5+NJMY/EpWPZ9/4jDSrU6CYaaPhdrczfG/++49WsmjLIz59UxRyAIZPKsZBDG1uwip7iQRWTMJYWuNtNbFJDfS8c9fILjh5YxhjmixhW4WzLyhjyvToVWwCHqPN6S/48OKJHrx2UlTKRJwfcjGYkIwTBFEnmYwLNFSzoVzmX+w2oylEeQg== 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=pZgryinUWsEnTniRHXmcXGv8tiYyMz+B/34hKyg3WoQ=; b=pNkShRlgoeUFoQnTE+7JitqAZyoblIb7jYPKYGWRa845cR0VajEkG/5nPLvu6Eh0IIwmrVrKiqzMRHgo2YiuocAf+jebUqzWEoJ/+ZXU2CMpomcfJfemBRxRMFFg/L4XSWZtYmUVRIPFJg2dM57M76rOGnkQ7fjhiLkfWg7uXhk= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 13/33] block/copy-before-write: use file child instead of backing Date: Thu, 20 May 2021 17:21:45 +0300 Message-Id: <20210520142205.607501-14-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 62b13105-2d09-4311-bd85-08d91b9aba06 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4JRBK4HIwu5bfPzLwhMRogZwM+iMMmROvhZ9HmmxmaKBQNlN/zYgxPSwL1f056NElFkzy0tnC1ktf3+9Q6LgbnYgLRtU8CznxYxvEXWvZeLgbCG/9FQ2wBTl8byCp38pc1DVGP5t4/klt2gmOyLkFqg6nWo8M8LRsbiD56tvGmE4zvY8mM1XqXYjcb4RuU1nRjN+KuSxMrmXQUIwDRgJZ8gM/+aF3neUYrw5V7c4GMC9Ahw+rnvF6yckCM3qgVpcHXgfAfEUO3VHjuVsNDPQFpWu7quUMX43fxqxweC4Z/ZCHD/71a54XLz41VUBD5tQ3zQs2743SZUdVCyK8uSl7mZh7NHFyqW9s+JT8Ow4K/baixrr9c2nJXfK+zrgwqkV3GdR5kl2GILilCd7FE9IxpC95szsdNdRQSXsDpUuAyaMZTAilRYcUs8/UD1aXODjKP8oAb1Ft+kq6PxP3XOrWzR92fCx49gOFmlcCpck1v8KIPBH+PmMWzRrMvIewb6H+mf6P2n696ZhKUbzrxMuZmUs3Suje7C+4nnc2UtkGBUUbLibNh++MVHztQ1XPstGuCeB3MsXA0h8JkJcm2ewhnxF5mYN4f4Rl4GLcJFq8Pp+5/h3EcaaJHP80tPA65E9jmf5VKd0Mg6yoV09rZY4nmp4kq1sYs+Uc5GvQ9Y1d0M4I7elkETcw6bbOUh5RwxJ 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?kUIcY5lf5w9ehuG5FJGp7YP07TKI8uzazAWG6gXzwOO3jsnzar7AJQxZNnIt?= =?us-ascii?Q?CJ5hp2BHa8gp3FSsr3j4aYYRqNWv4Kk/CA0aO9ZXm2upMjar9FV++ap3DMAY?= =?us-ascii?Q?ch/opHHh9onSUKV0c/Id/xToHGlJ+OOYB1v5PSrV3RmzLBRxVTwH+bk7aCWw?= =?us-ascii?Q?Mx84G6dr6rDV4ShiVesBZUTK+uVYVENM4GpUbQ8trBeWOvhxZcfScDrhQvAS?= =?us-ascii?Q?B6WpcD05jdo5MTU6ktpEbF7F/ek1Xb214UBWNRb6gx4P2vCKC5dwRgni4DNu?= =?us-ascii?Q?eTbinwGaotOZh1R/Rle3meRSyxNA14pn336u1mrrVLXUr54P5E2eKKgvywLP?= =?us-ascii?Q?CFMJFGPsL0Hb0idYNTSiAjbfDHkmvsdWNbrpl7ijxBg+gPpKKPTipH2bH4mi?= =?us-ascii?Q?T52IfIfOaoffXEGsCKtGg8jti0wp1GhdRJrPTZc9kFTg6H1KHtidzKvrHd7i?= =?us-ascii?Q?92lb8PX0wckL6FWKuiP++WK6hF15Brrz/saJJt/IvEKUCPvemXkiSWvlMSIe?= =?us-ascii?Q?dc+3DAgav3Dk00iJrScF4oQ8c4DfpNH+JSQ0YLmIJnN05VonQLA4EPrAe6uQ?= =?us-ascii?Q?L84cOkhK0qs+7fmFsS45qdnn9E9JUoMN8n0N2DHoijDWRdq/MJGwOzb7QaoM?= =?us-ascii?Q?9qrmA5kt2j1Iz0n1ak/Qw2cfenLJjxl9U0UVrQ+0tODtcU1++Ff7Cdyx4drF?= =?us-ascii?Q?qq88U6uUZ8Nin/FdStnl86BsfKd6+F/RtJIQUY0QcmwXbfmc3J21Q/Ec/XiN?= =?us-ascii?Q?RzbBeY88DCbuetxStruS+GeiJlY8MLqj1y48sIkT1BiRtfYpPMSvAlgxagXn?= =?us-ascii?Q?6IgVHCUxUeQFG/m6f6A8g0MJL774qTE9c8jyA8Nd8pmCMpiB+aByeLhCmhx+?= =?us-ascii?Q?0eZgpwTa2b7Y/GRgQkM37xI66CMnhDFS7C60WZjc8kzgCJ+UB+06RFXL3LgN?= =?us-ascii?Q?JbTw0goPPQ3e9pCypdah8NTO3moHVxhVaIsNeLqdajN8PAXdQahFhV5z60q1?= =?us-ascii?Q?5NCSWbaFSstyVMbr4SqFo0oUognT+8G615i5Vvi8JVdbUSnDnPjApfygKwcu?= =?us-ascii?Q?+1OiLLVDu5qvBzcPJu+ghVKIe6Cl0p0EraLo656wrUrfuyCM4dn2FhJQ5a1Q?= =?us-ascii?Q?RyE8gPmespy7YUzKE2s9hBCreAtElSnU7OwyTzScUhAYX11Q9fhn2T4R9Lhz?= =?us-ascii?Q?ZWj3FXPkZX5TO7K2kOp79Ot17ygI+V/uxwtEDLak1CNVDUU24yPGM92X+yDL?= =?us-ascii?Q?dqDNyR/Y6CLGyhoc0kABdQhIfX6MDQ+eYR8H2q7FgYorqEjq6asCy2J75YxN?= =?us-ascii?Q?8t9+HOFBPEyImKbKaFHKGjTF?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62b13105-2d09-4311-bd85-08d91b9aba06 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:41.0638 (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: iZE6YgpxPkuRFj6KGKXFkjbTlHWKvbeFcoZASErF0VehrJal3/X0asTnx110nVx4z3DXtmSMSvfYZlvWItm2x04B0ZizgP6ozlKfdG0asTM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521073; cv=pass; d=zohomail.com; s=zohoarc; b=d1DEZUtnp2I+jhi9JbHv8HQFeT9BOUPiXU3A3lePEeIroBCsytsRY/Ye2eNA+69QCEb0JvJOOUH5aKk5LYB0ZiVrz43R5txZ4Gci312NQpCymkhhlFvVPME4+ccjmjZMlfewmS8NQAjSSkC0+6+JoNKFuQ4IM7cgsFtdjvpLnFI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521073; 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=wLEcwV812q0rn8jo/2hQk2s9oTPzmacZKAyLmJxp13A=; b=cYZ/ciApFWPQI/x3Z53gl+kVqwLbIRvzvFmJoHWjXG/va+mRF2gvO/s6xdvLNEN1yVKwuW5iBA4NQV1WUk9imRnLb/9oFrq8rMZMbQI2K0UMFL3ZZZMNlXJdsdQdI7YhJWy2YS6xCP4zHGTpfFEbwE8S3JDZTxmatU24BvgGGZk= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521073903513.0376192897564; Thu, 20 May 2021 07:31:13 -0700 (PDT) Received: from localhost ([::1]:38442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjhf-0006ef-N7 for importer@patchew.org; Thu, 20 May 2021 10:31:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZr-000630-ML; Thu, 20 May 2021 10:23:07 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljjZn-0005ij-F9; Thu, 20 May 2021 10:23:07 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:42 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:42 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K3lFWwePFCdUdvyls+kn9z+6fWzgNPgLYXkd/j+uVt2hpSDl4VMetwidxQ/tGMF1A5VU0y7NdktF+7ZmCwNoI7vt1DGDqPX86wQn9czpK9J/fg9IBoh3IVWNYmqE/gcSPtOMmfEdDyQrKMfrlwe9r+/9wpazhBGsIP20VfIgBsUejzBuYj4Z6PjALDsq5qv+De4J++AhbjAUGgowrRSKjXNMhTy+l1SWOZEO5PfvPb5VlYdLhZZub/nbdpkHRXIWSY6/p+jYhXf8h/DSLVlg2/lIacVToCVGo3TVf2BM3Kh73TmY9QBkspkOxqBb+y7LZ5TcHEJ9KKob1L6QZ+uCYg== 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=wLEcwV812q0rn8jo/2hQk2s9oTPzmacZKAyLmJxp13A=; b=mXQEPG3Q0+oLWqkzR5XvAjpk2kCA3j+q3kibSskt6JmJoBvQfxoBB1BHREtJCRLxrXhaZUGiOeTXs6FwvhgnXligFhd9FmBYGP7IwcWZpPVjrQr7Nd2CBEPJtjHwh32VgdZzaCZdUCNCIxMuEy3aiNHsD9DmM1ljW2lzv1ZlXHn7aBWcjgy4kkDedaPAI/2uUN5uOYqVUgvKjpHcfXhkIicyVFQgOzsMdi3POaDcRFi1L/T96el3SnkaO7oijqQiCtHRKWU1+63krIoef+I2khb/ZtAQ/JfgjXfywEzZGqiFGwdWPCt70pOI16v84cBMaIxT7oqac5+XxhmQUNMH1g== 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=wLEcwV812q0rn8jo/2hQk2s9oTPzmacZKAyLmJxp13A=; b=Zp2ZNv1yr/L3zt+1+RVvafNLxAYL2b5EnghHjKfLirej5MBbJMEKrHe5u7avXS0siO69757vjy4/78Gh6PFkuM0KOtWMx5WAQm9KB/vAmIM+y4OuC5z1p6rfeUEan+v3fwau7z5JCVXJLZuo57+gyctZAQmhuJCaGZgkxheqVys= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 14/33] block/copy-before-write: bdrv_cbw_append(): replace child at last Date: Thu, 20 May 2021 17:21:46 +0300 Message-Id: <20210520142205.607501-15-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 4c0640b1-8331-4a36-8b18-08d91b9abad8 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1013; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UoMB8sBaB4Vg6EzYnXkbSiYu9CEiIZWCy4iaI6ijyOw8UOaiKm0kxV2K4WJU2CVFBo4Qx6lE3yff1oepgo4GLXnUw+pcCiI4498YgMuDY5vU8vNSNjh6FFzjMgeu6RMhs73HJuJf54OqOfFdm/KhSEhVAbUNR3eiJQSuP7QOGTSoYcX7YRQXdPznbOgNJkzq1JHIGQY0lxjjDa1NnBNM5GOstrjZhHcUDo+AEEybIz66BjWZM/SmyUKKAOmAr4Ct3Ofki2alqn8o9NkhKRetmfj5FvDjNh7JtjkYcMzhGYLJo0TCic5clxWZnRA9q1dLQQfr1+5CMLNsYh8YJX5V58uXGeo15hFK7JZylGv2oAfvGAtW4Rq6k7oLQZQPID5OxmmcC+6pV3SVJHScjxJDUL/xiJsdPTOuMsbWBVprFBRKi5N89WlukzkdX/iDzyhp2nZpeY8c3ZbeyaJd/+CzOCdSuNUAlo5NA0zoaHJ00e9IcdpKfxdtudWRWVBBieCJNSgoa7stT/aYyuuCLZUPttccFWOJ7PphWJ1ua8pzQs+9EazZrq2AX+qaufL8ASHre2k3rovh5DbsmsudJRQfB1W/Zm9jZ039rPFuHVz0q0MwHdWNm+kYy6h1H/I+bvh9xzN20ktGt307hqxh/C3eR/buMVh+503rIxCHXsjAwzbgR/LGVyzg41L+b2tw6xbj 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?L4V+Yrxk0Mas9I6rjtNghfF+2MOCXu/vvcGGPmVgfxxWxtrIWNuNK/GfIxZp?= =?us-ascii?Q?tD6+iaF72zot9ff9ft/rXb14Hlvfhpgyxj2yC+yyvSp5s1A/KZfIETaXceQg?= =?us-ascii?Q?lg+Yjq6fvrC5036yxPhGwOQvQjBY/GYF+LiQTWxtpqBl8basjIRTjDQhrVi9?= =?us-ascii?Q?QpStyVEVf8EGz/yzt0QMfpyjHn95V5/VGvvwur58Tt6uFwrigWq49zb9iFbO?= =?us-ascii?Q?pOoMRZ7TsQgkR8hjEnH52FANLdFoPXc9LQSRUEpmnjdPhlOotXLqbXqga6jT?= =?us-ascii?Q?KNj6ZXiBkXcNxmBJEN1QWgXE4unbaCskcY2YYf+fzj4TIdaVfFhLefeKXMgd?= =?us-ascii?Q?EhE+3ANNtVw/nIju5tlSWsWqmJW0vgU88nrMExTI64uT71Gw8/83Q0h7H0Rw?= =?us-ascii?Q?zMSKA2vUOyTrKeVWjYNlj3I1Rodu40BBo5mPD6345pIqVY2chwRBwYjhBkfC?= =?us-ascii?Q?dz0b27rE8fas+TcVl7/w7nGoNwgbGsouXlaLpsKBPq4tOXIqOiHnJ4ljm9yi?= =?us-ascii?Q?Oniq3dyVzMA798uPr3Iy46xZrGREl1IiSVAs8UKZlB7xjYz7r/3gM2l6+Z41?= =?us-ascii?Q?1bW5KgrZu8G1OJluacubIsz1WjwG8ZeB25D7vXKuLRU/vQvbwC2FfncTs0Zg?= =?us-ascii?Q?IIIoGR1PeMRwuwc1arOqjRkpe8R7cfw8RrUo8wVxZCy4Qfb//ZFqzw4rJoeX?= =?us-ascii?Q?pnzrRI5pW78Y1fuqZSZ3GnSKI7Wp12ZIasPRA8Nvr/vdpcTEgMZpGLIYwW24?= =?us-ascii?Q?dXSbIP2imstRWkzPNwnqqULIvQAsAXHCjo0ZDo0pqVnhm1ooH7EHMwIyUd2s?= =?us-ascii?Q?rbxQxFlC+0lAoDfCL3oZ/82EY3doCjUc/jSheszvIy9pTVfbEWq7PUgxRQZw?= =?us-ascii?Q?8KkDBZvyHkrkhFrhi2+iQEVNaMDD7Ou73E1nr1C852lSUzGbEnJHaL8C2fTi?= =?us-ascii?Q?Vri/8flKyMc/AHIIIMATFdeFKipS2tw2ueYr8JkUS5htvoZlb2JkkB6Eh9uy?= =?us-ascii?Q?4mydjG363jZrDGjgw/7tsn3I5RdqAfjxrv/bkI7tmwQ7sS2Phb9/cFHy+JkL?= =?us-ascii?Q?UWdEBPSkhb/M8ZgJ7vqp3aRUIMgOwKY1G7qAAm8eV5/+0oxwR9xzDGkQlUQP?= =?us-ascii?Q?sRGGZsgUpkF6I7ED7VzKN+nzePUomauLZtzDU7XJDzrMfrMyu+Pki8E2dBRd?= =?us-ascii?Q?29PGljhx5M4Fl62kUQR3v2BDYEJXlMgWNqWPZYoNqUofhMflI67ShgLgNz5Y?= =?us-ascii?Q?key/LUjMPkvnYNHrnEyPgH6iPbJ2IR5567Ai1gWb5sZaZwgDjlWxtjfJ8Hho?= =?us-ascii?Q?kEfJK2/oGAPOuZJlEEZg6mhs?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c0640b1-8331-4a36-8b18-08d91b9abad8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:42.4647 (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: NlLY8YmXnSXz7OiFnj9CN/RLK6YyOr8+wpptNuytDiAqRQQmbcx4gGscrSqBiIosdestPf5siQm7AT67FCFsBlw2m8TuxQdLtIEBtb89IZs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 initilization 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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521433; cv=pass; d=zohomail.com; s=zohoarc; b=Tkvh676gqQcUXDl3MFS8F6cmugTU94YCClcnzsRXRkQbmM5DweK/S538xhTeCewG1vWjQ+KhLmqARRPauu83TTfFJq1+9d1way/nX0c/vzrr3qv7l+KVGPgoMaPVUKzK2b1usiM5kFGERNKCrs7bnHmOW2basnRsdedGHO/kcz8= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521433; 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=ULbIfGle2hk6n2Q+v6LxIxzjL5NY6wdwu5ZWXwnhWDY=; b=E2WacvM0VxE51jyzBbmZLBl+qdAqE7sCvsGtEl4J8enOecAfo7mfol6b4IdPqwB3OddNOt6g0qRRtFlgWNYP1EfqCMDRiFsPzsTXHOUI7gXybeeZnA+SRlKNkQAFYTxMB7dB4366KMZ+GIrGmUfebUM0GKYl5gg9VwRHOhSxvXg= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521433362155.24037303034493; Thu, 20 May 2021 07:37:13 -0700 (PDT) Received: from localhost ([::1]:56060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjnU-0002PR-8K for importer@patchew.org; Thu, 20 May 2021 10:37:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZs-00068r-Vc; Thu, 20 May 2021 10:23:09 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZp-0005ik-LK; Thu, 20 May 2021 10:23:08 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:43 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:43 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGFBimQe9hONPEn6uaWyvVFLPsPIuseBovdlEPdtltALZPiHaJimTHxuTIgnLRdd8WqhafWPcr2q4hopEC+YyJ60P5QpEH+LOCDLXByoT17AJg0fIiPv2Zw+/WY1LzXeNdMatzaDK7zdGQIsDlnwuQkTLn1PmfufLqCd0LFmgp4PPJ8RqhzL61oZqia2GE+5Rfq5pK6MFxopPQZ/ynOjzIThNp/HJ1RL+4JSwhNddJDND79f5gOCcw9h3q/tQAwXG4+QSfq8j+SR3WUYoYLlzlNKLzt/adJaZLET+C/P99mMxcBHlh50ueUqL46of42ggxJho4zUQZfdC/SQfmIlcA== 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=ULbIfGle2hk6n2Q+v6LxIxzjL5NY6wdwu5ZWXwnhWDY=; b=Y5OnXceRuKQn2uMfUdTdf9g+YH0ek0yFNgYky8E+Y0GaAW7dIfZe9XTYETuTMYbWB+aFyN9XU3Wu19Bb0xd/pVMTACBXEjKKNr16LfsoT59fNTxnXPff10TrHZImatOZ8S1m2xCnkH3g7m56fjsrtoJIvqZKaUDgqQ2iyFjw1LGNEJuCbAV4cU//safweqPPL9xAZL3+CE1vzU2M8T85awBiegA7qqFGMIrPr7vCHRe+4LxhU7kbl/psRP8pUYHzyMwjbAVNg+CQdhgu3cYfsF4HMzmHZJBlAWpBqmZpqooeAMhKQhb14y4Gz8iNO/2vjDKoIzHda9sw3VS93MNYwA== 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=ULbIfGle2hk6n2Q+v6LxIxzjL5NY6wdwu5ZWXwnhWDY=; b=dG0jeFjNhei3lQlQLWfzOyBMdMLFBlJ6FXrkUdDjQku/71twk12AtI+WM+3XYNV8FaNTmWlee/yyhcA8afvv8kRGJ1/eKNia9mm66cmAQLfPgM+7O+sO66JrqpDBeWqGG/Cn76TG06qqeWBJAim0jmSt5v+B/h3BsnIg6QmmFbg= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 15/33] block/copy-before-write: introduce cbw_init() Date: Thu, 20 May 2021 17:21:47 +0300 Message-Id: <20210520142205.607501-16-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: fbc9def4-ece7-4a42-65e7-08d91b9abbb2 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:813; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gfIlSY9StB0VNi/h7Nu0hT13RiG6wdFInftAij5wAPjx91X2gG/8kl411PVcoeybLY3qliH8L6YhwWWbJfK9BpfkfBTOvHiEYM6HLrrOzdh8TFXpD7ySKk62qIUYxBQr3FaTiUyf6qJuQpx/7mYbfDR/McSzyvVshLRX1ccOf+Ea8G3iuW/NuFQMpe0OMAi8N4fVUh7ejffhkcQbXwy1BmQ0PV7vBKo416bZcu+9pcgMVa4HLX7S0vYcEtNNbzGg48PPi9zmlKX45LhVV7RcrPOteNz9xjY8DsrCW4BAOpL9l3Fq3bQ1/+hdfESK14CkqovjZhnm+abvRFmZq1nQTyqWssyuurrfkNj8ycTobEsjZ2QZnigAhs1a/vhMIlw3EKwo0J6e7WOSXAm/ml9uP02inTCSGaat8lpUpCKjGwzS8qDRqczoIJ3v89pCY/ycNk/c2JpzICQgKvWcS3SjqT9nWomewybNBpsLocr2NN1pPb19DZ3KtCtv56VMk9fmGZO1JJt2PEKmkGPistc/XSFUIUCIS4OuRByyCd4aCdU8n0kF73cKuGynPTXUcwZiVtcFecpNwZq8OnE+aM6YLQ/AEYHWCxJqI+gOoetzHQDvVK2aG2zTAcvX38TKlkTnAtZqNM+8yfOe7Bdfic3Wh8x+YM6ZKjN5w0SarP72k/YvepAU4a4oBB18it1BOPe3 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?1Fbpl8j1nHecqVDjrCn1AyIGXS09TyE7fSC7fCXktxdCkd7Cc35Kg23Uj9Kn?= =?us-ascii?Q?t+TE8sI39DpTZyh7Q5mbD5dVKf0UPM3BrBNZMBQSuC91+cQeXOYi9yPVlLW0?= =?us-ascii?Q?LnBiRbmbgg15nqxiOqbM5TUO8p4pPMeWftti/L6bRE7t5y6JW0OpEM7rNJtJ?= =?us-ascii?Q?Fg2sYofS+HDHQjU+/yeNPUMo2QGaUmnrH56Th5plN6Az7xaTEPPbfkRuU/a1?= =?us-ascii?Q?n5AlwloBAp47E5TDQmtsvkASxUp1GLJlTHTv82+8C78evfmXWdhoYjuN6uG6?= =?us-ascii?Q?T3H9JRiH3jGmCIxzhqXZIt1wVgI1Ac9VAhuGhDQ3diWdbyFSRrlwvsvsaRve?= =?us-ascii?Q?POY36Qxz9WpGhvESP5fu/C6NMwkxLmCPQjqH09MTNCzyLv47kHjsJ4byfV8O?= =?us-ascii?Q?FZlGgAE0vxLDKklfiPZfTiI4w/RqCPHtYO3Qhatvbgn53mILd37ZTXjZ2PYQ?= =?us-ascii?Q?8T88QJ3uj8TjXzXfOHWtv0sAj/oZ+pOeD+9hKv3kXIwbr5Qpdq1uB3BpYsxe?= =?us-ascii?Q?GYcYO0zRLTjMv4535YJYUEKB+P/nUjpUsBkDBBHgY222vvfC+ItYz1cO+ICn?= =?us-ascii?Q?ZVQJkHicN254iHguOc4NhKo5HPqhzcZlC+ppX0yEGSa3NrO+dHqdlXSrX4Ix?= =?us-ascii?Q?DTpOmbDDMxq79hA17YdKTs1t7varKruvN2T1Fdi0TKxmnGVPv7Q8uB1ixMn5?= =?us-ascii?Q?bi/LnHf5lV9yq/qLBaBOBJ3kTqGqahokZlN9CLwXhelAP4qH/v+Y1cYZTEk+?= =?us-ascii?Q?kmTsm2oxH+gmOWHnmq4WcLqN8v1/fmesiBWjCNWFR/S545IqIc1JEVCstaW1?= =?us-ascii?Q?D2MG0J61p1K44hdZF9TBSCble8dzC627f+bOutmF4Pr24NNwrdRedFYYqE5i?= =?us-ascii?Q?ZceaRGLeMwsct2yaNsZAki78Z4HMAvFdVS6wnoQ6sbDbdBh1b9joE7W9LTFw?= =?us-ascii?Q?hWxwRrqpDzsNIMz2JMlu91Vxk3gDL4q9b5meWFXv+Mj/s//HaOWEoJEGC2fQ?= =?us-ascii?Q?qDrCoM7vNcrfQhf+py3G/wJjuPzo5OUGQYbK7mE0SOC/11Uuiaitk+5ROr7r?= =?us-ascii?Q?8PC3/IrNSE7AArPex6z0wsRYH36jywm1IYQKVbj5d1qaejwYhRjLio0Hm9Qz?= =?us-ascii?Q?iUEkeKtXuDzy1bG1DlxjGoOyuwH2/O2ZfcTxbBAT33N61uRgdelhnQ6i0bOO?= =?us-ascii?Q?oGyDSu0ipafjo0ezPYjJ43aqKBhLRuf1xRh2TQu1ulTbrM19VW51a3IiVjhf?= =?us-ascii?Q?ECPEWUsUgQchK5PQsKICFIySBjXyTJxWvnO+bXOoPWGibLIXtDy/rYpbIJMt?= =?us-ascii?Q?JGRAFPa0kA453TS7m7vT8AqY?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbc9def4-ece7-4a42-65e7-08d91b9abbb2 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:43.8675 (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: s6zM/E2YYrC+AOvpYS0xtEhioATG7MtjPk03P5nWhRuNILQ3o/skTAfuVWEbWtypFOH/xpMczLi0pagFavzRkELlxWkZjXGUSoVBhKi8x0w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 noramal .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 06:53:07 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521549; cv=pass; d=zohomail.com; s=zohoarc; b=GcN5knVCH43rcIcigW89zBrB1Mbq2ghQDVum4A7522jSDTnech12TzDgESTGIiFKNzAMTcV94psiuB3RQvUSDnX6yuJLNDzggJoBBt4zyYLcKMW0C3SPjk9uwJZ6nD3P9jXnA3UJBkcRkkWr+QWHi8ZJ9Inh5ea82jFsm9S+mpo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521549; 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=l7tbyhyk9s6Z18WjjVDxzFzj2Uvyv1e6ziNjnjwuHzqm4vfRZsGb36y0vHEDtI9SOyVku65+0Z+h7+KE2s7JB4Cr3BjZJHuOtSP6MUyKdz1nzdGx+teEGafv1aizy7T01yfWpBteRv0rfOI8mCB9F7W6QQ4Z1QfmaJX7QR45S+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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521549171913.7649933670614; Thu, 20 May 2021 07:39:09 -0700 (PDT) Received: from localhost ([::1]:35388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjpL-0007d0-QB for importer@patchew.org; Thu, 20 May 2021 10:39:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZu-0006Cy-1W; Thu, 20 May 2021 10:23:10 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljjZs-0005ij-7f; Thu, 20 May 2021 10:23:09 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:45 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:45 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HQoM+YERDiBW3XeuU/F8pymFJ74wzK5HNN00hu3QbZZiQP23fSHf+JIxwDMt41gfpv8GypP082WI23G03hJLVA66WyV07LiFiwPHzRpr69echIC4J5O7QU99R9Z5r0nICpo14F/ponzHZ0Cqo5Q2/LUUP42gJVcbeyLx+IOwMSF460aZ2fGHbggS3ARq14UOtNlSybN6lTRZ9nRnaRh2YXv6iTKU8AJLzKXsCHqky6WuZMLvhylKrsEfajKxYmiIEOffRWgYGSQhUQWvG2pCHShDSUPrEyJNeHDNy7VISmnXDjdjmOyRyyS+PVGYdptYD8bl7mS4a97oCWMMS+ZOoA== 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=UUPxAsSjiNSwemoRilHrEoWmwSG7WruJN0bBOyZT2m86OlOpRsnZuuSbAxWlLRdR6Q4nDgrPDT53MpJKQ54lwbrIlP0N1ID238zo1FGfDeFjcpIc6HBiP8S46Y/Xv/zbdEFnOCjUM7A3ktzWqtxiysxkY6D4C/GDHoa4inzbD8FEvAPkLOUaQ/WXMlSNqRTbgyfD6jh22PnPtDLSE6SVJpnpWf4Ef6vmDdpz4rsnR0bmxdrn29mXWNmGsnBBxmkiozWPaLLixe9cBKiVUM+vvWcNHtL+0v7DosRUKjzqSdRW39O0iRlECrarOe8w6KcWy0sIeP0FZqiTIzOebjmGZw== 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=pq5AFcNViJ4WJqtI+MOIL0E+ZgfWtfnkydoS4pPaakhAmTrS3DuXdq6vsIXGBauiC9Baw6cEqpm2/DKa0uPu+H8sKy4d8CA/sZwCcU+UwO9K3fCFMQ/reujCnczcxGYuNUxWIvhPGYfmr/UwXOlVgwFFY02EnAarjINvWntO8/A= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 16/33] block/copy-before-write: cbw_init(): rename variables Date: Thu, 20 May 2021 17:21:48 +0300 Message-Id: <20210520142205.607501-17-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 3eff4466-5d79-40dc-c899-08d91b9abc86 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:186; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0WNW5xQWixMoeYIRtw6tjc+NhaIzqptqMjb3Q/w/NPXuC1u+WT96uGUuMTxOIkyihkaBRkAaXWoO87JwgSvYfuWhsiUdzo07F+ipx0sXrYOdJPcGna79l4URzT9uHX3I39E5uHwCS522zXE0Jn6jwyfnjAVpgPI59mu0Ga/b6t2SSlRYuYGnHj5HOgVoHsn3069TU9yh1AcGJ94ayUlRcvIHvFuPnp0uUjPHLjp/u12tiDDmgq7PecKR3p0JqpEdjLYlsMVlDSpXsUm5M1l5GEzc3SrzdFps/YL+NDiy6g7ALABuo6/IX6RrWw38C/9tEGj6cAXVopKFqrUnHnQKnpSe1D9ck7sEh9auwQhmLUdsXFzaqAwfAtIV9GkvZHIQ4ob2VuUff5PW5R7qL4dIP5LfPjKd8vOBNZfDMpLVKh+G4UaT0vXYOsXXQdAoqN/LqHgq2sLEnThT9pqeJ2GrHPTtlOs/wMeDGF8dL0KJx8x06jIZYubqiXDXdWmjhUfK3y5pBvWGzGGomJQs2OhYEeui6s5jvYsQ5B7Ut/20cHodxanCEkLyM2DtMeQrKL0l6/cZO422Ag39CoA9K9uibcS7pEYymk77MJUhulPGWKUHG9UHbLsY4aWJMNxy9l4ZLUSbcroOVwCh+iK9thv8qKd7h6TxTbku4yS1fH+i6iqgv68cdj/GNdbQbD2LHTm7 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)(366004)(346002)(376002)(396003)(136003)(39830400003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?D+mXHNMJumJbaksjS/SIn9+dGQ5k2gz4PX+vSggCkjbSVSRRP9Z/hQcJiXi5?= =?us-ascii?Q?PMdECD5PoVFBMYVUOW1qIIIWVww20qslN8wgMwa5rruUK0gZFmG+eDyoKQg8?= =?us-ascii?Q?nEWXZPMv18BWx9io57hwccVwXDxwxzn4Omkz1G+a3nHdu6u6iTp4GMspEdCX?= =?us-ascii?Q?EcpB0nV/5iN0yRJL5icDpCSikQvUoTfvBT1k39SwlmWpAfdg4/J6u8UbDZRk?= =?us-ascii?Q?8A0NoZFWSsjKdZIjz0s9d4VVRW5LzR5fUpxalxOBYVPUpBtHjIphkz33g7Uw?= =?us-ascii?Q?gOihOMddBLTXdJrnsR9YOC7u4+PmDJcP3xXXCZ7JP6uAvPnKyjhAISjzM/so?= =?us-ascii?Q?3MiqdTOhbWA9Xs6nXUdccXGpgO7Cw6S1vyHgb56eCkRKpxw8V2ufvn7XjJWu?= =?us-ascii?Q?ffRY3kvd1AFIM4QIO7v4m+r1+cokJo3TYB0/hjV6K18t1gUe26nhWneWJNnK?= =?us-ascii?Q?IakEo7jAKlizirsP/p+EEy29NYLz/djOX0ho90Nke5HAaJ0arbe+8/ig2z/1?= =?us-ascii?Q?r+j+uAYlBU8GkP9sXx8kJB0QtiOmzSe0yOAw+sOEsrZq+k/KcT+IxqlzVssy?= =?us-ascii?Q?3D8f5GCarxoZ+KxFMfmP5Okq73GAv54VkT/EjmX9FGQNTw74L57qiqBeEYmx?= =?us-ascii?Q?VQLwbQckgMYPG6a85ccHIJaPM9bpMDdy1TET5bmX9C8efZNDtEdTzpyWBx44?= =?us-ascii?Q?DdBccinZKyAUYpqMi3Sf5XTZt1DFzMfMT62TryTsWYGwln705ExadQjuRN4r?= =?us-ascii?Q?JabFg4MK0csAQmDe6nU7e1eZur17VjBE0xZIgLtg9meWbkMRXm2GBq0AHs9M?= =?us-ascii?Q?Bf5Mj97Qfp8Bz8hN7EznNFD54GFh4Nvrn1IOMYZyariY2w8YsmocBEa/VBwl?= =?us-ascii?Q?v9O0Lxr9Zklo5Kc2Gm4Vi7tyryWXXS0fXuxNsjCzmphyHapP+fko/5kQUCr0?= =?us-ascii?Q?HuQv7d22HMu+2f1V1lLZOTAvaFlLBbbW0yPJffUgll29KsVwyNObBq/pg64A?= =?us-ascii?Q?LsJbsQIIumBeqeaHj98wtJT11mXu+ZUUA4MguOfVWFVGGbeKFd/p6E2imyky?= =?us-ascii?Q?Tj4j5GMsK+ZUUUsAYEyorAQ279SJFAKKMuW7SReOqS8i1sditr3l3dCluZBE?= =?us-ascii?Q?fEPkX+wOgFfsYpRzlbYF4t8QpwQQVy5g3WxYRctoXrhmt3BkKJ5Vbp3Fw1Li?= =?us-ascii?Q?Fo+GaHiWWYrDsJUl4hwDJF7TXFFROG4nNU7diURh/ZxbmzyY2DN9Kkv69NMF?= =?us-ascii?Q?erdchZt4CHBnbBUZ2JOHXZlFbm+bMz4CE0/E72FoqEagI9JotIvYAAAGBlH9?= =?us-ascii?Q?3gbdSoeAqDYJGHYXUHSfPSUH?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3eff4466-5d79-40dc-c899-08d91b9abc86 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:45.2972 (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: hIFl7MwXxjLpRqvfFl21bugHvB7w1P/ac3Tu2cGayf30eF/Z66ssqu5C4b6VDBtj+Ym+e3HPpNaYPFYUSkLie0BAk5CtfK9QHLP9BsE5WAk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521259; cv=pass; d=zohomail.com; s=zohoarc; b=EFwuIifx8qKAblEBSd+UQnKJHnR5z2uVvvYncwqcUh4pZNipM9YuPbA555AhWvxbc9kMBLlqqu3lqEUmBM8vUJ1ITr3+0yjjJA6ecJ0REhegTdSIRIXSi/gGFklLSH8pyd0vf4XDa5xzkDfp1QIzdv2KC60GdjCUMXSe4G6xZEw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521259; 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=RaJv8oQGCESDPDW78KNAKAu3oEDs8OViuqL4Z3vuQWq9yX4DNWMM/7izMNcArMdSJk1Po+iMIPCnSubFIq8Dq4sLQQ1TqrkGJf3PrV50tJ/ai2KCoqgcbW3AVb1ihlTr2dheEN1VmaB/um1SHCLi7b2QdpRWPVGVom9BVCUqAjo= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521259872211.42715587870657; Thu, 20 May 2021 07:34:19 -0700 (PDT) Received: from localhost ([::1]:47464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjkg-0004Wk-LD for importer@patchew.org; Thu, 20 May 2021 10:34:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZv-0006Iy-Ms; Thu, 20 May 2021 10:23:11 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZt-0005ik-LB; Thu, 20 May 2021 10:23:11 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:46 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:46 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YwMLVqDmt3U9PTJ6argVzwLQz/R50dKk1O2oZmLOCBuqfsdrYiQKSj7cgioqCOL+zSVuAn0n1YYPQsHsTWhIBS+K8pH3xunAtphXT8PXtR/JzrPDdJH3WpSYErutwhaqrKfdJxX2ltUtpSwDKcKdEpizjcml5/0Kxv/nyqCNQ8kAgmZKLFnPuqJL9EWOdFUvUwKGDcou3QdMKV5Dma3CM4WGjKCJYbWfREx68rh04eFjH6/85SgFLmzQBqp0GTrdatyFgzzAE77J/OpVbKNlhj+wnQLyo0xBxlG7eeQFc26QLfrnOFqiydOrCLW6INB/8aC2I5dAtsngeoHYSjGc2w== 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=Bv5NFUCywF4epFiLzqgIMD/qvp7zbunlO517hLP23xdAX+0Uyr0Mt2VsFeFk0406lnqxxFyNqd/B0tKC7QCorCYuKS87AS3jC5pWenwXpJn0u3Rk4BFoNjHSA4LVClBMnWh/ORnw/pjS+mEh0GeM81H35sydclekkeSgwdAa5qsAK9zzoQYtOCtGQzfvV55SGY6KmVr6gKbPmAxwv3dhcMWTPUy97dPorJjI4rlzjtO0YORz60qtZ0c/joFTGYGcj4+FmyoRkjlaWn8gTWKbMxfl2C1W/FVcU0Qphr7vBX3Pph7/ERy0eYRUMJ5iRHB4jcZgZdQRi51zmiEltXFpQA== 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=TF/TYwqfvsz0917e6t0CNaWzVR4yG/XU30Wy26tWFaSHxuIKrVSrmhhDRYXSBjrj8yDHS54IIvq/Rj+e4+N2hpoKB4X7gFSYuYcVPeUN+4zsTnUYmCMc2A6O3MXzi2nhekSWVJzzSufcDf5T3XkwRpB/U2Y4ECTWHEJ0/GLSGJQ= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 17/33] block/copy-before-write: cbw_init(): use file child after attaching Date: Thu, 20 May 2021 17:21:49 +0300 Message-Id: <20210520142205.607501-18-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: c0c87a2e-967d-4d91-255a-08d91b9abd69 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:40; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vj+7pBhTGHoUpY6cbdfXe0HVIGSYiY8gzPcxl/OljKy5kfTWYORcymSoDA8bSvjeUUq4Sx7db2t1vJgChje8X2prgJGyV6FdjJXben3RUEARCyf4BhaYatVYKVkazuPSF0dIm+n/DL+qSgJjYoKMXks9C0VVFWHbGb0JIqy4dhj4YZWC6eDpM97kFFBgw1JYHnQDduHqfUt2TgqRhfm3PEVeVDvUVKkEwIKzsvH3NuYyGxbFagP5ViJMfvqfFbDpUyBUDNMICIIg/+L1IClKS1Xc5RQYmetySOSjiQ823ja47spWH85lvRcZu2uNkhTYp1R3Djv5g9cxq+b244ahKbkXm47ImwAHnBVNSJfHZAbzVsnV5aj9YVcEN0qFzTp1BrBCjup8twXcKmwD/laSlo8bJsRnsvtXKBchLUIBdlaXjhUnRez/xsF9rIacMnz0tSF9Dhx2GukIIGCPLVod6CB1WF4YuT2a6e9eU/5FaMrosqXBa59BWsgmCJZ66hmwSTqEwzY2sxQOwGvRNKIPeJVHQecyN4phIKY7G1hMpwaDfeKhhik9bL4SlkA5GShjdnb0HzbgFywKPjH4LLupygfpCLCfNy6LdiPzoUZPwlL215nHaGqQIJiV3noHi2BarAk7fLkZ45UQA+MupFFYN/jZSZoF0qH2GxUF7QDTcXxovZcXECNmOwdLlFcQqHkT 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)(366004)(346002)(376002)(39840400004)(396003)(136003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?jDNikNd6P7Sl3rQ5oXK9QqY2mlYmSzat74sYpa3bdXGZ4G7qjxZjQV9twf1n?= =?us-ascii?Q?sqrM/HeBap5kjfCVkshPC9iZ8MywKRhmAkeBi+d5bCagP0RPPg6pc/TqAmXq?= =?us-ascii?Q?k1vDd0nhPPHOfI40zkawP0X/KREX+7O1moZkJUQ9wWz/DUiVyvZOfQveGQXG?= =?us-ascii?Q?qR62fABYTuPwtOf+/ir197dUGvffBBpX0/+TVSfCH6BH2WU95aZ3lSKTFuJa?= =?us-ascii?Q?co9Ki8OywYRn3dATrjmN1eqID4B8Uwo3eQCf7jRUa7gMhAL/KNUqZsRQRA8v?= =?us-ascii?Q?EFbqpszBV5tDIpIK7ToQUWCp4HeLYxLVLM84NoQkrwwBvOEpgskKvcoj6x98?= =?us-ascii?Q?FOC+y6lYSE0cPjr0j1ZWqE7uSLleeLdB7AreDRmXf9cANwU1LX2nq/ksFxbj?= =?us-ascii?Q?fFDmpJlSX4ehSo6dEztlVRMxZwWi2sV0JK87z42ZTRmY99BTS6wKFRk9QT0A?= =?us-ascii?Q?q6703RFbPHIGLeDtuEu+0sDT2TeiAwG2tkFLY8B7ycAgDjHiXq0kMFeoNDpm?= =?us-ascii?Q?mbXfEbGZH+qB4GgWO8k3D0Qx0/9TjEi2F8vm2n34K2eU4QTG9n6TKPh+PRFu?= =?us-ascii?Q?1eSP8j1DMVYmQdmdio3W4IaJee/T5yWpUVGtCiqfZ+ZcPBQgePk3qTT8DimI?= =?us-ascii?Q?j0fSnFEzzt3I4NaoVZif8YMhpKbj0fTnyHq/pH+RGzuid5VUhxsPxdyGr2F/?= =?us-ascii?Q?6krapcjDqnj2wASdHr6WTDGgI9RN3Jy3eCMvl/SrNshGkoQFuvaW54yWZlvi?= =?us-ascii?Q?egkQ1tj3rycMz2vU4tlpHM3OTPaZh7zMFuuvFUcHHidWesLSbuf0QU82Z+I9?= =?us-ascii?Q?Dt4+fw+6MBZTvwlXx2dp8x3pOr1G4TGBWXn1FadVEiw8FdfLd+6rGrj6DYE7?= =?us-ascii?Q?nVWr8NS6ySVs7VbHJDezMeS0k3VuPMRUw/hSUnRoMKhgo+gMK7li/ynI4cRC?= =?us-ascii?Q?Hg3c33OhRp/xus2WFhLgZlm3Ymyq8Ne0bvDmiY1c6C95r7xcHSZkiEdHWiQz?= =?us-ascii?Q?NRPqKRl7O5lqElb9WWeYEuXPXtHtt88ZyYNQxk7jvUKwCgtrNZFWIoJD5709?= =?us-ascii?Q?zFic7ORCLX8j0SA3W5R9DcXuo40doW6pkfU4c/W0IsRGMca1tXfmJ2Mlw6es?= =?us-ascii?Q?VHW0nnpXA5NTt1iKEcFOUkgeUaE2Qm1MeC2onJCqJedpdptVjDEv+BuRbZXL?= =?us-ascii?Q?du6H72u/RPmFsXoJ9tSe7FqvX+R3hRrT5ZUZB9ZbwndZk1Ci8Syy+/ZZB8qD?= =?us-ascii?Q?vKUS7j+y0qdTGLxzvxrNUEIzUytDhMyd3ofseY44ifJGQ3Wasyu4MvamVnCn?= =?us-ascii?Q?uNP29xTBpkWNWcSglGVyZW/t?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0c87a2e-967d-4d91-255a-08d91b9abd69 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:46.8633 (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: QOJkHcaEibBpotI4h6jBl1ONrsFpKGpSVl+esoTWLxfGQ/rCRF/6T755WlIN5eDDyUpYPabEbp+KSr43BtKLFzh915Kr98Lpuj4ed+ewhVo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521562; cv=pass; d=zohomail.com; s=zohoarc; b=YpmzYeFu3CsMGGA65ih0k2BFqXuUbbGNCh5Yj4uOkMNVYLKZE3a6r/EK9pifIo5EGs716xOt4dou6UqKFtVTuI6WDSQniCZLP6tK1skqdrXEqdFqcKk037056QmHD5LPLVbsB1bGgz++6GeheXVtQ7RULenzFw2/lJ8j38tBvwo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521562; 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=JDA9K1JXkeUMHr90edWPnuaYvk89QAc3UVnpb6fe40E=; b=FMyAHIKksjjTxiu5dNmTlrkM71c5fqClIpUuTVdfPWQFRsc7aaztRFKUjcGRXDyPNXWHenS1dsv7gyrfg1dDBh87CBPAEQh8Kp9zGMbHO4obHCi5q5oP1jOpir0zxafykMWeQu1nAjAKNF8fc7AbJ7JbtaeCb/z34SyKb7Pgezk= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521562646588.4093852445196; Thu, 20 May 2021 07:39:22 -0700 (PDT) Received: from localhost ([::1]:36338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjpZ-0008Gf-FE for importer@patchew.org; Thu, 20 May 2021 10:39:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60940) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZw-0006NF-Ql; Thu, 20 May 2021 10:23:12 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljjZu-0005ij-On; Thu, 20 May 2021 10:23:12 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:48 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:48 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ee93ZzLSnMciM1Qwdc6ZUxVRUKcW0q9FOcxFCtLEpWrjiIF2mv9mppDRP45HPH1qBz8DynagGBjgXQmowbldNOj6E0pgu1He6zcMjW9EMyozSsNJ7usni2bFPcEBNEJZtGtCxv7wvtL72XoyQXbKu0AM9l5uhFDc0c5xXOMAqcnYrnV0XpDV3zImRuhOTMMyRyEv+zeAEahd20Ou49TmzfqzNi2Rpz9OE+QJVpQ3P4uU/QJi9af2G4/P71N/Vyiukl1scBR3S6GLZBR0wEtuJThKD7obd7TcQKMoV+T72YV5zBqm+9KXVYIhK7eEZqdU5jyOcRC+EjFhlyW5jhwn5A== 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=JDA9K1JXkeUMHr90edWPnuaYvk89QAc3UVnpb6fe40E=; b=H1AEq13N3+Avjs8YJJ9k5KE+zBEoz7KrXhVYi75uYm3IbXLVTuNG2L5CztiyMgHambZHa4DHovBd+R3PAJo58RuBdtZherP6wV5Bq5IT81JZNHTl+W5mS1rLoxCLTyw1Tvn2+L65gLGFUyRCCSszA6tK9BR12ozUmQzJlPaPthYXhZLfs6KD6XmxpUKhVng0BpLPQDkHGPel+YEbgAM6ayYpq8jiXrLE7doQTX8gF64ZR+vWqE2dSR1VvWkJa6fhBItHdqZ5bpzVoouhzpge94H6BYg7izGjedOeIriJ/BGRPKd3Cz9sHwrPyhS4gh6cqEw9mOm4eb7ynfhOdAom/g== 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=JDA9K1JXkeUMHr90edWPnuaYvk89QAc3UVnpb6fe40E=; b=hSwcf22yfiwDQEWuZMJAfhl/W4BKSDy1+B0HLJvQgulROwyX0EKGfJ/PHqoT0pCpmbipc3tCh+dO+uYvySB4PwHR3ycPH7nn9MdVuBTiSxkOqvXqiOnd1LbQ5hgAYYK/AlLgAbuXdjdH7vLajhjZQmnivi1uj1vUiV/TztHZSUo= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 18/33] block/copy-before-write: cbw_init(): use options Date: Thu, 20 May 2021 17:21:50 +0300 Message-Id: <20210520142205.607501-19-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 55f34d9a-2a49-42eb-e6fe-08d91b9abe56 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:820; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HNFbnzwmRZFKRiyQGfSQTVoqB+zUQKDp3slm64XPf3DXlV0Is5SIhiFeXDqyYRGHgioJjSWSd6zs5MTXJXQNiLFZUW1PUuAcJAiKldQrXV7dsJOh65SzCV0Wb/GlYCUxL55qHgm4ar9tX7In5GrBtisNaJ7A4tKorPpLJ2gLOY1OsjeJytOmB8xGOc8cKLgQrwvDrPueWykcBJC0cfv0o5DiY1JvqsYY3NCdyOqbt51waUzssvaXkReWMAPWh5ix8gQZpFAARuLj5fgIir/VLNemmsZBFwlaPiP+GSS2PM27X3BzIGY87iiDbMDw1eY2JMZxxEPlBpVVDKTgcf6ysbBmxsuU7P3Uv+Lw5Sr1hAsXBxDRVtwzhlqe3E/bcRelSKVtazFzSbZy1QajRy4oPvtFgKjo8YhCa8Gt1dmF48yg1DaWLK7iay3ItXbu9Mdk8yAA9A19Ps3iuZo6xGycW6+RO4at9ZHUHkt3PiGt0nAR0LeRmQaymK4cbf1IMvyBBN8j9X83H0jEk7ZAbcQ/u3BIkvg5Q5XxjdLUNJgQN4GgHMGIyIXLrC9BGHtGTxdlDMQ1p5eZsKVR7q7naaVbyby+Zh2u4mg6WWuLlN0OvAZeiML1hPhrdwhbApaaMHfB9A8B0+kMoplWpcsBBxxXrzttNv9aIFroOsenHCO5gwBA/2FIf143s0MbTvLzdeCb 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)(366004)(346002)(376002)(39840400004)(396003)(136003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?jOQVgzj+QTKA16V7v9XppXXCj7L4Ut7jrk+SF+qYYzypdsJgZW1vF2gYOBUm?= =?us-ascii?Q?5lQuY6MYnwN/WBCup20DJd0P4BNfz68dsb4M8VsHPAjtvM8fmHbfgBO6J5ie?= =?us-ascii?Q?9uuI8M+TU9X+kWG0skwRnR4W6hMZMLM2H/+MWqUJ+N+PnipJB6E9aNP06hxc?= =?us-ascii?Q?KH+YwVqtoKtBJj4j9fSO/kNeY4UGMn65bI2Y/xcyI4AaE6RMKk2shsd7fpgX?= =?us-ascii?Q?wu+gQA0ZaSaMUaPfnJh2Di6Gg44bqJU08aExJL5OY8qGABxrqU4s2EkviELi?= =?us-ascii?Q?wNNCbxKkXvJiWd9SpP0m/VXd0LtVGBOV+wTAlXFy0i+uZgS0y6u7aWif60I6?= =?us-ascii?Q?inAa/j+Ap9K+lh97k1Vro1XLMmM/rpiBcRZ4dRkQ/uwMxIpekdxp9aZCvqiH?= =?us-ascii?Q?TaE7jO+1w7llOZB/y79s0x+lXNarmxWipNh28JvtcNXd3EoT7LPOULNmst8o?= =?us-ascii?Q?CQ5tgxntEHFLG4b93dxdF/HXaMNzTdqZAbwGTVLWS51zK8JiKG/lIJToqw2Z?= =?us-ascii?Q?eNb2kMKj0EJdgC/PIoFwI6MVznLDsEeqrMLTcaQf8J2S7xq95fOMQqPkuTs1?= =?us-ascii?Q?eJc/5cJ52va5gvha0JAFunBxlWqE521Gys0I5d/BDZ+g46PB6okeRSkn+475?= =?us-ascii?Q?CTPNW18v9ADFgkWysKt1R/nLqe6NJkkIYHJ3CxPnMugsqvU+ZomYHdhbvP0J?= =?us-ascii?Q?STdGreVeJthjuGbKvxxAGiERECPl8Iss6p0pEo/u0l2Gsq7+JTJp4iAxM/LJ?= =?us-ascii?Q?PA+oSbsSIKzf4YiyPJ2xQKkjK9CV5PESnG5ww6I9ZkNje3NWrVX3gKXNKv2M?= =?us-ascii?Q?4TYOOfYK/CgY2mAZJozRNKx/tvdqJCW87qoh3+TMNvsf4GSf//9MpDHZZx7R?= =?us-ascii?Q?lWTrA4dudibI25JRyUFf0cerTevrxmPR7d9Fz7ZC0gC5Sm9oJREju/wIYRAE?= =?us-ascii?Q?XGNayA+ruFrTA17F31Vj6wnpnyl/hQbp3zNahBQJkAntz5qtkrjmp7536N1t?= =?us-ascii?Q?CtwN+Awkwgyx8KCPzjaIecphbRjiteitPrKHIZtGmpzRrJa8K1sZ9QDzjPPt?= =?us-ascii?Q?uSH6d7r3tyW+o4J2UeR9SvuF/R0gmaDj97ioP1tgeX8BUyZYJfgqhUP/csw1?= =?us-ascii?Q?pyLk/7/zis+RFhU0tlUoknJMKKQJAZzxy7Riy7UQ/10KvEcvGmLDJNIM+7sN?= =?us-ascii?Q?3cKmzjJjVX0i682YEq8QjXEVi17wDUF4FKcfTYopsJ1+3a0XsDFF0xfl5AsR?= =?us-ascii?Q?9XaZu/UJzYA+uLRJ4V0j/DXKMLr0Moj0t0H2fyCuU1+BmKJaIjO+IaJCgVVU?= =?us-ascii?Q?4pcnxmaK1+KCqlYMvujI4UmE?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55f34d9a-2a49-42eb-e6fe-08d91b9abe56 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:48.3588 (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: lKITgsrIoeP/923M2xrTG5WmPtGvkDI7cHLDZ00PIudqpUopXSKQTHj9epEzBFlNGMVwJvHovDf8M0DLMDD80A8sSgmAmnybjPA6TQWLShM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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: Max Reitz --- block/copy-before-write.c | 40 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index 4858dcf8ff..e889af7b80 100644 --- a/block/copy-before-write.c +++ b/block/copy-before-write.c @@ -144,25 +144,21 @@ static void cbw_child_perm(BlockDriverState *bs, Bdrv= Child *c, } } =20 -static int cbw_init(BlockDriverState *bs, BlockDriverState *source, - BlockDriverState *target, bool compress, Error **errp) +static int cbw_init(BlockDriverState *bs, QDict *options, Error **errp) { BDRVCopyBeforeWriteState *s =3D bs->opaque; + bool compress; =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 @@ -173,6 +169,15 @@ static int cbw_init(BlockDriverState *bs, BlockDriverS= tate *source, ((BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_NO_FALLBACK) & bs->file->bs->supported_zero_flags); =20 + /* + * The option x-deprecated-compress is only for internal use, to suppo= rt + * compress option of backup job. New users should instead use compress + * filter, if they want output to be compressed. + * Moreover compress option of backup should probably be deprecated to= o. + * So, x-deprecated-compress is not visible through QMP. + */ + compress =3D qdict_get_try_bool(options, "x-deprecated-compress", fals= e); + qdict_del(options, "x-deprecated-compress"); 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: "); @@ -210,6 +215,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 @@ -221,7 +227,13 @@ BlockDriverState *bdrv_cbw_append(BlockDriverState *so= urce, } state =3D top->opaque; =20 - ret =3D cbw_init(top, source, target, compress, 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)); + qdict_put_bool(opts, "x-deprecated-compress", compress); + + ret =3D cbw_init(top, opts, errp); + qobject_unref(opts); if (ret < 0) { goto fail; } --=20 2.29.2 From nobody Thu Nov 14 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521453; cv=pass; d=zohomail.com; s=zohoarc; b=XDe/H9mAo5My+oC6PIMWqK/ELzHLMej2vKp/FlWvvqDcHQ3colCrGSAReJa++tEZSbeJPzXQY5y/NXDNvoLddl5gi/MS/wx39EnKFMFOzMzHh9tzyqXQhsCvakBEpGe1Qog6o9jS8mcVtEOZRQhcq3MC61MbLFgL9gnZxe2+UBg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521453; 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=RhWlz9yilLiDMYDqzAyAN8F6GaiOvA3qOvlK9zLe/Bw=; b=JYlWWdmb5ht8qMGMuXr56/ABD9dVqIgO9lgXqnox2Gp5BtihJM6AB5U4WGtImSESNWzFwQRnCwHvNL3KZTj7U6wNJS+w5aY6P++c1Sq9NqbC4HZtI/ep7TGyDbTxOqgW5Rj9iAw8Jv/xEFbTTF0gDJ99D1A02ZPuYGh21t4CFuE= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521453285517.7869408192689; Thu, 20 May 2021 07:37:33 -0700 (PDT) Received: from localhost ([::1]:57224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjno-0003DB-1e for importer@patchew.org; Thu, 20 May 2021 10:37:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZz-0006WI-2Z; Thu, 20 May 2021 10:23:15 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZw-0005ik-CW; Thu, 20 May 2021 10:23:14 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:49 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:49 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NkUM/kORkqyV3mnziivybqephtBYGjVELRqC1EkK9M3qk7dyjI23CfgzoaTY1hWOaXtBMiFmSaSuvLlw1WaWknOdI6dvkUcScqc0hNFnuHoV4kmxxDLQ8tU1y2EnQxu+pFAP67+oGmPXfNzWorDIFCPMIG5BZmAfSnprmn1HK1pOxZPVFt+MggYN+F/4XrqMMYiweuxxlgSdrPkGbxZOsqq83211hsxHyAmoBMIwT5KNu5KK6h7CJalanSw2SczIoaJpmp88DFsz3LsJyzAYxKOmvlxcrO0pZDwWK/Nay27TwButIBTyMuUd+cvFnUwlDZgJSANI6B3tvvTiVXMiiQ== 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=RhWlz9yilLiDMYDqzAyAN8F6GaiOvA3qOvlK9zLe/Bw=; b=BO1bIylnYfJHsB4wjaeZiANenTQVRMzRnK0x0ZglFWTXpZxtordLDbW/ZNM+e2UaHU/PaseXMCnMh2NpY+1JD4l7rL+KEdKT/QlCaU1zRn6KUt4OCxtJZSB4zqKTU8mXuW9wPQH4+Pyk+lFA2JxMMz2vnYCcXdCmAyTe86wA5fRsVL7k/aZHvYVFPsydeLq1SSYVYE8YQ5AA/Nakh9NWUlHqiEZ9PduhPi5SyuDeeRMPfmwJQ5I7o09u6WjlJcoOUpDcI75NKYJEqsviaUv5qLI6ZDsUheqF0gY5vXKfe5AJxg3FFa3qJ4AvHMt4bZNISxhDBVx1wsd15FCFZStsBw== 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=RhWlz9yilLiDMYDqzAyAN8F6GaiOvA3qOvlK9zLe/Bw=; b=eddNyjT1jt+mtc3n3M5nwGV+FzL66EsAVIuEakDvcQISa2Ch0UKOKqWL8PjORKpZrcw/EQrDWfCAx0PqbQ5zqWojH9jpSQleWFbLoaRMQoYcckTKecK29uz6ec7MQNawTWn3MWKkHf7A4E4q7nWQ6E/ckkM2X89I9PFhE+Nx+RQ= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 19/33] block/copy-before-write: initialize block-copy bitmap Date: Thu, 20 May 2021 17:21:51 +0300 Message-Id: <20210520142205.607501-20-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 35eae6b5-8b03-490a-5a65-08d91b9abf38 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:194; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3VSeTEn6Uida/ePTq7Fb4XSWj/EyP8c/DwvpIcxLsnM0gIyaDXuMPI+Nf/8IDmsYIpJS76NOwuprg6c5mweIZ92yQVclKSZSFecpN/pGzRCWaIBuzyeSnrZOKlMwU4Akuc9JmsVEwGkv7rjPW3nPUHkhAD8lzRo9gzrgSx0/vbcn7/YXoYMymJ4kUlsOYqXSdzI2U1tGoIck57LTzPG1pYf7oNmXWnAGb78xkXlePodoe5oeBfxj/mN8S4ruRwbhiUEXUi+TvSp/GS00TV27FmhFVzzg6fvoy95Iu2fnN87VBxwS5H1GAqnMSSm2tCZ+14L16shfh3tXKBs2rKUTaRYWcZabW8b10K4g3wJ8VsDG4QaGxRx+9CgdbGwy6XmKOJk59kU5HSUoLX/l34iAOMHQkTKw2yaD7ac8ccXEmtsdwVA5MdK2LHc5yX8lQK5WAT+b5Q41DlQnEVLflBLsf8ubyIaZDfwKKuMWvfYp2ahDKuZla4gBUfFw+pnT9U7Zau9gHy2B7P0siaj4MEVsi0zeyxwXcWzlkj09S/wBEZWRPEA3Z3b+ZccwwBjF59liKRdI0MQ3vN8M+BPfSQ0TEKwgER/4w0d0ugk+m72cYQuQ6qCKMRBeQkUSGwt/lIX54VlzSw+Do2LWuMxNevMSKXhw201qfT8Z/CbBDavnltRf081YKiKA7HkGpFgCYV1f 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)(366004)(346002)(376002)(39840400004)(396003)(136003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(6666004)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?s9XbLtyhnr4hkPwlwWmiwgpvF4dhfYubQSN/LK5YHIO+LlRTbvn6QDYcGMAC?= =?us-ascii?Q?qjVwZWJEuDgJ89ALomVTjXOvZMWrcrJfS5Zpz28mqbbdDj7ubvx6FJuTbTd5?= =?us-ascii?Q?AVKvVkFTvTmebcdgMXwbvZdOCM22o0JGTGOAoProTpi1p2QbMaygbCYpva7z?= =?us-ascii?Q?XRXH4Jjk2DLUUVPpx85fcr71J+67RqO6AAaOz54HPhuHU0Lf4gO3zcz8EuwU?= =?us-ascii?Q?E1E2B4zD1Ln2yeYafk+vtxquCLrBPr8LlevW2wv6m2/QYpnm3wN5NXOeOLAj?= =?us-ascii?Q?bbLCshLyzuTmtou/npOZCniaae1LzMDMbzV5LbNaIohAH8msBrpGX/4XfZlR?= =?us-ascii?Q?t09dBN3v8qk3qaV1E9T80T9BXLy0u96a3SauL6rNDv6NmbzwYzU6Bd2cf4/p?= =?us-ascii?Q?Gs4HBZmQx4C9sX67w31f05L+XEfpX5Qs10vLxBmElNzFPkqWA5CsGIaOi9HR?= =?us-ascii?Q?zv9fECmOPuyuxUQqCLBd8P6S9JLCxXt+D6QGS46R7UXtRViqT8iEi6OT8/mJ?= =?us-ascii?Q?bBIbfeqHdsTp8d2aF8ys4pmqpGpMIBQ95pZwAM072TtRAFSPVp20Pr2thg2n?= =?us-ascii?Q?3SxgeW5GVjM4+YWDYBKnDlXByU/irMW3lW9SHxft/vs/F/LxLHRcKgS/5E30?= =?us-ascii?Q?iF7ot+4ge+asYCWz4OHBDeCcqNIzTurw0GeEq8KoQ4v2+rQiKD6jHTOMRfz4?= =?us-ascii?Q?iB7/hRNiQVLRMe0mBUC4Ro+02s9XraQ+1qydKgFEB9WyU/W05e7JC86m7iJk?= =?us-ascii?Q?76kb8BujLVLPUonJbbckOVmQla7e1RsiT5bg6gFYEnSkWjHIUP7EIVZY7raT?= =?us-ascii?Q?jpz9h47eTjdvPYiCzPraw+/Cw1gYoC5ww4hBfPhp2VxwkX8gmbTMnbAdM8ZI?= =?us-ascii?Q?tSJMj7vKEgyvMI4sSyYgicnRfXk7wLLoKSmNFsekw3bsV95+q9QpPeAkI19g?= =?us-ascii?Q?Nm4Rhyf4sKc9jokiAgZpNHQH4CD/Q+FZCTG/Fw4ffqVUQrxcPEFaTB0/B0D0?= =?us-ascii?Q?VPOKelI75HhvBAO8ciuSCV6cBxSYj5YYqUzoG8NchCDCpgQUlMRxiXLuPju6?= =?us-ascii?Q?7lX2xFpqXUpyVnd2Ah430oWsMU3YRzIWZo+aoBtDyn0DN2zTZMif1KU/ksAE?= =?us-ascii?Q?9pMn7ZpoBSUKLwb8CSD00agN3xS7wm/I2BAcwh5C2HA1icZygPSTy7XNowBu?= =?us-ascii?Q?PhYzRY8v6nspDHWeHgaVN9nV0+0Ux4nycuoQCWshiEbc8nV1Ctx5u+qezLCI?= =?us-ascii?Q?F6HcHsJ2avMmd7SXY3TIgGZ9uZX3a1r66uHg+O82T+JJPPCzbXD1PW2esDld?= =?us-ascii?Q?F5yg9YfvxxXmxPyXfIiVcjca?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35eae6b5-8b03-490a-5a65-08d91b9abf38 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:49.8164 (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: K/fuSlGhqUza/Dd60NC0yoGoryE0TPGcVTqpIyXI9pzO6eMBsmzmNq7UCWjQut+8oyLK45OyjPwudm43rUdnu5UMgIYkl/yq9SH3z+jOD2Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 af17149f22..14652ac98a 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 e889af7b80..ba2466a328 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; bool compress; =20 bs->file =3D bdrv_open_child(NULL, options, "file", bs, &child_of_bds, @@ -184,6 +185,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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521748; cv=pass; d=zohomail.com; s=zohoarc; b=oLZjQBPwUovdftkcRMFuTqmQ4lqwAV2tgpU4SVVdpCBpB7nPVZ5uOvslaafaxEDS+fenMXcGf5f9+gAdRqZLA1bszG0uadVVKR3LseMWFebeI/XqmsWjboqenxc+sMh3Oy5JOku4nX/UL0Y/fG28jB6Azo2dh+vrJls9ncd6QCU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521748; 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=uEbgov+yQ0/+ZLKoraieYigGWKc/Ll8cJU6HrVEihc0=; b=EQp8XctvfS846YBFA3J4Y8w46BTM2Awki49uDxyxTByzCv4XQmPwuTkatTQtK0p94k006Xsv6m6dODdO+Y+zaSCc1D0vqEpAFEvTWqDm2m/RzoTUii+dq0n9UxIYsUWKgzAUyS/871W99hrrsmTvRrkVgvgmh89s48aUgYemC/o= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521748715590.45428235684; Thu, 20 May 2021 07:42:28 -0700 (PDT) Received: from localhost ([::1]:44968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjsZ-0005jS-KY for importer@patchew.org; Thu, 20 May 2021 10:42:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZz-0006WJ-HE; Thu, 20 May 2021 10:23:15 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljjZx-0005ij-GP; Thu, 20 May 2021 10:23:15 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:51 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:51 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDHV/mWmuOPnm5PubwAwe9IIoYSkPvo9FbB8nIxO6CVjvpex8uNByL4En54FdZWb5GlLCbaqUqNr7Oe1zNBRBP95KQmL1E4448sEesI3v7K8HtknwFNcFfd7brkKZsA1SkJGQCwzs700meLnlTS/ZfOAzJSQooDiqXcLoaACHnbImqj/zsgB5+hHMp9a5s2fjWki8boRtq1ImYugMaJZJmPuHiTYUiQI3SZtCcyVZoGbZGdc6oTBRWePB0jUfg4vJtCCjCgMH20RU7ojAKAQNvs5r1SLSCna26BoILolcoZ1nZA4k+7qLqVuVTp08e99DTbk+Ksg6W0jj+3amO7ZKA== 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=uEbgov+yQ0/+ZLKoraieYigGWKc/Ll8cJU6HrVEihc0=; b=GnL0+xOVyUeoORX8rJT0F+hB8MMHOB/xjlLxrSmG8cRoveVWRLfL+SVJAm04bxU3rQpY/LxXJmC20ZXVC4hS6AxuJqOEfpn08b658TUIEUFs7ucgtappLUW3aa63xF5AyBxePBbTYgAkwo7xxE71PCQQMNyZfyto74BHnqrgVTvIBBkNGpPl9PLAZUp77uECsXC+/fOmXRIb1af6o1iKkzsByOwUjdK7AXtc1ZJpd1gjkdr/dYbrPmoLAu+jrrlOtim2GL17098ytP/celChHGq/mgWgiIWuypw6XpUiIUwt/74ayP+cuKWIS5FyNRvmX03XxTfTJpjNGj4F1gcwcw== 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=uEbgov+yQ0/+ZLKoraieYigGWKc/Ll8cJU6HrVEihc0=; b=c3QMpkgXch9uFA+vWJUhjgcYdDIfajT4aSENJ1GwbdoshPG7T4S43YDW7YL8y0iJ6oyP6VlHTlBzx+PxU5JGps5xkFSsMlRp+2SRU8+gdWMyy7T58YxrAAcAvYCjZrvVQDq7dmAs5Nl6gZ2RCkg1FinXH/3fvRq9ELsinvHVBOs= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 20/33] block/block-copy: make setting progress optional Date: Thu, 20 May 2021 17:21:52 +0300 Message-Id: <20210520142205.607501-21-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: e091028c-5ea4-4066-1e92-08d91b9ac013 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:76; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1Zo8/Y1R3B4qWAgnNnGIw4H00J/l5jF0yEPj8fLgXaoSganR2j0cnUCc4dVgGdjS95ONkhNymvP7u3tfOF86CPAU2ngHGNOt2ChhGyoXP0hkOLyff0H7nl56NxfVekc9HoHq7bbNjwGmhkJw2ZP73Lim5iYJEe6ixaTgfSP/Csnb5nnNlxuoqIbcRwtIEk7pKSzMEvp/wDGntD2pz+klUd7nU4XzOZbwC9cfvWboNiaXxw/Zr4qhCtgaI0m618ts3djr4v72hiuWdVu9citR+4YkQmNcCF48VrCbFLWTErqNp2eVgzMKh0rCE+YKR8Mf9SmTVpU4gIPIoRwK4Unda48eI0Vy62kgQq45XgwmgSviIQlErl8j7skc4aM7pns5PcPTUrFMMNGely3jBF50xr2OvHwmbyykLE2w1mZM4kwZyFxYUfNdLJq+Qj7i/kqbs5TBzVBoYALk9gi0AzBpptXUs6656lK7LIZA2Z1xsYQrijDA5mul1gw7ULPdzFM4gfeDHJjpCdmmkT0ERfmSSxqxeLNiEEsnB+4A9bfLXi5EEmvc1H58W/s1bXxwxNI/AxVULJ1trCfSd2JPJkj9qt6Hls7sQiedniJA//bxm75n0ou8T2GgH6zV9I0k1yUpsKK2p/JUjho9tFmm/xbsehcZgYykl+SJbx13HU7/DkaWa3E0u0KjacbHOBdLraqI 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)(366004)(346002)(376002)(39840400004)(396003)(136003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?+0vniiBL4I+IJkmyCavB9zlV12ZaeSqBhhXX6t+/IZZe9WJx1GRKU2cVmkvp?= =?us-ascii?Q?FdATX3ma7koCia5VSKN4PJSaX5LsCYV9EQo5zvvbIJ+9YbcwJdCqnkFpF5U6?= =?us-ascii?Q?nR5WWkS6Fl7U26hwAzd/aJDjS/d8Xrt/TgboMQlWFBkIgmeIL8eVOQX8WTbi?= =?us-ascii?Q?i2/ZPUzX1RikgotAtmHZjhELHKI31Xa5GJ7frD97fxU1WmPWfttsW2nLuaGj?= =?us-ascii?Q?9GHxNMWoxZFl3c5VxolYAt4Xv2fonR2BB5kk8V7lZT/As8jKjv3Tx1aK7ujm?= =?us-ascii?Q?ei1yP+HKJrBAWnNPWJ8RQfuq+tfu1jmDKRPZqG7mnUDiud0H2Q7f+vZff0Ao?= =?us-ascii?Q?8Xtw8bN+TNfsc3HDkvvpJ8alxF2tdBgym0yOkQjAB++iHRo7MKW1AuzlpUqv?= =?us-ascii?Q?TtPGflhrlQRlF7SQOivy5kcSYOp34HrN+BPrjdbuuaWDN29OORk21JY7kPxH?= =?us-ascii?Q?KvvXvL03upSQEWypToWokB6zeEuovM8E2Putp/fP/26i4drd57whZy3dWwuc?= =?us-ascii?Q?W00EqihvpzgQ2//fL3lgA9Z9bHauhp7QoVapXeCS4WLTw/BgFb8VM7mZ9UL2?= =?us-ascii?Q?TXIk9DUeA4EgNpB4/lHte0wyPN10DZH9x/GZGj7sgni8kyLTfu3Ycb5DuPqV?= =?us-ascii?Q?BM6zUCJ6RQGN1d8hhlXVXRhl0zWy313ebffllrYCPHHSaAz93Ym87N6osko7?= =?us-ascii?Q?QE6K1TbZjfdpLVWYUiEsHlduxJCRYo/MtYuBtbJuNasg4TpEpyJyncZdb7Jx?= =?us-ascii?Q?CXuhivHIvGGmshMGrdtuHIRs/cLzgJyrVy30xZH07d9aNTVUiPKaCkoQVfxk?= =?us-ascii?Q?f05QuMK75Xw+jgQ/Vd6+rqW+zRY8M66jh1aRw69S3K0cocwH+nfGrAyIwGSK?= =?us-ascii?Q?lvjTiV9hdYBg9BLWe/UbrpXi7OqJz971N7JioIawjdjC2J0A2FBL3he08e2X?= =?us-ascii?Q?ZK6kV0eqhhyeC3xGzR3Ix8kQsGpqtga/Ecmw+yBjCCAto/3YtO1Vp78db2wY?= =?us-ascii?Q?EWFAM7czJDgX/mrsUbaM2Jn1epfULpDz+p9bsLh/ALqfrZnmYQRjaVgYPtwE?= =?us-ascii?Q?Np3jOWnaG3pdC57EzavD+Bd2cK7VmtWsNjxddCn5yZf0FpiQvlCMLK/sGAF0?= =?us-ascii?Q?Mxi0Arz54IJDRQVwSOBeR9mxrDQiEKoBJuwwgy8ORRDM779g6xXSz22SYQiH?= =?us-ascii?Q?DootmJcUjt1bg+ZW8oLB2/iO2CDHYTarrrpw0nKo1x+IgNioSiDkhE9qpLEA?= =?us-ascii?Q?c8PDgokFLpU1lckwdQRcE57Z2k7RBcSARa1Cf+QHGw/n8L37J1MO+9sDpcfs?= =?us-ascii?Q?j1xMCbtk2HsZOaTNdCgpGZVC?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e091028c-5ea4-4066-1e92-08d91b9ac013 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:51.2262 (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: eL3+McdYvaGkzyHk/Gwq0qulmGa0aF4pFdwoW8eKWtRfZIvbjJt7WKuL8cUknER2LFIDprTYOWAnXL/61MMz1C8HzaMZu1R9VVO8cwaP5M0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 9389c7c6c8..0a9c3692bf 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -509,7 +509,7 @@ static coroutine_fn int block_copy_task_entry(AioTask *= task) if (ret < 0 && !t->call_state->ret) { t->call_state->ret =3D ret; t->call_state->error_is_read =3D error_is_read; - } else { + } else if (t->s->progress) { progress_work_done(t->s->progress, t->bytes); } co_put_to_shres(t->s->mem, t->bytes); @@ -613,9 +613,11 @@ int64_t block_copy_reset_unallocated(BlockCopyState *s, =20 if (!ret) { 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); + } } =20 *count =3D bytes; @@ -675,9 +677,11 @@ block_copy_dirty_clusters(BlockCopyCallState *call_sta= te) } if (s->skip_unallocated && !(ret & BDRV_BLOCK_ALLOCATED)) { block_copy_task_end(task, 0); - 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); + } trace_block_copy_skip_range(s, task->offset, task->bytes); offset =3D task_end(task); bytes =3D end - offset; --=20 2.29.2 From nobody Thu Nov 14 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621522077; cv=pass; d=zohomail.com; s=zohoarc; b=nKV3PBy0OVlpIcBi9+zSVmwWxdjy4GahTFcS+qkVy+UsxqmCDaTsUSFTYpElDT4Ht4+LPzzu5c3KfoJVp0TErtD3JKosjofwY7u4bl+893kH6PeHyJG3ccoNrS6iaO7AGisey6fIOxtucRS7tTr7Ss3wcHsHfZSq2hSpQZVfcXY= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621522077; 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=MkFCv2BCsciZ8LesdEvJc/HZpXcfswqsyp0HOC6iXDE=; b=hNOiNnOOAP6tOdM5LeNaPAxYrcuK9lzooEcG8/Y13QxtIroRn1ujvLiAfAXc6ff/2A6Up8zC0bXtHy8uP29OPaeq0oeOrqosUbprv6rBc2Ne4rtY7VbcQW1NZRcWPPBPAxAyTZzJs9Rs1Tsau2ugblnsx/3m2Dc3on03oTks4m0= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621522077738812.7476180049384; Thu, 20 May 2021 07:47:57 -0700 (PDT) Received: from localhost ([::1]:34974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjxs-00012e-KH for importer@patchew.org; Thu, 20 May 2021 10:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljja1-0006ax-Jk; Thu, 20 May 2021 10:23:17 -0400 Received: from mail-eopbgr00114.outbound.protection.outlook.com ([40.107.0.114]:2638 helo=EUR02-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 1ljjZz-0005ik-Ni; Thu, 20 May 2021 10:23:17 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:52 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:52 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ItoN0jSqZ8Jx6R8GhfWgzTCVeylrFozJ+uHxfAkDdp5dPu0AO2+SIDznlihgBmgz/8jN/U+8dVNAGRxUz6ro3iBsvv1Sug4gmTnak0UhtZuh69EmaAdeAcu1w4PCrt0uuYB0+tDpxswdFrYYctEq3GNuu4VQEYjp6YHcxeJVcJjlxBa0NVBvfSpttLTSgk/17kVt5m9bzRZK7AHOK4HnyTObdl4e8qBQhbKgJDVR4PmaPUFJqRV9ebNsxIL3olU9qr6nXZIqUksTnz96nl8CD1+N1NFBJmA5gp4Z2O7EN3IMc9n3xmr/JFsO37fCTmCwuPTaWu3bgIG+G9kgJp6VGg== 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=MkFCv2BCsciZ8LesdEvJc/HZpXcfswqsyp0HOC6iXDE=; b=Hz0DYEUpuYGskdF6X9XZJaFV+9FJPE7n/KhpHain4Ca7grQnqi1Dtj3SC9a6Ug97zFdSWY5VwaABR0Yks+PvABixOZmsa95I4rCIeI6z0Iis6a/pbzZ4D+ym/UDEf4YLcnf6PxostLO7Gaje3xYfbx+IcICD5rH9nOvZH/boCYB4VB2Ao+ErzB4bmecdUBCdOwY7pHBT8vlOmx7l/5QG/kVqvYhIP9KtDGH1H2UYTIcndGCWvCzq5W5a7lkKKRUKNUjuteB1R80wmIqgmoSRBfCUbWeyy/MkjYbRaTi+wzsgBTloc7RDr/XGvRhnnovRQpPwM7/IseyTPS9EANlpcQ== 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=MkFCv2BCsciZ8LesdEvJc/HZpXcfswqsyp0HOC6iXDE=; b=nhPiqRdTnxuQFzrYv+eToEkQJwTc9KnqtzsIjFBip9xLEBF/Q1eMD6d7dn8QYxcIeViB0+RHSLauGaUS9kXHKnzuIsebd62QjL5fRXT7u32K/GkAlSfGQj2UVePwLr0uD7dgDDLjF3SbzNcEnRZ6ZL9QcPu/qzyR9+88e2Oih9E= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 21/33] block/copy-before-write: make public block driver Date: Thu, 20 May 2021 17:21:53 +0300 Message-Id: <20210520142205.607501-22-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: ac277c4a-2237-4c32-43c4-08d91b9ac0e8 X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:341; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /tQE0Tciyhwhk1qRWnShmF47YCMJfvUsY8YOUemz0g33O1gFABuTLzQZv73g9LP9H2EAJRImaBNdzDTsRI8RTM+cG++aaHVw5DIGVH843QBwA5Lq6RYL9wOMy4Uh1uOqJbwAnYI9x/BJ0d+0tgzwpuaZhppqzM5Zpcxrifja5X5pZoVAOynEUGQGqjAxa60OZYWd2k5vEMemTQ6QTJuNyZkHPkpSLv1aMSJ6pYEG5HIxk6aGeIU+HtZaQPklQlOEsLUBn09BBuAK44R7GUCkT9L0jI2tZ+O9NcXVNQ40q5MBFAV652Iu1z8O9cc6nwT86QGonyTZzChd62CatUMNGhndwSFF+ln3AaHStSAASE4nDdLEx1TuufY7bgsI3Om0PiO/kmsgP+TtGCNh2SmZq7+meDxYWYKzyNipMcSWx8/nqQ8BZ6DS8Xx93a6uI7b1d7WrZY3DzNvHnH8atfaX+HkYFf/FvQtHtAXZR5QAY9GaYoLUc25pz8ObefGNrMwtKyprz5dUQRlgWPDaG/zistiGQwyRPJX3IIcpx0des5rEi0NecxmLffsxr05gMJOxeWBarIwR6Nj+ilMACdG1VgwCuxTu/a7feW9J2Z6nPSPJfvFCtPpGhiJzbFvd/DyGCOJH7VnqdVbcM1pzgDKIGDBKsc8U9BvF6VLwjiHyLz9LLozJc2t5UigLLbETz7EB 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)(366004)(346002)(376002)(39840400004)(396003)(136003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?xD2b8qvjH+cA5FZYyDHzQ2JXkIaq1ai5eVVbdSty2aPUQIGzwCTxheR6P7AJ?= =?us-ascii?Q?eZlmpM59g3iKH3Bxl5LiHBFjzGogciJaOwIgWTbAnSXVQ/l8bMG2BheEB+JP?= =?us-ascii?Q?dgBsHgRDX8fnk4au2mMn2vHLt6Pz28QJWW3HXem/lZlN8amiM23Yvj2irXcK?= =?us-ascii?Q?ndD6SkPAwxfltTVGJKg1b7CM3VGclDbBHdpzTIpWRlvr7QuS/oq962lWdnuQ?= =?us-ascii?Q?LRjtzJ8mYC+D8ykkgTpozQj/89mJCJmx300YxXxm+mbShsHKW+Cdyn3E2IfS?= =?us-ascii?Q?/4ot4cVEYS5F/awAHx9+PtWHr9GWAQuEK0kUaDwTBiazdUfBOXh1XgUsMIya?= =?us-ascii?Q?rrgl/4EINIE0ptczFin2ILRpUUupBplhvdmqwGKPN4sLXPLfp4d0NcLNSOZ9?= =?us-ascii?Q?3+sX4rMlp4MWaRIqFtIs2dX33kscc+zIct7aEY166glSqqEKlez/UydOsoC3?= =?us-ascii?Q?SvL5JIRn0rKa4s81ZBg+e3i9NMTxJyXv7OruL1O8PCET6GTzUpJ+5nEXXVx9?= =?us-ascii?Q?YvjEPbcLDg6KQzkjk1wrN8rUAX/dwwz+1nO7Pq2lvvvzgUCxkdApi03iodvC?= =?us-ascii?Q?O3iGHKODDztVaae2Nol4tRZ+gyAYHP5ST9SGxlOPzsscMbU0iqki1LeXzLWq?= =?us-ascii?Q?+K7KtVXqZpjvuU4+BGn2el88KpbWcN8zuevcVyHUL2J2mK+ewwl67PclaT49?= =?us-ascii?Q?po4q+NltGpsyQ9yzItetN+WOCQ/JRP3DI3rU6LRC4GWomP0f55Njh9jBSIfO?= =?us-ascii?Q?bzhqYZE5ro+Lbw1XqFRKduCpI32VseTcv2XyvWzCDgrwOPdP05lON797TRRZ?= =?us-ascii?Q?CLuMspqcAiP/GlNEd1h4rzWfVTT+7/n/WDdiVWbHwMDDcno/UbQOPOpJbIK6?= =?us-ascii?Q?A1+XRrz9D5tYhVLOu5nibeKAFoiSA54+ggx9WMnkzAel470lmVBfuWDOpAsj?= =?us-ascii?Q?e8d8imcOljDAkBjD75bAsGiHhtkXA9Yw/zsz0eWxLL75L22W7zxv4f83sLmj?= =?us-ascii?Q?biD0U5w0W4bmAZSTxZXFWwQv+2lVIu9W9ciPMGJNnBqNz1vHDzUyiMeV8q7r?= =?us-ascii?Q?+qElp06/AwLDd6xfcabtAlsvF52cOxHYFZ/gGXCT59v8eLVZt4PnqKtBbTyp?= =?us-ascii?Q?gHYQgfTPUnDiBq2DcsWCYXqB2grZAkqj5XAtvLa3lECE0kHVIPINvglZbPM/?= =?us-ascii?Q?WNAxv9fz0J9EmEN2/8PZE/Y8DMaIgMwRUoy1MNnsMkqyHbL0UttpDEAAyv/r?= =?us-ascii?Q?PKVwLV6Xz/Pxkk6BYX9HT5xkW4/m89TTEQWmAuJ9O5HpvkZb01TXI1+Xziei?= =?us-ascii?Q?AW9FIBmfpQxipbDxRWYt91C7?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac277c4a-2237-4c32-43c4-08d91b9ac0e8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:52.6380 (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: iGYSCe5WlMrwoj8ctocdK5KNBE5i5sbdxAx88iY/oUXZcJCqVV7zCimdYN3rxYKf6BZ6Tta7MlMTqYcPcfXdmo8o2Tfta1hnMJ3gc1wzkzo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.114; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 ba2466a328..6ed5bce1f1 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; @@ -191,10 +192,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, @@ -216,57 +228,41 @@ 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)); qdict_put_bool(opts, "x-deprecated-compress", compress); =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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521901; cv=pass; d=zohomail.com; s=zohoarc; b=gyrtnM/cwWuoA3JLUPi8gCXlJHILuAHkJMWGPm3wJ7P3MxM0I6sBuN4bv5JTfNXfiXR7F1/AHL1zRlEGpuvJc9vvPz9jBfbcrf30cu7ksTTf8fVPJQQRwuVF9muh2WCB+CN6kulo2S9JfP5xD3Jyk0aTLg6GnC+/mMmrIiJUopw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521901; 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=DHX+YWHixEG9j0ZyOvUEmge+MEfvt1U4V3K3x3YbWkw=; b=XvQWKGMBzhnuRV1zP98ZQR1dek+2hvVWxZTVUhgCaIIohuCn32gy/GnEk5hj+KqX8q9S6WEdqsdnB1KcB8V7yRrdjHK9rtpM/gkiu+Af1jNMfh6t3hVhzdfmYAe+z6wOg1ZTJFXy+Xyq1vhHxWJVwr2thqQmbIa8i4f3QA9QBtk= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521901766791.7801056951868; Thu, 20 May 2021 07:45:01 -0700 (PDT) Received: from localhost ([::1]:54070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjv2-0003JW-Ix for importer@patchew.org; Thu, 20 May 2021 10:45:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljja2-0006bh-24; Thu, 20 May 2021 10:23:18 -0400 Received: from mail-eopbgr00128.outbound.protection.outlook.com ([40.107.0.128]:8320 helo=EUR02-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 1ljja0-0005ij-8c; Thu, 20 May 2021 10:23:17 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB3544.eurprd08.prod.outlook.com (2603:10a6:20b:4e::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 14:22:54 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:54 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oQtZwIU3KoG0NRCWg9j9LerjfvM83dx/GISG2vI9GW/48uQYCp7uIGVSAhRpo5WNX9dyMSXs9VDdsfmKeY4Y7C0RU3NT/rOb0+D5td/tgBgB1FGl2hkD5Fuf9Rl1BA8FiyvoDhf09/eCXNLUIGea0M734KDDpvJABnLsnTIEdyT7lLyOh7xW+JVKAlDQZ8LeL+v4zzmebuPpE8TZZpJi6jkikgf6f9DIIjqXqGwAbNxdjY4pyhphu7P4fwAIOLaWx4KtjAMTzamLSWF8g6DjleldwBp053xPMFN0aCZI+eXSX/4s0/CwTKUTRqIBanEoyT1bCBDbhKMh6NMm3aZylA== 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=DHX+YWHixEG9j0ZyOvUEmge+MEfvt1U4V3K3x3YbWkw=; b=LLgfrkOYbwwEzvTbWIxu38HRsI5Fg+3S+zRHCx/UG4w0uyU2iRyvRP8FmkD7uc+M56BnWQlx3ZmwhFZ77gsDqAin9pr/UJsdcHbAfR8dba/O6OdyznBjc1nxeX2CLt+SaGXS/YXC3vEmyCi8PIyMt3sgexfHrsux9EjFh23nxZD2Q0euLGH9dvFFN+1bUqfDxQj6XsFc3xs/TaYYeMOo1peT6z1aoWKgV+XcukOI2+h/v9zQoGt5zVV0QEK12ziUwGYkYqpeSWkqh8W5/ZsZC53BBbrgBi1vkuC1ESG2SG+U7OBXaLzqIlmDfML7RJMcisJHOCUaw0LCYqy2w4GDfQ== 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=DHX+YWHixEG9j0ZyOvUEmge+MEfvt1U4V3K3x3YbWkw=; b=M49cX2aHNZyEeLW1Cj4JFvbjilRskQoEVkNxoRdGOkq/xcej5hWIq16179Z3CDor38qi0E0BrzNla86XX/USDRkTM3zC07pX+EmaxlpCBvqVOhawV5EznPuX1VIy5LxXWzHEBMLuvUpfd5FAv41e17c74gfmX3juQVVnN455Nc0= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 22/33] qapi: publish copy-before-write filter Date: Thu, 20 May 2021 17:21:54 +0300 Message-Id: <20210520142205.607501-23-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 47dbc5ec-0a4f-4ba6-d738-08d91b9ac1bf X-MS-TrafficTypeDiagnostic: AM6PR08MB3544: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bOgVrzLYSe9ug8RGMm85l5Qpnh+/uQSbtHR9nw+tThiuduRjK/MfmcdB88oPStO0AF4cOcQ+xtoS4E5Ynq+AlfybItW4hpX3ANaH1E9xxAujwk/rzhnCJ/BUXic13yd7NNfXUZzh8oaDdqpMMwCy5ufbgFAJsyu0k7LsjhuQe/LS/xVXGwnuBsUV66TwoTTzR3yE3vXngxJQ9tEHovKJx5yia5DUAinDpbiwGeOFY+XVwjMswaXwepdB1ksIl7hqhespj7AIP3azQiFRIaBVp/a5zTq9KY7JuV0xrIKhdOEMV29g5xM1A2/BSNxObKTDU7EEyTNf2G7yQQxy11anXsvaXhbEQkrZxiYpzKs9MDAWT2y0RYZETmJnDMYDnlEw+elazU1RUAfYrLuniiC3FwyWk8twsLymd/KCzAWQeKk7yMys5NHNOpLPB5+if+fElItSF4Z0vQWsxJwsgfxsBwmN7mLqWAkiLeBSNBRC01ko9AQA1hkcmZAkrfeJcLlSqiosb8nhIie3luglwCGA2jdgvMAixJL0/qSptS0NsDIQBE2/hgxa0+8Tu0/ooq5YUu1ji+ZZ/0Fe1xwcRWRMIuDyeNNeJNjrtJI900s/EBshwVXzP6gHZvPv2atLjcx6qZOwvdBcCaA3C+IUi0usnyf7boy5oJ3Cq8OIz0AKH0D4LAvmIwGo611qcTuq7Gt1 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)(366004)(346002)(376002)(39840400004)(396003)(136003)(478600001)(1076003)(52116002)(86362001)(66946007)(66476007)(4326008)(6486002)(2616005)(66556008)(956004)(26005)(5660300002)(6506007)(107886003)(7416002)(38100700002)(2906002)(8936002)(36756003)(186003)(316002)(6916009)(6512007)(8676002)(16526019)(38350700002)(83380400001)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?InoDFTIuEDSGEQG9wuId2jrMHOmYCGao1XEy/7tHtjQDp3rmKuMpvXh1nW1X?= =?us-ascii?Q?khaRh43lhZ9qzUNJTJ7onwE758u7xsFp2RlDZTk5fV8YH39bC6LEB8sahBEw?= =?us-ascii?Q?MvhRGSGZnPH32a1lyHmRqODFCccL5/R5CotVvLYMz56xlrfpOgZ/m5nZb8CJ?= =?us-ascii?Q?vzBWk8LKYURe+9GH/uhygga2Vm8JihlYaV/w8cVyB4K7OWf/UVOCAdMTmps+?= =?us-ascii?Q?jAf6FH4ZLjySdrxirElqcDkRbMSAnCnPjEyX3VrN49e2eZd7TwYjP7CavRmb?= =?us-ascii?Q?YlQPM9F3Qw4W22fK1qgXXR2upkOLUe5+6bfNn+k3cLuZ/6w+amPfOq96wKzl?= =?us-ascii?Q?o1BqubeSN2xxMnjvld7NwIxb7XYpHDUY1AABTyPRI9nV1t7599ARQjlFgVaj?= =?us-ascii?Q?FyepiS35Ksc7qbiVzP35bVUdnKPpLrO336OtFuRNKgIqfVNaI5FWZNcJHflz?= =?us-ascii?Q?zpVPeT5ylWEhnnrna4I6pN3X1s1gFUqrkvU454OCwo0hCVcftsPx54AbsgaC?= =?us-ascii?Q?dC8FP8SPasLs0fbcFf7lmDQHhnRhiUD920Z4Xro1Q0zdp/pWKZs9ByW99c1x?= =?us-ascii?Q?gsdE6GCi0sfFMTM5HJ87qHysR1xu9gfv7pAH2aODhy42itwBXqo+wXaSJvrs?= =?us-ascii?Q?Bzb++Ft6KS1fqJJ1ebLC+wSEmrm6qVBhiHW6ZSXVxJ8Yzc6Oex5bC+OAYmCb?= =?us-ascii?Q?wHj61kB3Rp5zhiFjCzh1hgAJFJG3HMxvsNXZZpsIJ4nosYfWPsMwWZ7pOR/4?= =?us-ascii?Q?U7rC0NmUqHcXL8f2FnFWVNbpgv2UXNCiaeKie1MWZKzeab0nhzbMIkF6M85c?= =?us-ascii?Q?Ph+bBZWQmpf/SvN6tAAQ/cjg2Fy2LvAAdePlc5QScS3dupeRPSiYTinlD7qu?= =?us-ascii?Q?NcwQMjBJABIRQ7WesiqIUDg3nEYFj4nUl/RLiAKme4y6DC2MjhBb9TGrAIKM?= =?us-ascii?Q?JXJeBvl1YZn5FxD0AlJ3dC9WSs8V/uWLExsKtAKKSltCS7bAn7+W68ZK7Evx?= =?us-ascii?Q?wPntKGRZdnD3ycmVudoncjWBpMJSF88qkc3XaLQDIDS0S0ixRPk/5Y9Nkzh+?= =?us-ascii?Q?mXShOjJWedGQJ8QAjd1F7UzLce9Ww5G9yLWaEE5ptxdvS8uMb877zAuIlk1K?= =?us-ascii?Q?pQ3un+PKbXqAxazPNkkLA/1cn07tGBVShYzcPNASM0NMntPB5Z3fOAeWMdOO?= =?us-ascii?Q?dvFvQkMhnEv/i0MKOWO14/eFnDaHODGxL30bMR4BPazxDaMzy7kwrFZTXPmc?= =?us-ascii?Q?exr95Xy6R7+maobGoUqo/415h4rGweLXJmxoZne+zHwFuUszSszO4Y4soAF6?= =?us-ascii?Q?cxAkZz6RCmvm1AtuCfrmHvhD?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47dbc5ec-0a4f-4ba6-d738-08d91b9ac1bf X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:54.0498 (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: i3G9nwGx3QhzIKn084zVsdf7aYWAvUzRqRcEGRidIUfw4sPAE3PAksqWj1hKJgsfrHDR+AosU3tXKKkU+omCBuwdjGPZXrgZ/AAkz3/iNXE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3544 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.0.128; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-AM5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- qapi/block-core.json | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 2ea294129e..8c4801a13d 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -2808,15 +2808,17 @@ # @blklogwrites: Since 3.0 # @blkreplay: Since 4.2 # @compress: Since 5.0 +# @copy-before-write: Since 6.1 # # Since: 2.9 ## { 'enum': 'BlockdevDriver', 'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs', - 'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ft= ps', - 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscs= i', - 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallel= s', - 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', + 'cloop', 'compress', 'copy-before-write', 'copy-on-read', 'dmg= ', + 'file', 'ftp', 'ftps', 'gluster', 'host_cdrom', 'host_device', + 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs', 'null-aio', + 'null-co', 'nvme', 'parallels', 'preallocate', 'qcow', 'qcow2', + 'qed', 'quorum', 'raw', 'rbd', { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' }, 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } =20 @@ -3937,6 +3939,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 firstly reads corresponding blocks +# from its file child and copies them to @target child. After successful +# copying the write request is propagated to file child. If copying +# filed, 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.1 +## +{ 'struct': 'BlockdevOptionsCbw', + 'base': 'BlockdevOptionsGenericFormat', + 'data': { 'target': 'BlockdevRef' } } + ## # @BlockdevOptions: # @@ -3989,6 +4010,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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521421; cv=pass; d=zohomail.com; s=zohoarc; b=gaE3i0H5IO3EVzWjj/Um3VOIMdaUm9Gk9VRWmsTMbqe2vktJRNg2f9AfS443XyO+l35HwlG8mnvjy7z+a6nRaoqC2mKk9WeidHF9DY0boQmMUvjY6lR5SZ+6ikUF6ve1CRLKtg9DcUGoT4i3G20KwrgGUFtmtkeiN05RVkHu6Ik= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521421; 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=Q1i/DRS6eRvPzTuqlrDurmrlDx2uNSFUr3cN0MZRmSw=; b=dbE93ibpxcceoCLW33mF5ixi7edlP2XQlrnWfYlMfaaTWvl0lOSA59S8nBbqRjhhUujkCD6Ch0eXkRl/xCpA3ldX8P63h/2u8Lm/5UcD9qNcBhLIcyV6qulolMw+9fumoZHr6DCkocmHSvcWgyzimhkw8iLlRLtwYBy69T55pgU= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521421761787.6244466207393; Thu, 20 May 2021 07:37:01 -0700 (PDT) Received: from localhost ([::1]:54984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjnI-0001eC-Pf for importer@patchew.org; Thu, 20 May 2021 10:37:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZq-0005xy-B7; Thu, 20 May 2021 10:23:06 -0400 Received: from mail-eopbgr40104.outbound.protection.outlook.com ([40.107.4.104]:55385 helo=EUR03-DB5-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 1ljjZj-0005mG-1I; Thu, 20 May 2021 10:23:06 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:22:55 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:55 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MEuWLaiZtZKtNCNJ+coKb4+B/VdOEHGb+4J7luatoASTJVL2os62rX9rpFEI/W0u1ZlYdHAzF8Nv9QNfhDDO/6+Zzm5tjNc1nbGfuzgvaZ/MnpTiphaoKWZ7IVB19AKES9hkuPYlsxQ6OSc5wFYcWPwwuo4GPT+sOUKifvzaX/ncLJiBBbpEpK8kxp5e9B6iUp+nmfCjXWKELOdhd/Z+newTqbJpDokKGHt6DrM4WV9yTt+ENcdsBxJ0JapPwPhtJVjpwSrzYMGOHRCpLMEn+x+28zzVktvHhT9uLWY8zEayy/b2zJy5DXgN+1BQBapHQFzCUkRztcYAdC6RR0kDfQ== 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=Q1i/DRS6eRvPzTuqlrDurmrlDx2uNSFUr3cN0MZRmSw=; b=KEkwx02aPWgvNLIVjSPNZVIuFEXJGTo9WcOuBzuPKrSWTf25UDRNw8aa5H/V5BVijEHQEGS/9Y4oUGI/+fQtXU+zoo5wxcN/zGN1lPgUzUxYCNIbnC7n1o8vXpHj99hNKhe1fjMKA+xQ4i/6o+CwgHzYsz3Xb/HUJ+JEY0J7DTCxtOOmqYWo4oTX86p+6cJOQf0vWcOH8tRTSIZsmvwUAQrPL4Ck71OeK0P3XYm5kaJuwjhNtItR/58IG5iNkolx8b03i8vOBax2Fzdn6fjB1xgJacHFcX9cePoR5O70QnMzOive/iIqMzTUIUMb7SUDHo8DiJRKvcYT9XPTJdYSZA== 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=Q1i/DRS6eRvPzTuqlrDurmrlDx2uNSFUr3cN0MZRmSw=; b=gWMZEYs3fYQDv+KPJudqy1rKTYA/wGVaZxpWCg2mZE8E584xMr9cDQNxv0HQxA0t1NzeYMixS54fGdBr/INyCE8gMJD6AArCnceyYTwIssAE13VHv+OW9FyegL+DnPd85p0i4UfzWEtpy/W4sNvQgyBDQsApyphvTdUA6l9UosU= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 23/33] python/qemu/machine.py: refactor _qemu_args() Date: Thu, 20 May 2021 17:21:55 +0300 Message-Id: <20210520142205.607501-24-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 1353b1e1-2f94-487c-bed9-08d91b9ac295 X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LHXOT11WL7+Pja7VjFIpHT83uKDDtwbptsCWyVnrv8GgZ5tQorbzPpqhcDXBsv/5RjiJ9YIMvP6CNKhLSWyzglKbHdKaIACffbOobq8TC0XruWIfIYu/xXnZ6GLd+voC23fUay8M4TEa+qKTkV55LsOuOOJ1UwGH6fMOyRMLBqC+l5h+Xzit754LPhVD4ZOfEjmrCSIC4X+ILrDHwwm5ds+h61VQ1uT754Tpc3nu5v5OhwCzWZ6VJZrHpPvBUK7CD8meXMJGsmQD8CshGR1ZUcMnJObk7F8TK+KFINbpRRXP5T/lqq1dzjUNuAiATFveOoiaFYUoouOpZNHZjfqf1tTgT+CDkVPOUcFCWfhQwf5rDoNjxi9RAethJDeI9D0H9g5/hk+Hz+SFS9SCW7EH/GqafvmXFEAlze9UXZyqiqGwEQpbvecomiGZlcE1f+3re50WpfBmxdhC2l95u7NKuAFh+XYKlMj+9IhniD9zoPIR+9CQbLaw8cQN6hhhVwV5WniQB2r/c4ebZEo9Cxvk0dJkkwYswhHHVr6PSU80sWTbqSLLaMDtwtTiBk6gI42x5S8BKN+1D8WhbbZugUvaSPlRqLnMtDf5dxKB6C4FIOfaSxrgL9To+jc2IEtnEFd6R2rKp7mkj/hbZlRHWGkhkrC9BDqvPac+UIceZ+81ou6V9i2OcVZYpix5Ndqcaj64 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)(376002)(136003)(366004)(39840400004)(396003)(346002)(38100700002)(478600001)(186003)(1076003)(38350700002)(2906002)(36756003)(4326008)(26005)(52116002)(6506007)(6486002)(66556008)(6512007)(66946007)(2616005)(66476007)(8676002)(16526019)(956004)(6916009)(8936002)(83380400001)(107886003)(86362001)(316002)(5660300002)(7416002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?J9+26wJG4NLT6N822gYxLhmensaVnJZyQd8OjB2zRDNZQiS8ZMWXTApVy8an?= =?us-ascii?Q?XbgMYAcwb4DfJ+StJh+t4ghVz5kb1yFao3QgiYOacz7HURkAvSyB8ZEFw/tX?= =?us-ascii?Q?CWdWStNCJHvx19xWH1ZDCSoKZvBi0Zib7r6F0L3dKK2yFatOP1F/1bs4JLL4?= =?us-ascii?Q?+UR5XXiv4gMjdS8yoq3Wxz1D8T3Tr/LAQIGB1VP80YbQTB2+oUQJNAAJUssB?= =?us-ascii?Q?jqre/G+/RcxpWgRHGk6TBx9pqkIA0eIbfcczC3WrK0pd1BKN80SMcZDW7Mgr?= =?us-ascii?Q?HcVWyxnIM4w5YsEroY0944RG/xn4aHnCAUO/I4zuBjxPFruU7XCS/cf6oy+C?= =?us-ascii?Q?wgttUsFNIUJIFoBejwiVvcV7UeL9giObH/i581/X1SI00bctL555fwYuLQ+J?= =?us-ascii?Q?P9TAup3oM1ggqp+2MseLCbdg8j7t0LDO/Ka73+d/ve/fr0fVW8r6vscWwTWw?= =?us-ascii?Q?oZMX9rcRbma1YKsjLusqne5EXxEx0dFt41l5BSWfFuKj1lb1XMw+tcq2xc0v?= =?us-ascii?Q?lHiCdNqDLytKpCU4VnGsYhNKhpsZofzM2M3sufKfWQTnb7hV+QWDlAn8DCd4?= =?us-ascii?Q?YC6rEFZMmOitBKzznvg8aG+kahlXWTDfeTCW8l88d8efGw8xhp1wbtoWuRN3?= =?us-ascii?Q?oyIC3yBzB1MQo6aD+RwtKxoiOkY8lb2gSjHtCSEkJybfZBrOGiBYF82k3qPJ?= =?us-ascii?Q?rs7OyYEYILJ4BjWX16KPBWKQuFm255dTBmm9Pm1U0FF+Ash3JOnDntNFCXi7?= =?us-ascii?Q?CSATSbgckoWSewSwzWu2w+kSakmM9bQYwpbzzCVPNAErdYj35zCrpK2XL2zA?= =?us-ascii?Q?ots+nDkHsdwxvyj1bHrUl5zTLzsIDAvyz4v1D6cltqKaMUagDKwzUeU74+S/?= =?us-ascii?Q?+rhLxOF/LYSgnBKYU78S2Srd3nayNZofYF1H5aoTsxGMiqYLFZpVu3/WaK6N?= =?us-ascii?Q?aJbSLUTfqZC4krLT1yitHZlGEg3/2mOM1rGlgflUEvx7mRPLXym+iCh/B4kZ?= =?us-ascii?Q?ujzrrkSokD460wwpWNd6GSArgXPkkXbUkW21EgdxLOiCtVBuaxVvXsCVzyAp?= =?us-ascii?Q?CNmbU3dDHHzLHPNU8rQp9K9YHrDjqxL/25qgJ99sYCEvbSEYPb+5RPtfcm55?= =?us-ascii?Q?Tbcjd3MQpNfpDViX//VTVkNHgDFTsFzsZ0sbxfJsuelU9MHQ5JDjH3w8iMpR?= =?us-ascii?Q?+emWI//BJs4cKmI58KNItIFvz/14/FEYED+67dZMHjDfjwz+2ixRcaZ/GoQF?= =?us-ascii?Q?y8tCxsGo/xJ3JH/kAME3OehsPo0W5JsYOmn8nn9aGivzetmqwDQikcpUVuP1?= =?us-ascii?Q?xh8Ubais11AMBuBVpBCWN3Pk?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1353b1e1-2f94-487c-bed9-08d91b9ac295 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:55.5502 (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: J8UXQuwsN+yjFXW1blxUBm2bBGAoyK5B2ev6DvN27kBqICAiinwJkXMmOfm/7cqvfXp20cZ2CxqDVY9BOVECkTnNZqFZN7eMHjW96Q5UJg0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.4.104; envelope-from=vsementsov@virtuozzo.com; helo=EUR03-DB5-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 --- python/qemu/machine.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 6e44bda337..ff35f2cd6c 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -541,14 +541,12 @@ def _qmp(self) -> qmp.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, Any]: + if conv_keys: + return {k.replace('_', '-'): v for k, v in args.items()} + else: + return args =20 def qmp(self, cmd: str, conv_keys: bool =3D True, @@ -556,7 +554,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, @@ -567,7 +565,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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621522193; cv=pass; d=zohomail.com; s=zohoarc; b=H8rHDmnDX3lWu/CUGXRY3rot/A2FTrzRceHEY9XYi7W2BzofKx5v+blFgsnBI/c6Vq2zo16TPgAJNu0FDSm5jYv4mXwcBIpQBrGhvfoTMJ678XfraOfW9VeLE2Tvrsz1oBbf3mdTIzVjTdnYTULdFgbZeGyO7+TR5NsvpkU8yWM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621522193; 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=zKA9a+imlpbK6vvzlMul+KVAuXATgW6Mc3WbFxYkqgA=; b=iOjcz7Ne83H5Oi0G1U0SY3rKt8egr0IpWxDQGpHIaPnPoc3rHbrWuag3gefTCILA166jk+YlZgi+e1/BLwo65+tKj9Wm+RlsvbFYaARvnyvDf8rFAArMku0cEhQI+SDbd01vFqOeX9MdUw6CTp7OHjJV11pVf5sSE8KhlSGEPEw= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621522193448279.90011444017387; Thu, 20 May 2021 07:49:53 -0700 (PDT) Received: from localhost ([::1]:44518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjzk-0007MR-F5 for importer@patchew.org; Thu, 20 May 2021 10:49:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljja5-0006o7-DS; Thu, 20 May 2021 10:23:21 -0400 Received: from mail-eopbgr10092.outbound.protection.outlook.com ([40.107.1.92]:6738 helo=EUR02-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 1ljja3-0005se-O0; Thu, 20 May 2021 10:23:21 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:22:57 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:57 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nB4KF2ZFKShVWvO6dfA0A4a785DgtsBrMKu/8sKDMdcJUjviz56lKyglcjDZIBMLv+4Q5dtX0Mli0OwtCpHB5v2ZFu3uasEzEAEBeljSBxpfRWmCNu9KUS2tyl4L2DUo0tfsyQCRzk74JqqmxeNsLduv+DUyOJ0CXjwYIUAIFmUnT/Ec+SQmYb/AUK2o+UxIgxCRhs6OduijtgDctPKDEOiq+CrDMAC14DQhnzZ/0dMR8KiqjCJOInFVsH6lOFyUUWSOlv1VsVyKmBPXqSmzg2vn4c3Af7sWFOABzfyxMSbHGD9qylTtOFUquPIAPb8zB08dCM+AlXZvhoQRHu9/oA== 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=zKA9a+imlpbK6vvzlMul+KVAuXATgW6Mc3WbFxYkqgA=; b=Oyy3hmE2zbuzFI30ZOSx362KPY2klovSqTh2FsNjJ4Sh9zdHTJiqqJMsYxGk4s76JFuXZfls6sjvu6bzfGrRr0F8Mw7NJdK60smTuojOtC8P/EKKoSGf2nwX4uCOkb7VxWQeWhX0pnV0lSl4gPaWOVMTOaII97u/5LN6WtbY/w9Bjka9dgy2fT2+5ioNrOaWdqyqEmnkdEVvfamZHoN8so0TZRYLHGCGu95wtlsn7FehEBn6JET5I/1n93p1C+fvUayisinjqpCJj8meU1FcdUL5l5Ai93bg5SZIHbZvtlCQvuUHly0Qq6if4X1oVcujFpzsP+6Ugf7U4clOTnx0pg== 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=zKA9a+imlpbK6vvzlMul+KVAuXATgW6Mc3WbFxYkqgA=; b=V3OjDhNnFl5GpO99Bjc0qXHodz7oCfGacV5JM5bbZWXgvG/XPH/2j6TNdg+bpTwuGKb21xdDhbCY/RIBsjt7n+xV/D5SJJ5TgldxhZxUPtzHAZcmJz/WvqKDzbaa6cfgycHXYo0GDaO0y0tjtcZ07GEUHIy4VhyGJetkovnkAro= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 24/33] python/qemu/machine: QEMUMachine: improve qmp() method Date: Thu, 20 May 2021 17:21:56 +0300 Message-Id: <20210520142205.607501-25-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 907e13c6-d4ab-44c7-f823-08d91b9ac37c X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VYEtP8IXyMLbzFpsH55HnVCIYwPyMyF/Tq5ZQyP9c4DPxKluTUN8HOSWTVW1D3N1CgcyLkLd8OuPp7mNRjjonhkbO7L9GXgOsUpr2nHwtqUzA8VLebSU/k6UnWQMzG2sWGEN82uAucOEr2iN56uJN19FPvZehLkgmMF2ok51HRZJrCbhDUO/9i5myRqQ3IRQle74XovyddAWi8eVkJO/e86To2e4yJgJH2GMP465jOS8hxRJZHOD8hicVPnra84ZoEn7WGRytDEBCPVY2FD1W0mCXk1YYytlYYbxPosFKV1IQcKht93gxkUqjpkdTrKqv5jVzN5gQGrbyVXB5UpMFRI1f4Z7lHA1FqKFnlL0fYO56jDJstQsQM+Tt6I0pGz+yPai0PmrMNlrJnfQgYH3FBNAmeTjDwP/30Un02HsKDIHyOhPmBSlZdXmcghJ45ZJRqm2xoIfjbLKkw/DJXS3a2rVtRWAAWydHorwwGF6aKI6iYP/EbhFkNi3XQeNycv3pVMylFYz53ccWHppWYAhceIZsIsqtw7Dl3tNtrPoh/rycwjZAF5lVO33W6x7jowrtGRgzaM6L8oYLOMEp/+n4Gh5nypC20uw8xQUcY16QqEvXMruHUVTduZ6wHg4PTHNkwwxssW+jQGLsQgq6gvuSdidruygKzaN9m8PzYmp44E9tRmEKPjpEMo6nQXA5F2f 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)(376002)(136003)(366004)(39840400004)(396003)(346002)(38100700002)(478600001)(186003)(1076003)(38350700002)(2906002)(36756003)(4326008)(26005)(52116002)(6506007)(6486002)(66556008)(6512007)(66946007)(2616005)(66476007)(8676002)(16526019)(956004)(6916009)(8936002)(83380400001)(107886003)(86362001)(316002)(5660300002)(7416002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?cC9Sa3EiHq3CmqJ3j2vmv3+FzkoBMdGuXdkc6roirF2XnYzJLJtJqZSlqfUn?= =?us-ascii?Q?M2SwUzTk8D+I81lGrLfZoFaezFiw2WsVfsmfvSuM4UOgpXeDqF0qfDZukJIY?= =?us-ascii?Q?AkFmRJviBG7P6sraPPEFfOF1KE5h9i9PPTBcYFAPFQ+IBpq7fm7uV0LsnqJe?= =?us-ascii?Q?uFRtyKGiTratwa+ONQKb06u2FuJe3e6UQ5vwvm7jgqIuEmTMcIItYNGKIIGZ?= =?us-ascii?Q?0RLFkdna+ilw3TEpcXhh25TF/LPsfWHW9g6UXS4yZcHl6Sjq/v+EhY9ifyHz?= =?us-ascii?Q?dCFFkrOXA62YBL1u0R3jZ3ge/P6GKX/J/dCPKd9p2T/zhSo+2ZgcLRAhW2TI?= =?us-ascii?Q?ovizg3oSDozM8FSsSC/5kxEeyE9lZDOZrTr4l5ijH3osuWyZ+toHsH1F2NPT?= =?us-ascii?Q?ceTECMd7W3mKj7NYh9631cq8otKxffo0h7I6jlkE8ZCg0cdQm3Q+EU8OgdVK?= =?us-ascii?Q?JZeiZLgeThveqWr2rJsw/FPjQkrV4nRj/8gC8q1Wn3eM0C6P4IGsqR8fxoP5?= =?us-ascii?Q?gkGj4lOTZaLre4JjkP3GhPTsT1GpL65eb/WFjS0qrbhe5ph2IyH26js/OrPV?= =?us-ascii?Q?bpdBGHJBdH1ITlKFQ3rU2ABAkurJEvJDI/41UDjX4CKGHD+3pPDezm5APoiV?= =?us-ascii?Q?V68De4kIFzyg90GiHAq9medF7Vs5JlujEbZWYXUfArvTNvK+xc/AOrtWtaJA?= =?us-ascii?Q?8pSIo7mbOTpyQYV4llrDOWZoX+MTRUOZm2Uw5hbvMRj2sUqb3iEA4V3Y8EiZ?= =?us-ascii?Q?RMevzcBD8HFZqlnMK2ba0CcJJainsJYTk1QZW3FB8iEQuv6nC0KCy5rLc+Ct?= =?us-ascii?Q?jG258sL5G1nnmniaFY+dkpPwvJHAMmTszqLOKGQfAbUrckj2IkjlNre0pDhz?= =?us-ascii?Q?gj5UUADIcHIRUT/fz3Ge95T/kLL3KWO6Zux9TbsFo2F+dVgsUCf+sXsS+EFl?= =?us-ascii?Q?1X/XBqoosUKX3QF3ZzNzqO73Zqkr+4GZpJqXNxQKA1BmWjabOVlUD4HWo69L?= =?us-ascii?Q?ffQFh1DiDFoywS4HEBvmy62Bu7Eir+ZlZZkdnMvDM3m4aJzVjcNY7Wgcwv8h?= =?us-ascii?Q?zkS+V0WAH+R4WQLRrD01WNTUJj0AnYG10oNC6TQDoZptHny7omEN6hYuFc+5?= =?us-ascii?Q?yLLbvez6oAZVm72rsmjvI25OmXjLAzzp9uCMen7pEDAf5ir3WgHiESR+H6eN?= =?us-ascii?Q?JNqKa4ZSgxLW6FAeS4V6dB/X0mNkUHZUHJwZy+M4j3CqMGkEmVw3gt8JPVk5?= =?us-ascii?Q?9j9xpcCM5rwn2uTOGtOU45iZR2CSeeLY5IMZRcm9y7KtQI2ASkUjildwiHKI?= =?us-ascii?Q?5AnolOfzpezRNNEvRTKON8f0?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 907e13c6-d4ab-44c7-f823-08d91b9ac37c X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:57.0008 (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: d01CIDhOnbU+tIcAp53oU7/llrXVwJn/FH51Xcvw7uUpqirrVeFJseD+KZef2NA32m9zgT7KXVTF433GkxCQNXn+++qTY9caT2m0xMmj7a8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) Content-Type: text/plain; charset="utf-8" We often call qmp() with unpacking dict, like qmp('foo', **{...}). mypy don't really like it, it things 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 possing dict directly, simplifying interface, and giving a way to satisfy mypy. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- python/qemu/machine.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index ff35f2cd6c..7a14605040 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -549,11 +549,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, Any]] =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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521733; cv=pass; d=zohomail.com; s=zohoarc; b=BP13bH5JN5MSdqYmqzvSJ1GQU0lRJpZK9PSaqqCVD5hjnHIRpzFnMC3J1fWcOVLyztIwuR5+IeJxoDo6Kgo0RCFakOvcEaZ+nXo1uDocxV/q/Y3VDBEvnRHUfLlWlQULoYkohfCys5L3grq46kSFmMbXDHh0KywWfeOgFybPlRI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521733; 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=S788zpFtUV3yvt0smeND5HyWBA0WB4Bo5L0uTDR4kHE=; b=R+0g0gkWJwWoHtjUHQBPVm/JNNV8eFhc1W4UJ417UyTOlsCaT2NKfOjY0zF9rDlc1Afzu1bYqbjWlN8octLzKRGQbaMZKgTPAHvCndqF93dkBSXCbHNjTbI2isBbtva7Kf12ZYQ7bl+9zWhlPjUoPBGMPRV/58cQoNopDHMqyQI= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521733488356.9307201240413; Thu, 20 May 2021 07:42:13 -0700 (PDT) Received: from localhost ([::1]:43926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjsK-0004xZ-86 for importer@patchew.org; Thu, 20 May 2021 10:42:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZu-0006FO-LZ; Thu, 20 May 2021 10:23:10 -0400 Received: from mail-eopbgr10092.outbound.protection.outlook.com ([40.107.1.92]:6738 helo=EUR02-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 1ljjZs-0005se-Nr; Thu, 20 May 2021 10:23:10 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:22:58 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:22:58 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ldM8tKL8WbE4FXWC+S8eP7JDpIn7vwZ4721wfW2zK93W+qqE7tLteXz9RFMMkvIdpmgWP56pS5TiK0iEA8kFTpDK777UyAd1y40UAGjqvMXMd12wCR+23PM2CTKMiIwFPZeqbbU4d1sGd9791hmJZuC1SdtGs/gAA1H/eVYsKGdplH1UyrRP1z1ywXk90Y5rliNcARKukrqe2cH0o8/IS4ZCTt4uoDye6EH0fbX1o61CeHoS9HeM3ZWlArVIWEH4gK0xCkxX35BKQ1cUZGg+BnI6yrAh9/MUzoJBI816TA9npQ+yENA2lqE4qO90HWzJGde7HlcNBkNOHDJEXefhow== 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=S788zpFtUV3yvt0smeND5HyWBA0WB4Bo5L0uTDR4kHE=; b=S6YxBodnGzfYnqQ12OQve/1egHymqny5rTZKTg7Akab8WG6Lr+SFZPB5mX8Xukil5XeMFlJ0uP/rny26L/SwGpQ875RTDeXQr7Ik2ykebRerYn1tSaMmwk0F5Pah7FLnrA0wGrnZfi+EgKophlN1zCrelY19734sA161HPvr5xZHdIDmLhPZKEQQr4GqbswgsRLczeHFIctCJ8fCVLzTB3hKPtW/LUBCGpObDV9lrjOyKgtBlCubM25c972af74gXWAZ60jCdz0DMs+9xkqVLGI1KTSnq6ybo4pjj6Pf9Pd27v8zkyCbEHjXl9duQlCFMiPUPg3NV44tLBoHQhM0yA== 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=S788zpFtUV3yvt0smeND5HyWBA0WB4Bo5L0uTDR4kHE=; b=tKZF83njgZb30rQqLELK1F1H1uX/9yIyX2qIylTlc0Z1wO2t/LWEaRxwGP0t6BE7N9kML8IAVUA40YBF04lQTUYXe1Uil3xWQ3Y7naxCfhg0vEHhAGhOgusIuJtlQTcvzPfoagxBGAxHDiTVPxLxrAou3hXee0t2g/fcZll1YBU= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 25/33] iotests.py: VM: add own __enter__ method Date: Thu, 20 May 2021 17:21:57 +0300 Message-Id: <20210520142205.607501-26-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 686cfe73-e8f8-4954-7a23-08d91b9ac48a X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1107; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CjGmbon400Ne5vB14/prVuQ+03GcpNFeT33c0wTvg89JzZYZAPlhoC5jWrkI1iRu8HWkp3RAwtZ1EUUgffD26s9EPx9eSYmslee7Xvch/896bVB1GRJxV/zy46RtbQsa0nAguj6jI0hpBt6PGvLQi2X4e+eBJAsJIUrTetOF4Ge5rVq5x+YyYF+jGjiW+HJF4B6B10eaFgYGI1waOGtCCXiDuWaR8oqUQJe+vyASSbDFIRV8si9OJjdx/4km8BpAEcYoxfhFz+J0vZ+5gq7KYCn17/V8yQeX0GN3KtwEsXn/7jZds8R1d3/J+aXedOwBPSNX/J46/Y3EkvsnT9VLjbviuQFa7LuBjtDRmEcS2KRK6eptiMoJNTrjovqXNpOecumNyy6fCBU+XYohozO9PeIYAdnechMBCYsGtv8DlOhcODLnc00pGa6klebil16hhB1hPLLTtpLhlVGjLTbqW8R/6xZuLLo0LT2xHi4+nmp7Wv07qiIslIeCdTdyZ2ZVb5DtV6Rci32jANISIqus7Pmo+lfMY0UErzTKstF7LTVLMAiUjdBJ2+fBPezBlUQv7NyoF9VBIlX17ZskZK3Y5YjkyXlky2/qGW5u9mtuGd+h4RnGEWewcmxBeyFL0e1gnE772erbQsp8FqIYJiLNHvsOF+7NjxznMgjmgM02TikFCogmIGqAfa1oAixz+Qjs 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)(376002)(136003)(366004)(39840400004)(396003)(346002)(38100700002)(478600001)(186003)(1076003)(38350700002)(2906002)(36756003)(4326008)(4744005)(26005)(52116002)(6506007)(6486002)(66556008)(6512007)(66946007)(2616005)(66476007)(8676002)(16526019)(956004)(6916009)(8936002)(107886003)(86362001)(316002)(5660300002)(7416002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?2kS62sqKmMaI+EUiIC92eA9+3xklhdZUzj3z3yR717vma+gDc/k/CdZ2csk6?= =?us-ascii?Q?xs7nnDK9a59Sn0U/JC8XcURG4vCE7RADQr9/YGF5Ez9YQV/y+8szsT5tF1qB?= =?us-ascii?Q?27fBDNy0ULqShqxKJn1snS8dqJWEODvXC3i70NG32YJb9E3/cq5VZnwO8+mW?= =?us-ascii?Q?TqScG4hqCdmMPfRhIJ4+EpjzsPO15hjTolAKJUU3SgsIA3qq9Y2vG7UqxjGd?= =?us-ascii?Q?f6s6StxTk1BfDxab7jsiKHV4hpNcEwTWiltQ8RTqSei//lAM55k3uT5Kgplc?= =?us-ascii?Q?RJ80yEwTNvxrSZm136XHQb2ll4RltK0QIDJV/uHpxm0IcagNi5UNfIdPrah9?= =?us-ascii?Q?2/QecN62cig1jWU1731rsQg8C6e2hjEdWaeTqwF1gpxx84jT2RiAYhElT0zE?= =?us-ascii?Q?6BwdPW2J0JsS1Z8QDCeBDfTXNdVZBTpRr18FuS9KvAzreQQXoivP81o5uNBI?= =?us-ascii?Q?BXgue27ybmIwxlIgnxGLTgY75JB5vu/61QwCRUrYbW8YQKZRMI3ZnHc9Sd6H?= =?us-ascii?Q?VpXjNz9TinfjK4FVBK52Nr+v0Y4sRzVXAXXM6R3bZao/fZmRllNPtX+crAdd?= =?us-ascii?Q?5Q+7OHByYXPHmyX6O4rroX0Vpdn3RAwH0S4FaoIInT5/om0fUGmiY/Xeu1UP?= =?us-ascii?Q?/MoZ12Y1xn7e9KP5S7J/R1fW9/4reMAgAR9fIiweO+tA+qZJOZjUF5tUBK2f?= =?us-ascii?Q?nGHF2MO8TrSj2pVuI/d8yzf6aPIwABADsED+L7S2qvPC/pVuyXEVguX/ghu5?= =?us-ascii?Q?rr/SdR5Ax/jW8IBSINRC9ffIoA597BhNWxqRq3DnKbe9MPD+mF15C2vcP78q?= =?us-ascii?Q?nXy+6qNbBFnME5Nrr2eJ/Ws5Lg5LxXKPBcplhr3wkJgdrutKna6lzNOuPVDV?= =?us-ascii?Q?XcmfNi1cFBfCZlg2LvhaRhS7qDDhwbbyaHMWgGBa6AH6+WNwyjiYTAHVxVuN?= =?us-ascii?Q?pP3YUFjFx9fqZMXRE/tx0ESLfMkqRMxoWaH/u4G+qEj0FyiPOVJmy8h1ov+Z?= =?us-ascii?Q?HX1rphgZesfs6slDE9lBdP83afDEk1K7CVEXFzFn4zkJAex+kgcMDTQpqknE?= =?us-ascii?Q?VRzW0M0tvK63hkpEcRZVjvdAuGR97qwPdRfxLgqXCZGSvi+3d+PZhoWZ35Pd?= =?us-ascii?Q?gcRSlRlQq479EhDhp7yqc3W8PRqggK3/fW0ejNidOZt34tcY5fhfd4IAYdtD?= =?us-ascii?Q?cr7VcqdOiYm1Hfy63RRz5U3HSZqfwjFOTyvH+l8N6+XbqaagXrW+uUa+XY6F?= =?us-ascii?Q?xLU0iFw7a7lWMy+d72A2lVdy+EE0+8ge0jBmYfpiq1Bd+EmK/Ab4IgxzEI1f?= =?us-ascii?Q?T2f4SXxfe1KARy/p7JL2eRcb?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 686cfe73-e8f8-4954-7a23-08d91b9ac48a X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:22:58.7352 (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: BmT2LsLPPJ3BuhyNOLnk2JNLcdgbLkv5XxAZ24K7DxKC4EHTdPaTUhVVqz1ASzKq8KdKiZzd7RNNmehjhuvSlt/Wl1y0mPVH5sAvVyoy33Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) Content-Type: text/plain; charset="utf-8" In superclass __enter__ method is defined with return value type hint 'QEMUMachine'. So, mypy thinks that return value of VM.__enter__ is QEMUMachine. Let's redefine __enter__ in VM class, to give it correct type hint. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 777fa2ec0e..c7ec16c082 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -568,6 +568,10 @@ def remote_filename(path): class VM(qtest.QEMUQtestMachine): '''A QEMU VM''' =20 + # Redefine __enter__ with proper type hint + def __enter__(self) -> 'VM': + return self + def __init__(self, path_suffix=3D''): name =3D "qemu%s-%d" % (path_suffix, os.getpid()) super().__init__(qemu_prog, qemu_opts, name=3Dname, --=20 2.29.2 From nobody Thu Nov 14 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521571; cv=pass; d=zohomail.com; s=zohoarc; b=iXP2VZYuV+tmS81wjFdflZUG6cIRj26uB+nHhWSU8r27k/t6z691iLrZ9OTN/nwxVMITkJk/AvtleyVaIVuoxZVnevk6T2/7kw9Rn+OB1/cjKAvTQDXP/1bbiswKZDMc4z6L3bf6MAa9+aQV5bMv3v2o//5zu1x6FnjpDLEhFQE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521571; 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=cJxV4WU2wXEdkHVvm72koYegMn4aHd+CVc2XIYDBOM4=; b=PZEVC+bvoIOpH1Ru6/O7Tx7axDvMjfx9NelhBdKHIplhgGRNIyDJjulzn5EvYCs38kvIFSvoyg95rze/yPUhlfLMC8HbXVSQy12knwZdrEbFUEuNCBvoVZJBmylDBXAg3/2Ex9jNp6Djolxv33dc/aRq/oApK8ffoq+fwYABjSQ= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521571667967.5732799156648; Thu, 20 May 2021 07:39:31 -0700 (PDT) Received: from localhost ([::1]:37000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjpg-0000In-IH for importer@patchew.org; Thu, 20 May 2021 10:39:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZx-0006Pr-GN; Thu, 20 May 2021 10:23:13 -0400 Received: from mail-eopbgr10092.outbound.protection.outlook.com ([40.107.1.92]:6738 helo=EUR02-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 1ljjZv-0005se-Fv; Thu, 20 May 2021 10:23:13 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:00 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:00 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:22:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SpE+VvvqQiuROhOUQz+NMDR8qS8D/y7UhZ5rR3QhCoGNyEPtng/0zsaaVpGVDkCtqv5FtGWFa4vAaXW3N+zfZjA9qntGXSN39HTsiR14fg9AAMoM36MzCoasdjFLt7XEf+0gsCAE4zKvfkMhA+h/qF7m8xlipkqSNhYVQsoRBFpOup4Sk0MM0IyahGBX1J6AebsrqoIj41zx+HI7FtqdxGJxM/k5j02OYx++YJoz1ftQwIvy57aTJ/SDJMn//J9lV69v/eOFCqpzPtM2t9mzsiui9/uM6lJ4edoLY7SnEFU6xHI+29JloPZ9MbHbweeRVZ8cy2f9ivsOYu9TrCbXfw== 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=cJxV4WU2wXEdkHVvm72koYegMn4aHd+CVc2XIYDBOM4=; b=morZ1YqBYK9xMnzOlfC7DCXkYQbLuZt37jq5K30PBPvmg5hIB9dx4V0L9AQJdQPHYZzBpRbQ7AX7oT6zChr3/U9MI+dkxgS6G4DIFx7ffqqK13fKdngMBSXEFz7QjSczILb9k496FkfynZuQO55Pndww3dtPF+V5zl1WcHesFhM6nJawV7y2f0jWGVUUXa95PDaRrIhpr8ReUAo5Svxh35HPlGf1llwwft8eXpUST1Hk/U0x5ewAkeihQ5SXWeYeKa5JBhAq4i2lejYfOcoF8mSMioIZPlRv9kQBxLcTxgt0HLXqksL3Jux3EweAf2Ejs14fuESjnXp0pxJggmR+2A== 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=cJxV4WU2wXEdkHVvm72koYegMn4aHd+CVc2XIYDBOM4=; b=kL8IQAoxthih9V8SDamwOCR/BjBP9GBZpFJ2YDQvwKbmPi42XJRDPOGEJah+Pr70cwcETt+Y8vcJq74qG5YZN0WVrF11FLmIMO06AcC97iDAzcxdfDovRUF40lW1xfoBGE+yMe6VDnmyIsP65couqOgyvwZP29EzZ0ngo/qoA5k= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 26/33] iotests/222: fix pylint and mypy complains Date: Thu, 20 May 2021 17:21:58 +0300 Message-Id: <20210520142205.607501-27-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 8e47eca3-d607-4220-d676-08d91b9ac560 X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:454; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v3C1Tnd/tn6oEZV79NZqyJaZDG3FuU0dNUSzUfmnQcwhG9eiT8bPOE4XisqmfE3peJXJ5VCezzopVYpKAmQXPf2QGOoq1Fb3JvcNIwOMSAfybUtlTfOttu4vxqD8QGDpgwpvz7gwy+DHVQEALmEcbQvIj+52x0mp1Qb6jXxFNL8AXU3ghdCEDftbpfT1cvXCfZa6K/I3huBUgxA/hrzuDWFR3GMfJ0dUTbGvQgnOJsHZFBXbObQU1pCuWUfgFkSa6vb4fRDi1d3tZnmVzkFmzFDbI+JacK3XzxcGd6SAOxX3s0JCtGWXfV4GAx3P9NBUxhJB2AhKN/IALNLHqzfa7azEb+bJzNAgXFiE9yQVv5aF3uwpiq9g7KD9fO+VHw9NkYOlKSntgzDnQGt/UwjXoXTBng6+bZ54zNL0jgIOiGGgJ9MDP3y/fg6O1SX/2V/Vo9fFP5EOiHdsFVLuBokSU0xtfXGOztjCJ4zg8O4phdtA2+bIFqb8FpPoVjBWVdgxrWm7Ad9BZDIiYefVwNM1lN78vva112Y0Dx3MO+yb4+9ugGgnV8PDvGGfahpuwOGnN9SkH9ictqSu8CssE3wS5016EcuCQAZCDe0mFXickXg7eaPIgWlksfo6bmnAK/AVVYLmxRF+jjDwO7fE/Bql7z+ti1rRtw6GimH49FvKcO6v1jmrSsx9T6bzviHGC2Lu 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)(376002)(136003)(366004)(39840400004)(396003)(346002)(38100700002)(478600001)(186003)(1076003)(38350700002)(2906002)(36756003)(4326008)(26005)(52116002)(6506007)(6486002)(66556008)(6512007)(66946007)(2616005)(66476007)(8676002)(16526019)(956004)(6916009)(8936002)(83380400001)(107886003)(86362001)(316002)(5660300002)(7416002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?j9+jLRt5sxuIhgjiYjxpqDTI711gPvvg2e/InuoJQblRhWGTV6QmT0fCAg1A?= =?us-ascii?Q?Y6X3SDMCbGkY8TXbB/avpXCNcq5iuP8ms8K2yAMQcF5kw3Ou4lFEpfl+eQZ7?= =?us-ascii?Q?gChBbHQhc0kgvK3ralHVrrWjyJWFAcgNI1YHxW3JNUaM6OWv3od3PBrXhiAF?= =?us-ascii?Q?YcKvJgkoT7ByzROCA+6uKeZVS5e7pqYdigavlAUk36L+hb9WFTxG3G7Tlqwf?= =?us-ascii?Q?J0tNEVV5MJu5r1oVRKWiY+9g3Z7rIgjV/zBr8AjbWC+sH4+NLI7nTaZg7XSo?= =?us-ascii?Q?TJ6kvmnNgzSbbqJlLong8pKQDh/Jgu0rDYvhxduiFc82T9WzS1urUS3t152r?= =?us-ascii?Q?sD3xGjdma9TX+8edBhVFML8xhBTFhJpS/HLdBmMTzjz2/Q3dnW0S1jD60xzT?= =?us-ascii?Q?0SJ4QYkiZAhx+/Q6Vg8nubqoPGXISZVxNut/FQW3gg8ZfRbbaeVndJMwE0ow?= =?us-ascii?Q?gl3K34it7gzuGZByE14M8g1wcUiB1GJi5s/EjGjruMcUcYHyoXUASVuIrqlG?= =?us-ascii?Q?pJ2p0HwAYeWk/DdHOkBPy9kMbpg2FDpqhGt2qsvk93v7EbyAEhy+IAo7eitC?= =?us-ascii?Q?RX7xJMd+atFuCcRYoVX04GmpBCvutVwCSMaAZrjif5vl5meeK9YvqIo89GjW?= =?us-ascii?Q?iMhdSroMtmZcDZ/lCPyzxk0BdqL9iI4N9eMfN9aaN5rCp2aABzUTgsXKMVKN?= =?us-ascii?Q?zN516/iE5pEm2udQ5RrfP+rOzj0JQauSrY9zbGhgHWHmb2U0gbo5/JH4Mr+P?= =?us-ascii?Q?9fYaU6MV158ZYiNcPtxtowH8iWcs+yDANelgLL0uMBcDV5kNhYq7FCIuW6D+?= =?us-ascii?Q?lWchW75/C6tvJ8bnEOzShyq+OVG6MCNiI+AJiRwX0Ge9SBlRtkF1ch+eDhbg?= =?us-ascii?Q?9auy7fnJtrJIfybLnTQNOFmaQSMOcNE7+/cY3h03RrtB5EnO4SzAT5vQvEPz?= =?us-ascii?Q?FuOi8z8+61fJu5sxRr+nv0hfEalitAQL8CED7Z2xVzJzEJsXXYZbG8yVBlaK?= =?us-ascii?Q?1UtDSHIAo7E8I7v2p4p7Q5/mHe85R5GX+XlZg8pHeQH3VS4uiGozCBuLHL73?= =?us-ascii?Q?VWqGmc2euKwgFZcBhgOg+chQLeXR8NR3J468RkIUc7hwjUlGSIMaAIgr5Mlb?= =?us-ascii?Q?GnR+5Vqji6MTV3nI9rw75f0dsxqHZ3wNiHHO63NaQdZj5n1IMK0NM7M6NmMn?= =?us-ascii?Q?1VqDacI3MV8njpEd8+O7bKBLlpwNOY1Jf5JhJkn/1BrFrCj2uiui78SglBCk?= =?us-ascii?Q?6e23HqLkkhXZnGAHQHqBfBfU6ybpqDRsrbFkHr4jV/mQxYPWYLSlYGzB4usd?= =?us-ascii?Q?eL4hIlxBynBb75ECtlCMKdoI?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e47eca3-d607-4220-d676-08d91b9ac560 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:00.1411 (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: Tfut8uwKJTLTDnAX++k/lxxI7/XAmq4qjx4dtfIx3KcFbI7frjI9NuIknBu2v0Lr2R3mzMinbGhKXHvZts9GcYXhk2gB82nheyBoNrWOZhM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 a37910b42d..7cb8c531fd 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521899; cv=pass; d=zohomail.com; s=zohoarc; b=EAY33PP8eXRsWudRayoL2Vkwb27RN6cBml1yQ1Y7E/EKtHe34OSVrAC+S9bjCd6Ev9Ol8BxRYwS7X584FRYxV1MasHKvv8IqbTKMiNw/goYm4FKWCYFrb6Zki2Nhbw6Cf+UYm/zRFL+NkrnOOWNhn04zf9pG31h7C4ylD7Qia44= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521899; 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=OUjsfgYFLc/ZRc1eg2TVpgHPZi4LHvF/o+fq4jaekYg=; b=c7TkTW/UefpoPzHOI9Tdih9R+JHOiLeHGElZEY5vTbM1l1/yXb0qIv45U2JQavajBGlP3R/kAAkPN/WIikFOO3OzbdOKpntv7R5bjjirCNQtaYkfjSx1Ag66xWOD0PgwSx1QBn4WJDOZLaIrxOvoMdSq7guPD4YHT3K1eNhpHj8= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521899131586.1208342514593; Thu, 20 May 2021 07:44:59 -0700 (PDT) Received: from localhost ([::1]:53756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjv0-000371-1Q for importer@patchew.org; Thu, 20 May 2021 10:44:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljja0-0006Z6-E8; Thu, 20 May 2021 10:23:16 -0400 Received: from mail-eopbgr10092.outbound.protection.outlook.com ([40.107.1.92]:6738 helo=EUR02-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 1ljjZy-0005se-B4; Thu, 20 May 2021 10:23:16 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:01 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:01 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UqkOoq+Z6GaNgWy3NixElAd5X2ZMMz5+TIWpwdHQ9/yZAJNO7hhHNq5wURfbC3ozC/9pv+JWT3HywLB2Lgeq98u2VLi2eyrbOP2lHkZpgX2Syu0US4eTbh7PwLWFwNTQIy1fRd3xMpnaoZzmQ0841tjw+ihz+xjcIKLtSpb3ytJLmf80qiMrw1CgJOjj5E4XQLdN3GDkST9wnNwWrtJ14SaqTGwzZx7vLDpZTYUdku+AJwMWWmGZ9U1HfM4QduduLde8x/pM5tTtDnj0c0GeEzsTjfA4gIEVpnStfUXcFd7EkdhMJSRbX6dZCOskfUTA84IkGxCT0mt853qwwEDxJA== 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=OUjsfgYFLc/ZRc1eg2TVpgHPZi4LHvF/o+fq4jaekYg=; b=SQDdVVOW1iwuuj1tZWGfUiPoF9Y1S333CGl+92Qy9cn5or0h+d2KRC5sWNWd366px1ZV1+Mol+GqIBPgBOuGDQX8+gmJYKNuj+ZLnY8q7d+VHw3bToFZglWnM6DTnPFDrUfuBHAlY4e8Dau/YlgZ/8FEwor1Qc31iNbdIz3GlydE4uHo+W1RqODL4wQmxuKon2yMgZ5C6Fosc1k3hvN6zwM+Gy4+xjtweaZH8G6Wx11CWB5bEt/0iax5635d1z6FPDIW1zV/NXYJVum7T6rfebvxbXk93ThBaZj4Pyx0QlZXCxeq2Nkv0Aea1L7a0TiDp/2CfqMmaw7cHpG8+TdiFw== 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=OUjsfgYFLc/ZRc1eg2TVpgHPZi4LHvF/o+fq4jaekYg=; b=pTrgCuVsi61mRBY4tfvq7iN2N73EveNSvApbE79SinvN0z2jnVwNaNMuYneZXooz2orwsvlbo0PjPRM0fSHC9a468VxYczF9lmkraOaY06rm9M5Yj5AvZ6GrKQsUSvjim3ddsCzh6e8q2W8EJFeuWMNCdEeoAlTFSH7mtDfIb5c= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 27/33] iotests/222: constantly use single quotes for strings Date: Thu, 20 May 2021 17:21:59 +0300 Message-Id: <20210520142205.607501-28-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 38de5771-54aa-42c8-6382-08d91b9ac63a X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:446; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dAW4Jaf2V7mLHPTlqNfvEoUxsOn8avC79OfpLAu2poMGaAv5cVQ8XBol1bOw2AfDEUwEQFjeyDtZgJWka3C/YI94/QxL55hVReb0LCiW2ZKaUprZNCAWxV6lvXWJd1HceZsU/rOfzA3drh1eIBUR6xQhrM1Z/INa8sGjMl95km0EgTVJoMmlXgEeUxvmcTbxyXZ127ijHHDaeGQBB8dlDTVEpYW/G3+vjqH0TBD7oc3bI4yHp5ZqytU3CT5liDa7AKt5k4UiRs2KvylB1rTnwZHq+Iqsg9tMJRRvKm5AGRTQgkF6a3cKo0dWUnjavtrikeUsqcXqM/pJbf4IEW45I562Sr7a0dQ4g4/xGQCBUW1Ic71zn6XYyXzIb66JEx1uIlgcOfnyVe+eFGtOHWp6+GZALfNFupRut50tyvlUokBt3FEf9m/v0CYXeBgGk7Xi6pJGIQJPmbeYMWqT048IjISeAdGYryg5NwgpouF3hMsJsQkfXG43R+Q1h5lVzTh09DQpeuG+NJCe+LDrnK47E6RedxQMYALJSxbiVAfNEp+tte0hr0CLK4ECxul+X3+yBnUznvppX6PeLCRsey8sdJaz5jH5azdAZIjfqSVkN1lTCjC6gR/1bj2pZNVSUYyge+3Hm6mtUP6qoQ2rpNh86ImMA0cOpU/BFSQnMMQCAa6admbjJP6BNKTR6M70HMAc 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)(376002)(136003)(366004)(39840400004)(396003)(346002)(38100700002)(478600001)(186003)(1076003)(38350700002)(2906002)(36756003)(4326008)(26005)(52116002)(6506007)(6486002)(66556008)(6512007)(66946007)(2616005)(66476007)(8676002)(16526019)(956004)(6916009)(8936002)(83380400001)(107886003)(86362001)(316002)(5660300002)(7416002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?rBGOTQKg16LIuqDc/P6UYDSVwYEELayexulwESNunnsiNqcsdKV+9oa1uVQ/?= =?us-ascii?Q?J+M3RTv9V3atA4oE09cajsBqgRA2D2YCf23JkUKXrgASW/2o9UAWowDx5V0b?= =?us-ascii?Q?Fot7VHisQF787w81nOceZWhBnyajDtAXZQV4Ekp61VpexhgrxoxGvjiY4JSj?= =?us-ascii?Q?cWZuya31Tz9jCAy1MKmJyQNAhpLVycDFmp4tlGkITzibYdb6mwn6VLUVqXFy?= =?us-ascii?Q?p68VmFrtqWWae1WO6lwuTiq6JCoHz7tgXWGO/2g2RuAl1hrXTB7hgQWG7qW7?= =?us-ascii?Q?WLguJ/0+Y4hsv8hjwBnISACYl90p0bv5lIGVtVxcn3YBTAJWsIT6DQdvuQ/G?= =?us-ascii?Q?3g4aOiU+FAKRveTmdHMF9O95vQH35/rKjrtRZsWHwtXCmn1BoWqEDHzvuzRV?= =?us-ascii?Q?AGxTn1y0bB1/eSayV/2D/44Ml8WQg82xtbUu5+7Y8rjlgXtjlD59Jb6HxZeH?= =?us-ascii?Q?BINelDwAtQOw7UsNhSvDSl6S6WKCpdwwwlHZBYLXG0/Xj2psIQlEnn3EEevi?= =?us-ascii?Q?xhVn8VLnaI4e4Y7ZFUPkmKVvFMZISPtqeuOCMhLaZp9D65wO7+7p2EaulzJq?= =?us-ascii?Q?nTjdWj0TUIGOxayiXiI7TtjcxRE9ORRzOE4TJeCE3JTOoD+NAY/KoUy5iVXj?= =?us-ascii?Q?H9T08+GZrynU/l8bYeESqWVjChnfVnXg6M0/+peAyIHPmLdExZWAkOMVVSCB?= =?us-ascii?Q?QF+ZT2Vz9vY+U1hp01VbJcIN5GriB5N7sllIDCkbgLmy8Acm6VvK5X/sow5D?= =?us-ascii?Q?Ln6jB4psWEMH0F7NeRokYaD9cyY+cph35iKNcdH0WjNSrQe+BHQiYIaNt12n?= =?us-ascii?Q?eD1txjZ1jJZwcCaupSNVrMKj48Kf7b7sFANhlQT12l3UtdPCOBS35fT+b6BG?= =?us-ascii?Q?KwYuKztZyERvWH0c9ysM9lZEry4guagb7J8H4keHv47IBMnFOVy05G2PUbvA?= =?us-ascii?Q?8SKPU4U/7xjE8Vhoxq99LzHkSiajGFO8Yejv8mMP0OI7h/f1LceJQbkzxxde?= =?us-ascii?Q?A0TgVMfAGH7K3DaK1yMc7v6S84i8JJ4jO1MmqbtjZtbY+s6Kq1UwN8McP2ry?= =?us-ascii?Q?VuoV4rF2I3Uy8WK+WItvOEmGJ1d+8Py181nZW29492cA1hJgYcVxIoYgG2vq?= =?us-ascii?Q?YNrHbKbrlzpABvuJ2tXbQb+ZgQqrP415X2oxjLpS0c0vCG++e26bGSSdga/D?= =?us-ascii?Q?Q9GN/Vwf/GBJirIWEAXVcG6P+4j2uwsApoLfYz5+WWihywOqUwxLCrREL9/t?= =?us-ascii?Q?ueQM4oTPdRcdR/L/25C4HjxDCj8J2IUjOdo0xI5rid9ijjIRZs9OgEDORqL1?= =?us-ascii?Q?MUIVDou5wLxkf7ohpHp3zvTc?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 38de5771-54aa-42c8-6382-08d91b9ac63a X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:01.6096 (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: B3JhzajZJDhkLFRnseBaEbZfqKsY1/aaFVwBCiegqXgSz1zuHfpAaonksUzZFGx0cuhd3mUrV2Xc0zyIotb6DwUJVgRILXV6s+h4wRw/lgg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521263; cv=pass; d=zohomail.com; s=zohoarc; b=Zxkz/pK7hH1VwtEs+EeiDST6j//9SrY24arYeReX0RKsEjcfAy9W6f9RbEjv7pdhR09h9GIe/oQ2MywPvZ+7pjkXlYxyImFFeCq3lxx4wvCfAAkb9WSjQe/oZACJXpdEq8gbcHrz7bX2ufhcuf3iu1klMSBU3oSPFlt93Dzq8sg= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521263; 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=rRjqWsdRaHSlMRZ3wsG16ISLEBj6Jx/2vsot2HJxcQU=; b=P/HI8pFMgfuCQhUoJf6rNZJSjgAiQm8ozvJNyA0OThlRzhZqXKt6xxuaP0jd9T+R9XiRfhYlpZRCE/dF361QwmMFuJy9OX/g6IJbYbmW019VPXRD1lg/aPKyVPysp8xDaaAyN6c/gcOjzBFWfFzY1Lb4Aj8+clbV6Nrvn2NJigg= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162152126363788.06488675645926; Thu, 20 May 2021 07:34:23 -0700 (PDT) Received: from localhost ([::1]:47788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjkk-0004ms-Hp for importer@patchew.org; Thu, 20 May 2021 10:34:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjZr-00062J-EQ; Thu, 20 May 2021 10:23:07 -0400 Received: from mail-vi1eur05on2104.outbound.protection.outlook.com ([40.107.21.104]:17121 helo=EUR05-VI1-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 1ljjZp-0005pb-Ma; Thu, 20 May 2021 10:23:07 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AS8PR08MB7009.eurprd08.prod.outlook.com (2603:10a6:20b:34c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Thu, 20 May 2021 14:23:03 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:03 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kb7RQF1YN4AqBtG7mWqQhGgdwrQ/mzvQjDgqxWjPeqt0soAAryYdU0i/aHtXdZL7bqZkRUjArPK45W4B9OymLv1QRtgrbPWkrdY880zGMY0Y/Npv+LL3YSs8YkN/zCjccH8AOGUTa274nvvGYHXVn+IylHUjKy6roJJb/vJPEuBlYPAmVNJY0QzyrYR2zF5OvlNWzd35XwuGGteY3w4f2duzY6LA80ya6T7+xh06qmiNK4uIKGCqEaA0NGWKC0j9YltxwMaxSjpA6/eSp91vEeDH24lzc5y4/ELjLJf5PabGMDdkAWEhYbNWa5g4904cTieznuR/xvzAd+seotpAGA== 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=rRjqWsdRaHSlMRZ3wsG16ISLEBj6Jx/2vsot2HJxcQU=; b=F4ord4DcE7vqOl6Og94BVeyFioR+ND/oZumiwEx1Xj4bkmYt9q4p68LbsEJ8thYOPTS169L2ozrqcBqbTEPCxdIBT5jJkrBLmwYnsO1x8gwMfx/goZpgK1mhsn67hhL5t04R3nK6i+i0cupf8E3+lZ5eSYkAQeZepWChtJgr3Lumyy3syVLbVfaP6TocztPtvcD3eoTCsDq4b5mBMQCVp/OchjAZjSpfC5JH3j90ClLz5Lta1KeoX+uKhkHXhfNTvkWOloncxGzfPgs8ZzJHfIvVtNYKiM79eZ62IDKeEBu54R46YAu3Jb4uRyrq0X5Y/JxKMGe/8SVct0HAH92tJg== 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=rRjqWsdRaHSlMRZ3wsG16ISLEBj6Jx/2vsot2HJxcQU=; b=PlmxZuSWssAbZxD7JpZccvG7Db9LZq0+4uw0y8vm3QQRUiSFxIM4Susc1spA5Qee/lRZB3+rzjsNd+n1quGEqRN6bBzBBrJNXvIifAXjxUrzNFQxdVsu4s1fZ7YWO1PWVqkWWhGqKSopxzZYMParzfTTKO9pQZlQi/FozloFwKc= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 28/33] iotests: move 222 to tests/image-fleecing Date: Thu, 20 May 2021 17:22:00 +0300 Message-Id: <20210520142205.607501-29-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: aee9927e-b6ca-4e8a-9662-08d91b9ac723 X-MS-TrafficTypeDiagnostic: AS8PR08MB7009: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:497; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MQepcpWttNOvzJzegodQezYxkRqe0qXDm8evarlKfxwNyTPAWOLdL0TnB1JwJl3bUdauwzuJvCdWSzNp7Qo4j2pMskV9lPRlBRz/y0sAFrS47iW6wcQ/jg0gkf2rV1LIq7qb7H4A1iZXbMuNXUo7n47QoJgXKaAo5uwfsyDoXDJFoe4L9UTcUFD7ARS0JXL2TfXg2R1ZCpjHDNI7C/rBhDUIqK5pl3I6farrMtziZRSVwQAXAIAWTGSR2I2P8AziZcAD//G+tW9lbGLAYg5NPaxZ9skUci/5J6knr6SsL/Lm5oFsTatLpWkhBL5bUjfAdFrPOxdQlt/fIjFlpiTnZ7hDJ+0yIGw8/o9S9ImQndPlWQ1rKS0d9LOcd6jw4uxKWrTyDJGEEmDjCLkUtQTqd9tETBC98o/oernphK/CzTNzC+j0bDYcwSzmW36HJ8s/rdeUnjGe5J3Mww329JpHXMDDleTNlI43b2gwbDJ0w8+m6eyHJRjo6a/7Fmw+kQWD+gPYkyn7v8k5k8DRwzVS/dvXhDp9MfHB4TlJJT0wW5MTC+a3NCMxeZZ6vPA4Nk9/DixRcnHwsCCyExD2jE2k6WxAxp4iJVvucIUMZ/MctPhYJaBccHsiTC/4LoNj2g1BbcZzRMFHMVMd44ta8RyeF9fzRKasTzQtYz9a/IQKImM7skj8JcchYDnr+4uqI2my 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)(39850400004)(396003)(136003)(376002)(346002)(366004)(38100700002)(38350700002)(478600001)(86362001)(6916009)(6486002)(36756003)(83380400001)(4744005)(107886003)(8676002)(186003)(4326008)(16526019)(316002)(1076003)(5660300002)(8936002)(26005)(6506007)(7416002)(66556008)(66476007)(66946007)(2906002)(956004)(2616005)(6512007)(52116002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?O5eQoDre4VcfgLEdKjGiwFZhuy1HOv3o5+bw6oRTyZcUiaGQ1E2V2UsSRGkp?= =?us-ascii?Q?IAzlkfFPJs4N0xJ28uosnkeehj7jHsfiktjENimS//F4O/ZG3w/R4j2PSOJg?= =?us-ascii?Q?PHK9qLz4nPlikfRkTDG8RY79wDgwX1QReIUnCJdFKlg+cPp/Xi89da+T9oMH?= =?us-ascii?Q?pd8gwl+HPv8t5FBavft9nT+Xt5Vl9/DaG1CCstRVjVqiy9uINdaofJ9jNuNn?= =?us-ascii?Q?E7rUaPDiyZ914taDiFT9D+JuYbBCUljf0dRmrP03EkV7XPKbDh5reNdvXkyB?= =?us-ascii?Q?B49JhaWtD6CukQNUrvghqR0nC5aI54DzPQMxJEhqODKKY2sdaCZGkI+kA1zh?= =?us-ascii?Q?DmL07OsiMJoT3Ym0Ttq2188vxLQPW3pOhfKD4Et0Ra9p9HiPwKd+oL+JZONz?= =?us-ascii?Q?okeD+WF2OneH8aZXx3BAwho+YMqEBn6VHQxxasBHe6D587/2F2q3zDl9Ta2v?= =?us-ascii?Q?gJZdw48pbx0QBMNK1f2pE0J5N96kO/ZVOlk5MN66Opx0oj8rq4fhMAOZLjCC?= =?us-ascii?Q?Lit3WDLRrEg3ZJjkG6peT/gOETa0gO9XgUXXGHZ94yuyDLXoxBk1SNsT2FFs?= =?us-ascii?Q?1zdhdpVvIIKmH3/bXuFEomyTisYY0gMhIqRqvYItV+VQgBVsLg3Pfw/BwULP?= =?us-ascii?Q?XyqNZ8DBQl3uG/97GRIz2nGkYDrpJjLjlUGe+Q9AzkUx+55H1aqCmQ/YBPUm?= =?us-ascii?Q?gIeYPiMm3PDeKQXp1YSkbLFQKlUDhJSkkhtHfGbfsL27APK2DuDAPQg5YQQa?= =?us-ascii?Q?Gg/lOyItjPorLoXwHedLPJfksxdLvmrMP+YLf4cT4TJ8ZpAATdsarjJFdC59?= =?us-ascii?Q?B7QtYYbMfPX67BYTVqTt4H3V3IDf1BvB4mUg5sEsBrxSqbLYlXEo3C+2kbeQ?= =?us-ascii?Q?heKAuSl4T866qLu+EiOgnLwrJ7Ca3ObeI7UjV+ZASV2nx8CXsMblevmoyL8j?= =?us-ascii?Q?FV11P7dRnKh+CyIKK0hFWeq/rPux78iQCZ5vLbKvs0pMW1VbqsqC+kMqqhCW?= =?us-ascii?Q?XRltDIABUNkwQ40mLNU3vYp55IPmM5dap/4wKAahM+OyVpnP/JzLmMIwbvLk?= =?us-ascii?Q?AJxrP45rpkiVI1WU6Uff7vkkn9NemrNh+NentYDMoHe8fchlgK64L2X2nWFx?= =?us-ascii?Q?pRvfG/A+mO1QQ5Pq5VeDxnKClRImHeCU1+qky/6Yi0FEHP6iWFAyK7hTHF/1?= =?us-ascii?Q?BN3WTQ0F4rlNBVs+IpY48NLBb7dSDdzL+Oao19t6EPrTaJ0qXbRLiuxaPvS+?= =?us-ascii?Q?JHxOh2xSlMVmJLzJIxJJqbpfw3doygbHOnIxGWn5XgS8XKLpkhMKsgBckIIy?= =?us-ascii?Q?fwcElQi40VIEBvrBVSnTn6Q4?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: aee9927e-b6ca-4e8a-9662-08d91b9ac723 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:03.0881 (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: l0l6kujzpMHt5lW57aMLOkjODSFnLYjPFrfoRER2QpVx2k4wB/4zWmquY01ns37o6M6p4Sh8j0DofdtY/qO2H7IT0+kevwqjSMI1skta1ZU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7009 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.21.104; envelope-from=vsementsov@virtuozzo.com; helo=EUR05-VI1-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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521584; cv=pass; d=zohomail.com; s=zohoarc; b=UYTt6X6BNo2Evpddz/iqCfuvf0a0Ffu+nXAuOPvAjdiC0KvZ2Ev1/PCUmy9zC/8p/HPSvXD/QSyks2ElEZ1H0iggYqYVIRF1hNj2JZlITOwEjrfS5C6Di4wmuG9go3GXV4lUZa6pZkB5PVm53u67QjPmWnkQLPSwwnESxc4ZAaQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521584; 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=k9BK0+EXKpsUU2pT5gSQsf6nPSCVz5+UlUSOWPbkdQs=; b=LK12Nci944iHoH7fU3t+S0xlnHS2cQ/aiav9urAiV4XEEoHrK5YZlZHgGNX+0AnrTRLmrBEJ1kVNjtz8RzYCwHPCJh6r+HPWJZV01e9INB4LgmcueLO2AOiMppijbbOmiOIEg8E8ObDypy+TqzFJri/32rhc0HFH+hWlA7/znaM= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16215215842981000.3893028841877; Thu, 20 May 2021 07:39:44 -0700 (PDT) Received: from localhost ([::1]:38056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjpv-00011b-7F for importer@patchew.org; Thu, 20 May 2021 10:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljja2-0006df-W3; Thu, 20 May 2021 10:23:19 -0400 Received: from mail-eopbgr10092.outbound.protection.outlook.com ([40.107.1.92]:6738 helo=EUR02-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 1ljja1-0005se-72; Thu, 20 May 2021 10:23:18 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:04 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:04 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X2qznWBRfpVlqQelZn4Hbq0JMgeI1NHlouoHyq9FpkdP9i4hpGSUGQkuNc7JQ26pA4ULknRWXmNaKEq8nxZQxyK76+Y+M3VKACBT2R2YzD+RdIkm+P3HApStM6jq3TANUUeaM9+vt/S3FMl3aD72zYgXz8h/rBQNKN7AWWlaiPunF769aT7ft92W97dtx3BRHmoVM+x2/61ku2aRmsJk/mGVdJAqxFzjFrJvMf7jCDA24PjWQSQLSB6QQfuIwQuQociVKYWYkPqpsID98f4ZEBojDQqH9sPJa0GFSx3JE5g8AbFugLMaGkjkR0Pgd8ljATdP55MYjqQfFZ3R3HDJCg== 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=k9BK0+EXKpsUU2pT5gSQsf6nPSCVz5+UlUSOWPbkdQs=; b=knEn4vLX97ZNAdtvlf+epOLMN336RKANGksf5sECjoru1cSJHltALWhMcM3psIFYIb6YougJNRlAPctcKrwhuvCsmeC1LTN9c9ya7AxDofmA01aMccqFowp+RHgPv0Scqd3WgNHyf6KGSVVnwRTakOnpWjym7I20E2r8jvl0n/0hh2+iRAh24P+wIiehQ0u1SS0mgF53FzEs1fCn0kwH2hE5n9WPi99JJLbHMmH5Su06a6rJf08ZHOuUx6YRM7nH3lpQ7GanKt+4uQ1aFoHVC2lFyJfwn+MhcBMA2Fy7fhxV8wWiE4REZW1ym/jHOK6Q9LWAGPzbGsDE0i2kryDLig== 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=k9BK0+EXKpsUU2pT5gSQsf6nPSCVz5+UlUSOWPbkdQs=; b=ptwOlRVO5gyga9lkw7Z9HKbYU7R0vE5WMX//gsj+yX26WiHVNrC/cD7ghoiD7hJMfQcIS3GHXgfNoj1Vde446yUdhGHTSiXTbq8/R7JmHZ2tTvWY7siEIcuyiJhKVNqR75XAacVnVP3P4Ugs8kHOM3B5PJLMw+Hf+uzjfz48Djo= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 29/33] iotests.py: hmp_qemu_io: support qdev Date: Thu, 20 May 2021 17:22:01 +0300 Message-Id: <20210520142205.607501-30-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 915149df-45a3-4f34-91af-08d91b9ac7ff X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FoAdgiaLTc/FULI9Sk2CJ4tKnbVUpHmSeDImkDA4+5WG1oBzP1lP7lyywTLf4AkGAl9g5sjHFpxle2KY4G6/UaoYnCWBP5+Fa4gKvAL7//zv/EFixBnQRYtucH1lsafuk432NmgPC2mwdGoJEnFZ4cZwywW1pkx+SJIWNOif9tBVG/lwqII6D5lYFKeRCPzB3nNjCIdyyJUSBJMqBB8d8CBMAamKv9vnvMTKEUD/PbxXDkI03fuBZDNXnfI91o7vkjJ+o79zlsDOyIFwp2wPHtL91at9oackXjxiIJ9G2qo0YQTggYpJo/9CIa/7T6xZB/ZaFvNy3FYI74BnS8p3xKv7zZ33agBBym6mccA3JniWTXONb8S0zu2tLp1xEe9JXaUUKUfiofvT+kwF5Aq2cPW4Ko7EjXAGKDqj3HThyQ3eSN9/KfG1EEQSX1hiiUXRC0PMek+fa6kfugirGjCXyVurVBD7ouxTckOh5sEBZJj2sYHghWu/eqtrfz5RD//6zT5MgcEB1psSYw1Ylt6jN2Ebssm+z06K2EPYIJ4gednteccGlk9Uf3Aq/FpNGEdLnvl+XkEU3E1fmduRgYo1tUT4ryF0ntDEyISq3Mw0GnJIF1Ak2g9hO0tH8D23f24WYzbg0AOPsIiXIYqszpZf+5Se3DRT9qyeoDx2PIJ83HciHN8BcFYr0P1embVidsd8 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)(376002)(136003)(366004)(39840400004)(396003)(346002)(38100700002)(478600001)(186003)(1076003)(38350700002)(2906002)(36756003)(4326008)(4744005)(26005)(52116002)(6506007)(6486002)(66556008)(6512007)(66946007)(2616005)(66476007)(8676002)(16526019)(956004)(6916009)(8936002)(83380400001)(107886003)(86362001)(316002)(5660300002)(7416002)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?QbrR91F3GmT5VhGJZmItBFDXqFgtfMYOD6SzoG7C0nHOkOthIxRKbXvCm6yc?= =?us-ascii?Q?sTgrDPDu4Rdkhq/oeDj0VpaIAFnwuX7ehfbENx0S6XAHv3TFdNoRxmP0kIkc?= =?us-ascii?Q?DekgDOKhfdspZBoOUcDJBp6ddjkB8SeRTkdalBIIqkwnvSguYrB8WEyfppH2?= =?us-ascii?Q?OPa6vuD3R7K8gPj9DXhNtv1sN72vj1BvytWbHpSxC+E1M6FCcCYFKM9tMCA6?= =?us-ascii?Q?bhFB2sX3maKkVx2ebt2bp+7xQIAyBESv4efHeD9glcv2yY5gvuCBjpXydd4q?= =?us-ascii?Q?4hiq//ybkaSsCKHKgWKIX627wWfHZLL89nUia56rmhtGp/2LUR+vPx4JY/3u?= =?us-ascii?Q?jKFZsqvfl9Lk+8u9eDhi40x6nFNpRMrQYHwwFyTxaBIGIkJBXGtRn0p0Izhh?= =?us-ascii?Q?iVTXFxgxIZhzXMlDS7PPBpE2OHxkV9SV2azmlOeZLSKA6kQ4T+xoU+PI8vaP?= =?us-ascii?Q?MDnqH8kEp70vUmliAEl1UDrRmETaZNn2oO4MQJerszwhxaG1R5aFnLUqhsis?= =?us-ascii?Q?Z0VdPRAqZzu74sOa4tVIYV5zDztWLdrwX0ABAZ8CDJdqT79AYHagqYkNJSHO?= =?us-ascii?Q?tdMRZmDET0nZK73Hm9lwkmiVwQO6+9F6exSei/3FFpL0Hz8wAODfwARsEqYL?= =?us-ascii?Q?vOWhsuIGHhkaBpr4McnUYAggM+u6CnthD9bFCJpE/3K7hjTCgfhesyPgNoVq?= =?us-ascii?Q?XBxeGxXeCernNyNhzjg90kJSqNvkhnYMD1hLcXM1FXD3JTYhNY8Y/B9krLzW?= =?us-ascii?Q?AyAGDF3bvFi3If6AXUTS558LqguVVws9PQ/g5LnwBT6P2wu0kIQ6szD+aVS1?= =?us-ascii?Q?GvzaUQd3WJafuRBpxMaP6e/Urkq1fkveLVrO37sGw6rFVuiHKr8ElHYx48/E?= =?us-ascii?Q?HK/rZaY5vy5/vtONEWMYFhxQaZmiccxQlDa9IBKuU7YQtQ7JQ5nFfhI2mcn2?= =?us-ascii?Q?9Kc+MS65ItV6bP7qvPk/A7BF5T0XdwDA4orA4RONP0AaPu5ZJLIo97whVC+v?= =?us-ascii?Q?903ksyI03Nu578qfIHVVcrFSN1twV5HMUHl0pw9PAeUJaenyk4uhqhuzx/UX?= =?us-ascii?Q?75bwTs09GNfoPYB4T2dviWZmGuodnRZmZu2aLQ6893HPCclM4sebz1JM2GuC?= =?us-ascii?Q?roRRY8wFnxnT99qAmEGsFHGG5dBi+ZOzde/IXiXAwn7PNJQvxdpVTABsHhb9?= =?us-ascii?Q?Fyu2Eqbi8+5E1ysJud/EdojHkLkm7V7H4gwq+nyNcaN53OD6P8FEFnW7kIcM?= =?us-ascii?Q?HxX8lj+dVHpL+lproyJXYDWUr10MKZp2oSP+4/3fc3adOtIch1xtHEpzSwUe?= =?us-ascii?Q?Gh85xjL+qIuxrmoBqCDC1Ts2?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 915149df-45a3-4f34-91af-08d91b9ac7ff X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:04.5497 (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: lgcMFU67qfHEr7lAFNwEtkpX2p8e31kBn+VF5tP+6OSWWVnAJj4wqfzBFMOhfpnShJTvkcIfh4kmA8YtnPMX39Ka2qktJw16uMfy3Yj6lcI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.92; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- 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 c7ec16c082..9fa0162b07 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -655,9 +655,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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621521857; cv=pass; d=zohomail.com; s=zohoarc; b=SQi81MrjA4YxRE3ZEWRkCmTvg+pkhBWy2oPS5stutnVZcMoQ+Q3of/i3CtQwpcPuhAbYYZDZ+xFysLf0HuhJM3+I/hr4UAJVyKfLA8E4c1MTzmjuhgdsOSNaf7G5wZ2NHqWiwRJksHFKeYFikkc3l8e7pGcGe2zLSXXgJ//Oip4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621521857; 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=dogY3lg63OFTAwwCEBSRCJZAmX9fzZcCoQad7tCD4U4=; b=IfVnYI5UvtKXwnQbVy1yz+K+gPjxpyuDB7RS8hrAmC0/WdBlwlDySTZRRGNO4MZ/GHnQmAh/lR7dADNGzBrmb/yslmUb5KORCEyAttLMWJYIPCW5cI/7Onkd8jDo6/V3TAwN37Whg8BsEODVCbRKzINklju77uTIdYHKjy6kcdA= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621521857511300.3210972714205; Thu, 20 May 2021 07:44:17 -0700 (PDT) Received: from localhost ([::1]:50728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjuK-00016V-5A for importer@patchew.org; Thu, 20 May 2021 10:44:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjaR-0007nW-KG; Thu, 20 May 2021 10:23:43 -0400 Received: from mail-eopbgr10124.outbound.protection.outlook.com ([40.107.1.124]:23109 helo=EUR02-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 1ljjaN-0006BI-NP; Thu, 20 May 2021 10:23:42 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:36 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:36 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/zH+mhLnlAjtFHUpQt/uI2PYLfU7CSGqazLPqvVnkwee9Q6ZBRo1xrCiD1Prs0Z4GuZJAKmUhe+ctUMcut0r5it/+V5+P3mhHwOCpSJtnyJplsKL1m/+YFCuVbzcU4lOdtV9uv3mlClywLhil5XNGVBjKarsIpB2UwgYYo/3FuoGAqeIVWomfmxDekmuvoog5KnwKsbgZZDDrJkKLttbuy7EVEhRnvTHDV88v2IyyjGoUOn8Nm2Tn8XM2zakVRxRa8Lyof5UGAbGUVZGF+TJEYDBxQpsRPKLtqcmDb3RLB0ti8jSMyjXq1s0VNYERmumUKR/zaQVG615XryPgZHMA== 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=dogY3lg63OFTAwwCEBSRCJZAmX9fzZcCoQad7tCD4U4=; b=bQ5D+NPVfhawITri5IsAee+YCC0PuftbHVNjMADAPwHeFPSXPuJ0r2aLiFqXfJUPWz9myNoxok/hn+Q7i/C9PHRdteLQL//OJyvuXbi4RkeB4Roj22zLpkzhhQ8Vf/KmEo7QGkdw9b2YTRPLkUhobwitMlbUMiMRKfgYLKapnBURdBJCEj/SeEa7mCqH5BuGHfMzjZpMmi2JhZuAQ/N6TezbTJ/ooGQnE0XqbaQ1/jT+Syls1uwhccS0Qs0L/FT0fEZSz6euogFCpERGjfEasVXLORA2S47Pvr809+oQ5yZDPbOZSBSv6jmOzaHQSM+Bz3Ff99LJ1HhxGYSrV0tJeQ== 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=dogY3lg63OFTAwwCEBSRCJZAmX9fzZcCoQad7tCD4U4=; b=Y+PWkB7yGnWXPQhXOTM1QMRu2+7QbRxphEIPTGNJw9MNDQyvDOAVZVDstm5n+EK/0fHxuQHb9gM/jcdubpkEh58jJsoaCKiHvK6ZFuzVcUNQAvSAyb+19OgPu8Ku6BcykAlB/+BJAf9J3ZtEnzAOPPQpEH4rv5+xeh1/Uqet6/U= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 30/33] iotests/image-fleecing: proper source device Date: Thu, 20 May 2021 17:22:02 +0300 Message-Id: <20210520142205.607501-31-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: e8fc867f-fff2-40a8-9452-08d91b9ac8f1 X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:580; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: K7dYRdXWTqs3qyeLZ6WcQPPrVeK3eFgsaa3BbqmuFxCe24ULPTChKgAucYPf6lEeVYBhgmR0acuqTVWinULyMceEFkFthO8gSkw4BLBh+rkp4/IfD/Q0yB7R13XtoOaBJyixxaTIRtUU0E/JXtrk4xrs4jY8eRHbAskHJszjqgI4O7v0i3GeNQgRaeG+wNXIa5QZaAgQaSwmvCijffv7+gXi9XqixbuEU5imGDL4QYp2YuayTqgdbCBg4HXUpA8uO71mnBKqMgJUlyOb4LRwigPxNARrOWjxrVtoLfkvSSDoL5bENf3Wf6K37h08Jg7YiqQJW7ojT7mtqRXy0U0HF2miZbTotbF1YJqz21ZF9ix4wKpzNRxmmhpDgDihxrIfnMdoof6I05m6VIsYvzWPVwnjUGTKc5f2scuhaFESbK8a1l/DVd4H3HVCi2aV4vW48NuGEj8rBZdW4YxgbLioGpEMqyJYgJi5XJQnZ4Yn4UvmB4ukfK3EtUhEf+6z18OWNMrESQ4j62kxwTnJkjDLPkCBpolgil87/aQNLTx42slAmL/AYq+efze+yCTvZPVl2amKT2JD6RLijtecm1UZnMCOGMqHnl2YFqJIrH20YTISHH5etgMKssy0/6vryf1fBb/00PUMsqKBETU4CN1lDmaW8ItNphmxYmI0e/6Nt7ZhtXJItoL2DSRUBLhaPOxY 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)(346002)(39850400004)(366004)(136003)(376002)(956004)(6916009)(16526019)(66556008)(66476007)(8676002)(2616005)(6512007)(66946007)(107886003)(86362001)(7416002)(316002)(5660300002)(8936002)(83380400001)(2906002)(36756003)(38350700002)(186003)(1076003)(38100700002)(478600001)(6486002)(6506007)(26005)(52116002)(4326008)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?eRw/Vizh5n9ZM8vKBWoJlxRTkT+k5LBghkyaL3ag6LCkDojghAxHu5vndDpg?= =?us-ascii?Q?Z347YkVShC8l5dJDWKlveFhuUnHns3eMgViA4ctQzZ6h2iK6tb4v7xZXwFGP?= =?us-ascii?Q?pfZxvME9T4Qh554KZLmHjQxI8RtQJ8b9QajLGa4pK3s7AIfoTtiUeGMFEFq/?= =?us-ascii?Q?DF7Gi4sc6MiDA6ZhwWBnfZ1iwwz9z5+KSixR1nRERQmzbPC0PTSotcYYNtEI?= =?us-ascii?Q?1J3bynrt68kb7Dcx750evqj5adUN65Mvua5wKOKGrENJpEV/DIbcGDLN+vqT?= =?us-ascii?Q?qR6Nwnv/VIBl4Kxm91Bsee1c93HyTmz8fDWm7sO33TbqKbIJm0/qkIhvC2fS?= =?us-ascii?Q?04ZdWVI1Ne88XLGxRqxxiVCAvxtVh3sa4oXj0AFuCzvriu3dLFoqb6WHfL4C?= =?us-ascii?Q?TxXdN9MOR8uZ6wGKizYTIWFDxKL2OB8N+oe8jkubTYLek5jxf574NdccFP61?= =?us-ascii?Q?rchZIAvJDUmZ4fo7R/KDuQRBAbsf9iSzhNwrBtDWuQcYswvAh2W9JPS01tNx?= =?us-ascii?Q?cBRuI3GFI7vSuHmaWNBNKCcMQUASlo5+UVOwDZiM+YKM6EkIdUb0q6mWkGlX?= =?us-ascii?Q?nOnpRKYibhU1ETIgc+E6uLPgyadWeEVpetnbYLxzYX83+74IfR8xCRf327Id?= =?us-ascii?Q?rNaj6MoAvWqzIRkw9N3Q2MMJAUPAgPwVMBUJj5pA6FE0S9fo7hElq48nZA03?= =?us-ascii?Q?JVR+tm2Z+zzYlq15p+ktYzLorgunmDFYJwSHbsb5O0+knSl4DzfANctjiXUL?= =?us-ascii?Q?wYYKix4fygY0Y+FyoOIqAbLl6J1LGXx12xuTEl3nSTQxY+9S9FYemSSj+8pO?= =?us-ascii?Q?MtPeMB55BhC1jrn1f8Aa24pD6I+trseqVTDBrV34gcauhKnEmjsymlJcp5or?= =?us-ascii?Q?vFtOLNsDgZ5MTgxkzB7CyUd2sY/Y/dDWfXiGBwc/EPHKaEhDtSNykPOUAH3V?= =?us-ascii?Q?908z1+aTxwpw6ujKeNwyQvhzT28uLUPORtEyrgPR/sf5o8SqlhaEuA7Y96o8?= =?us-ascii?Q?odgizy+b2FZk/t9hrjsjbWPUsp8JlKifsOB6XzofXY3PXKicEdeVtBp05pKg?= =?us-ascii?Q?Z8JbyHA1z/E6x2MbGXUOSs/+Kj/90tuYlzmyxsX80hsZi2jcy5pPUc2GYlQB?= =?us-ascii?Q?nzRYNS6hfnlIYKZy7XqfeobcENw7fH8K4OY36V4UN5npqW2M3+JnTzqmPxV7?= =?us-ascii?Q?sL9vbsXTPdE7SqtYi5pL0EAEu1tfmuX7sL6ANhQ0SOtaRJIq4pgprldLh/Sf?= =?us-ascii?Q?vsil3Nk4gL8CHDlWcX2ziucpKS1N4SkhhOtIC7JLgepEfpW/Gl9jOVt++TvZ?= =?us-ascii?Q?mIxOQEkPlHa2D3QwZapr80Oa?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8fc867f-fff2-40a8-9452-08d91b9ac8f1 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:06.1079 (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: Uy4ydI8wAPg/1nKrYk0yAnmkdWBBBnmYa0FAjCOYs0EDeHzN4wH1ftneGCxK3loK19CooNOricWrdha0erQ8w68/SbJrGTOho4IRS+y1oiE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.124; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621522360; cv=pass; d=zohomail.com; s=zohoarc; b=fjJoowa77PnsiWcue95XHE9110eDOb+H8vmZ+WhZf1voEonDMlSp0o3BBrNaVMgq8LJ0boC2HPw0dZrL9W+3ZRZUZL2LnSpdCIrrxaxTGCYtlO+zBSnJ1Ui921IF4l9E9LweN6znmZpmzixyO9IxACiz4W466kh/g3Qj4+T1ymw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621522360; 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=rlbMree13J2dxxmR7xUGpcyyLp/p3lTBbpgQcRzF7JQ=; b=hC84BNtWrZdrhFNaC5+de2ZJwXLM+gJsD56thjgnW6di6aNeg7toh6cD911rMz1FPIq51Wt37OTqp/mIzkf0WIRAKzf9ywzm85X03dJOkF99zoeM4e5sULTAYLgCAdEdaNA4wPivqnH7sfLWGC0t54zlAJASWNjnFoVgHcdMReI= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621522360971266.86950201940476; Thu, 20 May 2021 07:52:40 -0700 (PDT) Received: from localhost ([::1]:51780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljk2R-0003r4-Is for importer@patchew.org; Thu, 20 May 2021 10:52:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjaU-0007tR-La; Thu, 20 May 2021 10:23:46 -0400 Received: from mail-eopbgr10124.outbound.protection.outlook.com ([40.107.1.124]:23109 helo=EUR02-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 1ljjaS-0006BI-KX; Thu, 20 May 2021 10:23:46 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:36 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:36 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FMy9djxV4LjZ9HgNzEMdhg+La5tnC/wQ5qVzGGxJ4zSOv7TsmP4zLp3oT2Pvw683oZS+u3RmYI8Ug/qQl2Sk6mJNaXB30vqxkZXObsZyjlNNdhkLpc2SJwqEFQpVseeCbMgcOihipRW6DQNI+TkhSEob3QsFfLNmT1pBTmhGLgP3AM1X33BqQjyZbB6tzV3diSV8Qhub/2fn8AFFPKtA+G6+fzuHfbspu4nhTlTL09yDunvCjLBlrS3eguGkq9p3jl7yVDHOMEVUq/hgRT1SA4VJ5Ktn8ebV2yJmgFCP3AsQVqQU8BJDAlRhk8guNJoAra2XXpNIay3h+PIbYir18A== 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=rlbMree13J2dxxmR7xUGpcyyLp/p3lTBbpgQcRzF7JQ=; b=g7NZLX7CM7ij6bffFi4PXgAAQi+QGi9yo7UfxNhMnYDxhY6fPcIJmwm3fY6V00Qvr7+HDCQ8LLgX4aykE1ViL2B4qpPWRNOKsIakdIYLlgZNKN1W8xNKeBWoE8iKomWJRq0Pw3fvT+ISRD7HrOXrNdIu3zzVfPBmgPhpfMN0NPX67qas6vYZVnmp76Rh+c+YyKnL5gRB+CqI/WrxPFhx4HtsEX2MgVM7LXyljWyIUDc+LyFy0zC/jIRN1nbBCwAxQ4+Uq0PpbcbQMvvPzNL//roKWYZbRgOev9A8phniwAiRWFzb65ZaecCNVM4OhiB10QmUHaNeL6hrTKzbpB3Mzg== 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=rlbMree13J2dxxmR7xUGpcyyLp/p3lTBbpgQcRzF7JQ=; b=tNVpZZpn5Ebz3RJSM5yi84yFWpkr/29H/oiJF4xuGxqiZdZOpcfinl3kLQwjuQe1EZuyWYyrt/Pi20v7auk5dvb998M9BHw7AwQK0oZRaMBpymaN22yhREVXdGglMEvxfiiIi6EOyoj7wJ1GHj7ZgWQEN35Zpkd9dpBHmTI1FrY= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 31/33] iotests/image-fleecing: rename tgt_node Date: Thu, 20 May 2021 17:22:03 +0300 Message-Id: <20210520142205.607501-32-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 172089cc-b2a2-4fed-0da6-08d91b9ac9c5 X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xx8SGsrMk3fyno8GlmM+nt1xbsTzjNBJHLh4UiwTJ2Daz4H3xwc1Jn5u5HeZRGd7QVhASIkWE5Jxv8h4O93JdIesbQWZILGC8uP74X3zzrORvRqiSK7KfA6U4kSC7XP4U/n/13rYAieS967evMBpcrBdmDLtXNrO9MDUAWfKRbLWjg81x32c0uJyqqwmJZcGMW917ABs1Ozl5hrH2RyPDYhBjsdpCW9npz2cooFixRpo9yNTft+oc9BOh70WMxP4ydeintojEbcP8t3iaR7qBLGJbi7uZYnN+5O2MThNvU/YfOyZAtz94CVsagqg053y8LMJTZ1oQz0ob6yEMBsRtZi+GU3H8wP16xA6O6mhtCLeKTOLt9ogWNJFsD5dxrvnwWAvWotc1y0lxG47CzL8lzL09DOPB9GadVUuUOGLaNgN9or4TFvYCGsNsqZ/gJZSsA8iNFyJ9AZ3PSvdkeQVcpd6M/7/U6VrTq9w3ToYriYBf4KY8nOugQIYe08oWm0uWzl0Q6u+I65LGJO0bFEAtU65qbvF0fQizbXO8rQ1SvVPuX6jwFOWEnigzlhxN3x372WCdIWW76tuHAtY5TnebxqJL7unwYf19DPMwfExaBL4Oo4L8aq7OhaKIjeGwQYbYxm1IQYBX9Epwr9kEjMpeOyh0mXoXI3GrDc8ZIGPnAfy1ZMO0F2b3ttIqdYDYMNz 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)(346002)(39850400004)(366004)(136003)(376002)(956004)(6916009)(16526019)(66556008)(66476007)(8676002)(2616005)(6512007)(66946007)(6666004)(107886003)(86362001)(7416002)(316002)(5660300002)(8936002)(83380400001)(2906002)(36756003)(38350700002)(186003)(1076003)(38100700002)(478600001)(6486002)(6506007)(26005)(52116002)(4326008)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?EREnGuqgaWVi1u5bQ4UeY84LvHAxM17PjpbjFWiHzwb4zyOFitfDuYzFxkL+?= =?us-ascii?Q?OsI9yHIgYMlsjCrQJxcMFRDUHBrpnXXtZ+G3vlrPwalOw6cC+StL3yZpXr28?= =?us-ascii?Q?eZ/QayCG+EOYkecFhqOGce+krbETEkgsNjhN1mye5fPw3+jyr7lcjXfCI1Mg?= =?us-ascii?Q?Z/mclxcI3hW0p/8zvQvAqnwY6xdh9wzx77MTs436SfIk85xpd6wsUNpQF436?= =?us-ascii?Q?BPz1Wk0uIDh7px3v/IG3li9bPnG77+f+D0tCd4ux6kB9sxVpl2iLjRQmrodd?= =?us-ascii?Q?t54UxIwwXFWmwsRAyrF8F69Ch+Efohs7C9ljnEC7B10yD9n1trsD8vQRNEIy?= =?us-ascii?Q?/JqrHM7TrrxoFH53kEmFJqFVaf23QEALhsC60fnc4NNfZy2r/cajIDlTHl61?= =?us-ascii?Q?kNHr6maloTTFkj9NvSDPhxddMTIYYJ0FwXP97hno8goZ9URr5M1mjh2gOOdl?= =?us-ascii?Q?/xGsXpQLZGd5ngHXPhaJFk+LYr1MMdTVXw8hsht7vBBeneMJkmNI1rgVht6y?= =?us-ascii?Q?xbrHwLmL7SzoJe4b7r+AEuRIIPuu1oVrsVr/Bhv4OzEAJJUJ9THH4dYjx051?= =?us-ascii?Q?KdewlokC7JtHTp2tn9QLwANmZSom3FFaxym1/F2xNas9/rZ+ffEUFcc+2vbA?= =?us-ascii?Q?RRvv7EiAafNXrkn/BBTwQG2hAfO0hhc/BCw5wigS8FjJDfcwUGW6yXuOIOEO?= =?us-ascii?Q?o8DGr1sZDlzADuaGDCnEgWrMMjQqdfUy2yZxZzAdPofRYDz0DedG0tFXYHzA?= =?us-ascii?Q?6IEniVFNkrH+qNMN1UGW7dnZthPWsEb0Pgcoqxk/ghgY+ZjG1V/xpK/6Lh2T?= =?us-ascii?Q?zfHHAo9FYxzIvlWAkMiDW/WEYoPP33kOPuCTqzA7gyXjmy1bGVIkrswGJplF?= =?us-ascii?Q?lWIMrF4nIRDzPfdOVFDF+XK44InuW9bQSmDLXn60SWw6LrRMKbihbZGtVfxu?= =?us-ascii?Q?eSBOEI5tyvn2aTpi8aQ0vWCw9rLUOxjG0YTOolt+s0m6HkB48IVgXIYoHC6I?= =?us-ascii?Q?q44wrbCGUscRvDFeCQ6GOee8Stvr2wGQrD306oPV0vyS8RNTks3ExxidEEIF?= =?us-ascii?Q?rXCE9HdA0G4ok/OSI2cbho15oobmsBL3H9v4nT4eWpG9OJfudzQyo/P3f6n/?= =?us-ascii?Q?e7/mgQ4igS003uhN+/FWQVFhULZVs5CWfKJW+4FelCNEZQWcfhyI5OKyqdjH?= =?us-ascii?Q?TP2OXAwB4h47SK4i93O9Y2H+x66bKgr3KLxSFHf2mim9RnV7SfU9/VoD7s81?= =?us-ascii?Q?07hkUsEm0Kr04xA378JfJ7g0Fsy2WTAlSk0zELXAqghZ6qEcHPgFJ+mN66Sq?= =?us-ascii?Q?Jj36I1ZlGvxqL0D7QQLLQaiS?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 172089cc-b2a2-4fed-0da6-08d91b9ac9c5 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:07.4848 (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: qguaTs2fs1oydOoohV8PFHdPXabVaxXd229kT7HrZN6P3C0Alp7SBdxwlC+UWPETCRD1OELQG7uwsuC7qhvawSXflD6VTNe0eoIduSgZHAw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.124; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621522080; cv=pass; d=zohomail.com; s=zohoarc; b=QjIJmgtcTbwXfiaQDA4P248MqVvJiaUHuqFL7H429RYYZ0Q2l3QZ6p7OVIHHhFVGy0FZ8sZqP4TS8C7iS06RrFZO6Oo5T6FYFmdL27/nj0xA94VXHYhsc0hhJGMkN10kmsUuvmrvqQrqlapKy+pPPqwH0cWhEDbhC3O9a9pNzfU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621522080; 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=0xua8XAz4MCcCVJWBiPpeHDsNmOh9r4Qg0CjpS9tc3A=; b=BtOlA/KiAoKuF38JHA8vTo8hiuJRL2sOm8XE/KPtlbVokgP00XN+OzhEO6R9YOMjuYpD2tKxxoGbCsldfB+NnYM0OyQGTE22/z2tOpDS3YcOSp2EuYwlLgyge9RF4bz3Ce2RBh6gn66EXQejALq7vy0a4qZtuqErIIBgYr7mKZs= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162152208024799.5045744508966; Thu, 20 May 2021 07:48:00 -0700 (PDT) Received: from localhost ([::1]:35218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjxv-0001DN-7k for importer@patchew.org; Thu, 20 May 2021 10:47:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjaa-000899-1m; Thu, 20 May 2021 10:23:52 -0400 Received: from mail-eopbgr10124.outbound.protection.outlook.com ([40.107.1.124]:23109 helo=EUR02-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 1ljjaV-0006BI-EN; Thu, 20 May 2021 10:23:51 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:37 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:37 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TKSSoYZbdQRIegGU8nmAvCgKWUfyccOez0eB+bL/gLobaAI1YhqwBC3PPeb0QBrQ2wj19/F1LiLSyXvXisVxzdZQF8bwyPFals0lWl7tYWQspn12qN/jyCZY7Oc9BRC24mMCpz1W+jlwxHs/f/UoYIc0y1bNcTEA9lBqri/chReyPteEX93sraVudCOZoX9E6wHutFSoEicM+TT8fI9Oo5Db4gmW8zEHj/V62BhMqYkg1KqkpaoPxn8QuIfcsxTBnwSyqVzT3bZQYtVW5EUvegsr5N8oBPg64raD7S5o4kgZcfI6PkGva7P4sZLDWHK8ORtrMjkOXP7hq8s1ASfZdw== 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=0xua8XAz4MCcCVJWBiPpeHDsNmOh9r4Qg0CjpS9tc3A=; b=EM6F7ufiEKDPmAuYr/H4qU20OkaAk3izxcAr7G8uArcM1dLMLaQPBSBBWRmGo8muINbp0ENkTwOsh/DYYVlOQC8uJh6RBHN3PwUFrrmTa/LOTjsuKGTnNGd3Tf8spagK+DkRf8zEG2y7zrgPR9FY+a+pnmclqNfso6v6AY7COfxk0GEcu72Kb9+ne1B6o/ASdoY4nuwfcYAdEmQLv3fsRy4Owb4nwTsGnT8KieUoc/Ox8eIhcgi1lNrqZTKe+Z0TQFWDz4l3cibduHbX7dDFdV12A2oKa3/X6yGZcAuMRBNqCScdBQhm3DrBo7ltkQ0+Bc6DldvyyZh9jgUnXIFA7A== 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=0xua8XAz4MCcCVJWBiPpeHDsNmOh9r4Qg0CjpS9tc3A=; b=DWembOmzu9h+EMaQhATuxMTyqXVPniFr+wT52VzVseP2uFAoNvOgVCAFwK78cyW04pG9n8lpfCXok7RmkBz8xVHQZzyptcK1Bd4u0Kl4wGL5ShppDOPMqSMDpoyfrrKe+aoBiOnAEPYQoZWEELU7vB0wtTFniPVBwDOY+RRdVi0= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 32/33] iotests/image-fleecing: prepare for adding new test-case Date: Thu, 20 May 2021 17:22:04 +0300 Message-Id: <20210520142205.607501-33-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 594b6514-55ed-4931-a789-08d91b9aca9a X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:478; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bf/nN9d8b7X5O3WxuojfCBz+MjYV0v8RbIR60PBGYwEuIc3+L7dfp3zZXGwnwlVYJZuIVug4Y3Azj72+MEyQQ+v/Vsr6vImhyQqPNz240RdrMWqhS5ycYSftbhdfvWpIW5kO9AP2baoUnl66FMuY8r52I0aNCbZuu97xt8IiWWL5NHAPkDwE/Cn+D83NN/hkvSBpmpI4YqK1Hz3OEcakBv6xXhf7/EFsqcu05of91/4HP0pAzhzs4eUFbfCUZsn+8tMJaOYj75o9cPQDRC+Kg33ESWd+/53OC67to4LtQCpXyKtx/d4sWAiN9pOG2G6DDQmRVehjDNnkbFo/GNyOkjQnw4BxCr3TEMMeRIV2Yw+GlOcY5b42VPQblbrSMkX2rBNyoaQ388ckOcjtP9DYou9Q42Knakgf23MqMPZUHSZJlPyX4DAaM08LEpmXPV3OUcO/1v27q1x/q5fr8DA5tgbBHha5r7C/EhhZEHgbTv+QyyOcZAoAPA4LbmM8njr/JPIIXAYXrf158XL3KhTI+sPS0ffBvIfkPqjx8/3CXLi/ndJYD6cw/qIQrOFVFtovuMkFtpHuWByIxTu9sRkyhlgEE2yfrRCAgLsAIxS5Zasw3Jpja/5N2yXp6p29W5iVbmj9kRuqjCQmzGeEO38oePpvt5E6+KM+XpZY7BzJhPLTjWLIP/MGqMI9WZrwRdCf 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)(346002)(39850400004)(366004)(136003)(376002)(956004)(6916009)(16526019)(66556008)(66476007)(8676002)(2616005)(6512007)(66946007)(6666004)(107886003)(86362001)(7416002)(316002)(5660300002)(8936002)(83380400001)(2906002)(36756003)(38350700002)(186003)(1076003)(38100700002)(478600001)(6486002)(6506007)(26005)(52116002)(4326008)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?KvDaEm8UuIMHyFHORgFfwH8BE+hniofHbHFu9EIGgLVVU2gJp5N4Dce0014J?= =?us-ascii?Q?oJT4j4oLE54at3w0ozA5Ge8ugN9vUjO0PPposkDZfvI6EJefPvIXaQlmunsE?= =?us-ascii?Q?gEob8JdxGI7XgKLsP8a74HqxW8HFXqnO9bJPsVyo6FkC2puh/g62ct64ZsvV?= =?us-ascii?Q?bcj41zrxFZJ/qOXaZ4lAguH8nCY6be644wafqEFweZrcp53fAXQXz+ULNTuF?= =?us-ascii?Q?vHEFCPo3EL/p7psVKsJONu9EWKUaqnO0yDs7aVsZFXIFV+2M5psW59NsgSOM?= =?us-ascii?Q?nhe+4d1h3dN3md5wGU5F0KtlBpVZ3/3T3XvpKo05jlNZF1stxA4BD0zvh/+4?= =?us-ascii?Q?Ao4qtfPZobL6w3Vtm4mnG0lFtPKURM+Wd+F2Nj4MljmwJodc5rZ7aZazu2GD?= =?us-ascii?Q?C9pgumM1zEe8Dn44SYnYXzHUiygGdhJ4Lu2XW1sh5bGgoDYohK13r69Y0Di/?= =?us-ascii?Q?08M6EcAm2UjoE2PIbpa0qXiWGo9jrmOonS5LOD28npdT4OfDUU985OpIzBHS?= =?us-ascii?Q?w/m8POHisLajvlq98k5g9vyJIYR13iMu3CID+3dwxp2cAVrYJOOuiHasazu/?= =?us-ascii?Q?EZw29VJ/6OcH3VgsDIoDgsSCiFnd4eniZ++6jYNZ6+nRgc5xMlEja5mA8334?= =?us-ascii?Q?ShMWcvFXF7BRtUBSTWY+GYuywvpSnQX5BH+UEyJSNSJDJz1XNyfD3fk2XBcm?= =?us-ascii?Q?Mqxeqw0/vwG9wzi4e0L0IrBS0YZT3eHUyhrVTPVa0+KOvjrOVIHOgZ3TsHkP?= =?us-ascii?Q?YIjMp/pIFwOi6E6gkC8/vLpNcPK6n+0HfYq8TIPlx5udNRR/dGvQ+ijuiOkq?= =?us-ascii?Q?RLiV7ceMKzeUK4rd4fTbUMNIDvhbaLqzx5pfpUx+Xv+HeWpMxAb5Ov1tlvMm?= =?us-ascii?Q?x6Y8j2Zyvmm9ZlTP3FzptHCyrxG3le/rEH+Z2c0to4+3MVMKousMv1LjHUJf?= =?us-ascii?Q?bK6bD+iRsZURsVyaX2QzaOeobG+VBCB3pRqEaD1Icq3Rf/MduW0G/UY607eC?= =?us-ascii?Q?Fe1W+V/ivQuHVAz+8QyeYvuJcKTAZsreGbWLEy/ZQsafFDqVhIdL5wo7T1uw?= =?us-ascii?Q?Y/IOSG5C073SU9JQs27lYr2J2FsImNd9omfK/9VJZAYjiDz/2R603TUTfmwl?= =?us-ascii?Q?G9/GGltxLc0cOy2/LiWch2I/X48nzWs8BEoFb/b9lyjEGM6muQdIVr5P/Nv7?= =?us-ascii?Q?pFEa+Vo1QsKpGG7CQWVEFMeVOEE0E2PCON0+ZZNPjOK8kw+c5h7h2Gc8BLaE?= =?us-ascii?Q?BqnDF1IbAs1/5OopCq3vzK8B/VW7xhqgVwk3+mMyQMrknsTowqujv2O1Xyt/?= =?us-ascii?Q?eNE7830/TuUByQEZQLnI14v2?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 594b6514-55ed-4931-a789-08d91b9aca9a X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:08.9155 (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: hzu4uPgSJG+TE3zBU+wMiH3vDe1ePP8CEchOdpEPWo7a36wRXB7rrpowRQjyUYewDlCI8pdh6WRMHsdVF7l6Dkb+7HySzkbW91nBKjKs4Js= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.124; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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 06:53:08 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass(p=quarantine dis=none) header.from=virtuozzo.com ARC-Seal: i=2; a=rsa-sha256; t=1621522010; cv=pass; d=zohomail.com; s=zohoarc; b=BZDKdMmT0sXNZkGWHlgWTKUx59vZwylisNKgYKFt2/cf0P3dt4B5TNLb2Zqg8JiI2neX3r1clC5f5SQKCARrpgP5oCQw1gytYtACIEERFmjwb8/bxDfQcW4BGGGTwXzbOeX8Il3NNLm8xrnN3hmDq12Qe3KkuhgSfGaxjgoGPmw= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621522010; 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=V+CHw5kXTiSLLiOWjphuNP1ALWp5vy9nz0YTs3tzd0Y=; b=gzYQW+8X4+INfgDPqSh7vehsZcR7nGU9j4HZEM/0uAVpvo3/Otaus3MfIP7MG75nEzBgDD8y8Q5SD2h+UGhvuVBwKgTBnYVcz56+IAVbPjtWX7pysJgTv75rFSBaRn1A3bvoIFXja++AnZ6xFVpcoQqhgvqTvhaaT+dWLUqLeX8= 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=1dmarc=pass fromdomain=virtuozzo.com); dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162152201031832.85316733874174; Thu, 20 May 2021 07:46:50 -0700 (PDT) Received: from localhost ([::1]:60138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljjwm-0007QM-Ph for importer@patchew.org; Thu, 20 May 2021 10:46:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljjad-0008FJ-6A; Thu, 20 May 2021 10:23:55 -0400 Received: from mail-eopbgr10124.outbound.protection.outlook.com ([40.107.1.124]:23109 helo=EUR02-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 1ljjaa-0006BI-Pk; Thu, 20 May 2021 10:23:54 -0400 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM6PR08MB4072.eurprd08.prod.outlook.com (2603:10a6:20b:a8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23; Thu, 20 May 2021 14:23:37 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::b403:c1a9:6bb7:133%7]) with mapi id 15.20.4129.033; Thu, 20 May 2021 14:23:37 +0000 Received: from localhost.localdomain (185.215.60.197) by HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 14:23:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z7iYC41NnT8tKUo5IJo4KGm92lD4ta1FLNY7G8q65kf+A2+aCnANUEI60xys6tNmmn9KmpqFdD90ZUG4bkKR4Cz87jnMq8XULrc1b/XOmERoHtE08L8DXwQPauje7mFvTaqfRr1WuE/ZWIL9dFYEvuTHO2gZddngyDsNNFPZgdf2Y+005++my7j1PDK+cDlP93uKJF3Vrple2BzdGDxfXTej6PN+rSMuCqOR+eZfE2uV3u7GZi7dB1fTwF8HNfoBZZQEBsNxxmLgWaLgwrTA4RiGd2Km/RhQUMjxvr1mHRdc0wm6gHgInmXMYmIjcHNT8LbksWY6HmT3VsMI/zBLug== 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=V+CHw5kXTiSLLiOWjphuNP1ALWp5vy9nz0YTs3tzd0Y=; b=eY9KpY/lhY9Stv0yf4ToDPXvAzoobhJ7uJCnEeOIbSvl8ES3+MkKAjRQ/jQURw/zCUMBXQv/bUXRhkoRUUra3daZ8imQ4ITZ8nIkVJy1zX2KxqVpom715r5kwlKlkzrGqg0UimJQ7YT/eeMSSF96GWup8fogpluDRPo2rkeEhlSDbb5vxTElUY/g4+8UpDm8cH9GAdOH4ADnBSTJhyLsl8i5fyS/wpMSOHHjh3vilLPDCTQoeEdJXTBvDcoL3N+tUrbwIKFnrK2PMHvth/vU8IYTlu0shfv5LpXotxasw/n9epaDzjH5yzsme0tvrm9lijKK1TBgCEHv5V+yDjp7Eg== 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=V+CHw5kXTiSLLiOWjphuNP1ALWp5vy9nz0YTs3tzd0Y=; b=YrtIsoY1sdETTsGlsZ1I3hRs0fHfUXycxd9dNNkTFbWdnK1A5XkgqPBsCAdZ4/C3UHhhaLRVhClEZUPgVO9USVIm4k20UlH/fKy0urQhUcXGxApEr9aCufXL4MmiyvzrIlPw8/zwes6UyhQZCi+hbDFzH9wjFJNL0uiNpwCWbQQ= 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, mreitz@redhat.com, kwolf@redhat.com, den@openvz.org Subject: [PATCH v2 33/33] iotests/image-fleecing: add test-case for copy-before-write filter Date: Thu, 20 May 2021 17:22:05 +0300 Message-Id: <20210520142205.607501-34-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210520142205.607501-1-vsementsov@virtuozzo.com> References: <20210520142205.607501-1-vsementsov@virtuozzo.com> Content-Transfer-Encoding: quoted-printable X-Originating-IP: [185.215.60.197] X-ClientProxiedBy: HE1P190CA0034.EURP190.PROD.OUTLOOK.COM (2603:10a6:7:52::23) 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: 80999eb3-285f-44fb-afa8-08d91b9acb72 X-MS-TrafficTypeDiagnostic: AM6PR08MB4072: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:635; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oKc+4AyQs7z7NWlV9bBgq2+yJxn/C2ixb9h4vkm/tZDv1ZnELGuM/8V2rve/hpg5/nPd9+3Z/VBX/oEfehJvJOsELxFAS9DTomAg5GKpMWLciaN/3mFbDlMjvWlgK80Zz0Qwmkm0P6c6/kmMR2T955YmfJEss0xp/RCc+XUQyfXFGgKx6VcBVbg2ceni5AQ7fAbz+oRoCxRvSoQxOr83tzRKlSa/sTIuwGDsHfmvmz5a0ijMRw+dGN3zHCTM5aH12+9UgYFLTZRqiUofTU2i6Km211Wo0lL9FdTOWeb3s7S/rf+oztZNHmCr8UopRQqiq13HCOpXBNT1lK2ub3a80wFC/iC2QVidw7TVBFcgX+7+kRfPJe33I/R25n6F+8KmAjB0AUOFLcVj2FsfYBMeC+X6azp3h6NIQZUyIR4krX9CMuNCAWhq1G1uH8MXXmuCwb2gL/rthh0Y1XPQ3kahwKok47Lq4jNenrZfCq6aDoqba/3TWWIIS8ok9ly5D0tZC62Ly277kKfTsMeTbNDSzbrKq88lREpwlc8AGKkwJzD94OUQUhGiGwfAPLJFJrcDa01pGos+qpHf16ErmFblWwtdT+9iKhjS/CsV8NxqKRgcjInjoHSOLE5DAX7qpusvHvwYQIHodqJxovqVW2ql7qw1UayPUL1EAow8vNuT93k+wp6gyjFmWfpKBViUOr3c 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)(346002)(39850400004)(366004)(136003)(376002)(956004)(6916009)(16526019)(66556008)(66476007)(8676002)(2616005)(6512007)(66946007)(6666004)(107886003)(86362001)(7416002)(316002)(5660300002)(8936002)(83380400001)(2906002)(36756003)(38350700002)(186003)(1076003)(38100700002)(478600001)(6486002)(6506007)(26005)(52116002)(4326008)(69590400013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?efDqwijwRQRuocchdEDKJHEVdodQMyKKLGMx7IIr2S0iSdom5vjZIPp+G11u?= =?us-ascii?Q?GkbqShKBL9FdP844JWvuc6ueb0kCnvCl7Y5KVr2dG22tN1chQ2zJISUTitL/?= =?us-ascii?Q?joGGzzOyC+H/0ikjtmouT+UKtyvfseQB3NwMhcdoOj1BXYvxsABXV5gQxdz1?= =?us-ascii?Q?L87AZ4L6p0G9BuOF+wWHxEH522KPDoWtRAfj2Xu43bVeMDPrCKM5zUmQgOxh?= =?us-ascii?Q?1DYZGi+ipaF901ahmb6YgVjjrjsiaulLRIUZPcOBHTH9NhHhMJWpGT09kKhi?= =?us-ascii?Q?8r9Z2rjNeJ4OvnbjacEnSfOVtE+SkJ4jk7hVBCqaoBVsDMlOpTwSM//wPeMn?= =?us-ascii?Q?/R7StbHGnBqY62N5PeZ/VugtOX3l4jn2APT1ie9BY26ef+viohZSwu7+Aml5?= =?us-ascii?Q?zyFr5phc+bN7BkzFI5AsfnXLGdfxWoxlGa5KGPG+QKwlZWV/2yYXyKypuLMj?= =?us-ascii?Q?XYN6MEU/SyyJqdACA8S/UZXzgt5IS7C8s0oyS6iznbIFm3ajga2uDTxGXZaF?= =?us-ascii?Q?E825p3BlBacuoxsao6MYo3lHj8nivgi04Nf9bUIrvpPxlgzGwdFL9ucPIDXO?= =?us-ascii?Q?BJHGEkca14tfjh6qo8LnL0XcQNwrPEGsO98qCS8YAkGnxRs5ahG08jLasR6n?= =?us-ascii?Q?9tLDdMigL2tcnaDbIG6Dj29UrPTQzXb8Hg4i+TMAnw200+8JUansyT68yoJV?= =?us-ascii?Q?Rfd1ppk+K1cHONDNG3WtJNhTvcps7oXh8//qWHtrqlnz6rEQQr2J7VnL5sU7?= =?us-ascii?Q?A2QtQsxNJ+R4VAIqy88y98QynUS6gMrKgRFD/Fo0YNbkSNcPKuGPsyTPFBlC?= =?us-ascii?Q?b3xfp6Ipm/OcCmZ6H7SIeGeC+bjZ5Tj1WKrrz/bpsQTFcX2Cbuqg1li2sB/a?= =?us-ascii?Q?9eyH7BcPAsu5HLJt5ZymU2k+y63+GZ86ip4+bmsc4NCyNSAEgM+iM4gwAj59?= =?us-ascii?Q?WkXbv3t2LwsIVaABAUC7PDm4tU/KVb76wb+TnX3XvzEAyo0qqxzJrEeKazla?= =?us-ascii?Q?j0mJSCiBgFQJDTtTRozgFD9aEs6Ke5j20+DmbfMcdXD9+UYxmfHSPaWSNc26?= =?us-ascii?Q?jMBKCid6J3YB9UJPeX3ZcT/ksE3kOG7c+TQqqM1aD3/pWP6+w2KyYPteqfas?= =?us-ascii?Q?DYW95bYJ0BhN3eRC6cI/gqYheqGuCoUQ0KUPsExiPnMhbigrADfuxRNdUAW+?= =?us-ascii?Q?lcS986iKKLKc5UaW0W+VBhgWUQ8eWKSB3b1weeJQ1Caxt0jY1hAaDMQnpxhh?= =?us-ascii?Q?+/LVQg/992PsvBERCUpcFHCL8Y5FZCVhEtBr6MY6dRjkBJNLggdTUMTEBuCk?= =?us-ascii?Q?Z6oKsNSy8YN5WXgij8kfeV3U?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80999eb3-285f-44fb-afa8-08d91b9acb72 X-MS-Exchange-CrossTenant-AuthSource: AM7PR08MB5494.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 14:23:10.3064 (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: 8kjdSraLgD0gG82okVa796jy4jvdOJHN+iVVmFj7xl3bxhb8LlPgP2GOSV97xaqJR/b5Tef7PX/wXJJo6QndpAyKmvTVhMSA960Gmnw17t0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4072 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.1.124; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-HE1-obe.outbound.protection.outlook.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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) 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..404ebc00f1 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