From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645832652703497.84421716216; Fri, 25 Feb 2022 15:44:12 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-MEFJmouEOGSQkbgwjOJlfw-1; Fri, 25 Feb 2022 18:44:10 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 48841801DDB; Fri, 25 Feb 2022 23:44:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2778410069BB; Fri, 25 Feb 2022 23:44:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F0D371809C98; Fri, 25 Feb 2022 23:44:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhjl6027566 for ; Fri, 25 Feb 2022 18:43:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id BB690400E101; Fri, 25 Feb 2022 23:43:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B68E04010A12 for ; Fri, 25 Feb 2022 23:43:45 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C6ED80029D for ; Fri, 25 Feb 2022 23:43:45 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-A3qiq78HPW6oJVAjg5z1nw-2; Fri, 25 Feb 2022 18:43:39 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:32 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:32 +0000 X-MC-Unique: MEFJmouEOGSQkbgwjOJlfw-1 X-MC-Unique: A3qiq78HPW6oJVAjg5z1nw-2 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 01/11] block-backend: blk_root(): drop const specifier on return type Date: Sat, 26 Feb 2022 00:42:58 +0100 Message-ID: <20220225234308.1754763-2-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a89e651-0450-4642-9b4a-08d9f8b8a135 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: MBkYNhbuA9Jm7R/ko7gOh9JGFeY1mEy53Zlv8YHU9DA7pZkrHMVZku7PsQDR2UdHtfTLNimbBv8kmF/JbHfhazzsJf437eHaU4JJJq5W9jU1kuDVwbezwvE54tbZXoCKNo7iISZ+eChBuyyKfekztHfeLps/xmwFs9/fbDrYND4brk1nf2WeNRBhaPFyTu4OZ71CBn98B19P23Um7nvWz4AEx8/+xGJR8DvqyBAfPwgZ92d+vInK5FjkxR/c3RFQj5rdLSguyhx/yddeHPBHbx3QjkrmqFzVtSseDepvJQ2bXQq/F8MgVlZm92JmuBo5zwPkDPkvJ9yelV4r/20AYZHnyVUFV2OLos7hFcrdyPaZyrhCrajxytpgL/g88T1BF1yKWnFrrAxnkY/EalScIkr5SQ8Nbe9d+XJHaLXK+g/Q/f4VEjzyRMsluyXS9VBxlFoWrSrr5EafuDdvpC9UTogU7spSPkXpzWQYV33SjiUJMSE8H08fZgBX9QEMMOxfrgxtX1gxqweI4x3MSJXNme7CzwxAyg9ptT1AK32c4WYj3lYzwESLaibMN1de7lvAracxOeynCigojq6G3HozvED4pa3AZ5xNv9IJ0INRGMNsk19uNgjqq2YDzizk0qW0qaRDjqktAI9W3I8ii5yuP1RWy05OcU/fpocoea+F0PIkI6/ekLIjr+Tj3fBy3Sx/4fpWcfGuJ5PbRpVZfpGrSA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?SN6d6M4A5dbJLqSfF4I8gs6ZqW0LRes8yO/Hzva0nzu4WfQBFicYdmJfP1Jb?= =?us-ascii?Q?tPahyjO46Dy7+ZFF7B+1g6ZXhqc6CcZF7OMrp5uVK8NOqwwvSEIQePIi6nZs?= =?us-ascii?Q?IBgxvWMD0cLk6AwYknVJ2HEXQooMIIeOXLR1B8MH/P0fsVKNcKOR1nLBOjc/?= =?us-ascii?Q?HdEQWqEqBxeza7AbIhNOKvTouyYkSF2WZt4zSPQFEOedyQLOEJVWIblRGa68?= =?us-ascii?Q?+H1siTygOYYo2GUguQ+bJebLuCwP5Sr4vZAIWguKKagfzJ33v/xzeWWoHRC0?= =?us-ascii?Q?OlbzABlmTJQHCZPk2lFlsG80FE0IoAV3nL8cLIs2DB3IcKcbCwG3zj0Hjdzr?= =?us-ascii?Q?BdhCOGT/05F96Pr9otT2FPZqz79YaN+Jr37ogSCr3dvnsknopwW5khK2tcb5?= =?us-ascii?Q?0BPYQt9hoHDq/aagGjEdQFlhXKCYZAengQUWfFwdzhGqWBOfNOAaGsykuiAB?= =?us-ascii?Q?yC+2LJ5aa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us-ascii?Q?+FNFJXFRgHjR+Ir8uJv/avenWQyWVYhTvor5txL0vX3e9Oz3sVaWPBzXY4XX?= =?us-ascii?Q?ov630Y+ikuMQLLAfHsMlrGvRH21B4WIZOvXQO43pgtdQxs2KT01aktpIIch9?= =?us-ascii?Q?mGP9TnYiJEeaJoGcufPBitOjknH95JOoHVBiQ1wSYoExIW1dmczjYIU5oNHY?= =?us-ascii?Q?AuSeeqFi7n98t20s+78XjAk5SlL5C4dR2vTvE4uJPB7dPoSv62VgAuC+0C53?= =?us-ascii?Q?WjFxSd4I3yirVwaint4oyedzhtsmXz1UmPibKIjzWw2pRXuiO2n8bsVZ3XMo?= =?us-ascii?Q?cLFPRkBZBN4P1xyqccAUHZJo1PQ=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a89e651-0450-4642-9b4a-08d9f8b8a135 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:32.3057 (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: UshlzCkRCpB/HZpb8dOszO6ktjQc3u23aj8jvxeQljUDZD6DsTAnmIIpxFs5STxCUR6ozpEeq5qNxNClWCGZK0xFaf++qkWz0pMo7Sqhw9M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhjl6027566 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832653960100003 Content-Type: text/plain; charset="utf-8" We'll need get non-const child pointer for graph modifications in further commits. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/sysemu/block-backend.h | 2 +- block/block-backend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index e5e1524f06..904d70f49c 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -277,7 +277,7 @@ int coroutine_fn blk_co_copy_range(BlockBackend *blk_in= , int64_t off_in, int64_t bytes, BdrvRequestFlags read_fl= ags, BdrvRequestFlags write_flags); =20 -const BdrvChild *blk_root(BlockBackend *blk); +BdrvChild *blk_root(BlockBackend *blk); =20 int blk_make_empty(BlockBackend *blk, Error **errp); =20 diff --git a/block/block-backend.c b/block/block-backend.c index 4ff6b4d785..97913acfcd 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -2464,7 +2464,7 @@ int coroutine_fn blk_co_copy_range(BlockBackend *blk_= in, int64_t off_in, bytes, read_flags, write_flags); } =20 -const BdrvChild *blk_root(BlockBackend *blk) +BdrvChild *blk_root(BlockBackend *blk) { return blk->root; } --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832665425674.2557923811315; Fri, 25 Feb 2022 15:44:25 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-297-MUuSj5Y-P3KDbSTO9znDZA-1; Fri, 25 Feb 2022 18:44:19 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 526DD100CCDC; Fri, 25 Feb 2022 23:44:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D1B334B53; Fri, 25 Feb 2022 23:44:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F16F31807D61; Fri, 25 Feb 2022 23:44:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhqxQ027603 for ; Fri, 25 Feb 2022 18:43:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5B0F41121318; Fri, 25 Feb 2022 23:43:52 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5656D1121315 for ; Fri, 25 Feb 2022 23:43:46 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A6563C01BA9 for ; Fri, 25 Feb 2022 23:43:46 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-hXUUakSDO8W76aShag5EIw-3; Fri, 25 Feb 2022 18:43:42 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:36 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:36 +0000 X-MC-Unique: MUuSj5Y-P3KDbSTO9znDZA-1 X-MC-Unique: hXUUakSDO8W76aShag5EIw-3 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 02/11] block/export: add blk_by_export_id() Date: Sat, 26 Feb 2022 00:42:59 +0100 Message-ID: <20220225234308.1754763-3-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e52b55b-35da-4e66-68ff-08d9f8b8a3b7 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: vRLOrqaj9a3N7pkr5azKWHmH2UhOYo4oTQDK1dsjWYkJbei5ybY2IENYTl6hcVjl61kFFgpsNgtS1EsO/YOvI8HfeI0OK1iIcvvQv9cMWEsthKx/j1txaNMJRsqop07BoxIROT8V+ji+35JM+XaM4KNWTngnZ3hrtVWVfoX7HqELsGVX3GcFPV0BbWVIZVvkZ8d42A3zjsguhaHpSfer2vrO4jlRdFOs+Ttpfhj4vyPL6TdacFzcOkIDZXoKeGqFDBvmzsVeqIeZznwU3yObodE6JPfvD3qAf6x2jDmfEeG/Q/BibZS0DrpoHQdwRayKIzISZk708h3KgrYIUnj79PsieraRF9yiZuoI6zdU6KD5NSr9GemfylLdk4vhSXbBZlDPMhprVmGPwdtIu4l4+f19K+agzf7cCAfG9aWAw9KWy3wkWrwhct5iK3pVyfQFN6O650+oMYo4HRGXLsl12FFr1Y71x9HhmjpDPBp7v8jNH0/EnlZqfzuvBUtDHHIp3AgmoJI/sTNOc7YbzZoV3TnY/ClA7xPTETD8jwpRgr6syX0MhbnnwBErmUZmCrTxts9x0z3Ii1lQOmcWG0mK9XYV4KEL+f9yvYUPyJ6yKA10llnK78v7Xww0eRNrbmIXj1iIHtbZ+ZlPLs+UYe1fuWzNqxVU0ZzxIaw1FTvGq4eDaTrLL2J/G6Yx1Xnllz1JLbL9GtSWxtMcGUrNKGrdNA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?kcCOybkBlnB8MTksgmPdZH4gDC80DEtZKNMmOquIWg1eerBv6p89PkPUEeHz?= =?us-ascii?Q?bV8FlT8+n1aTq0nbclU8Y0Qq3BI6wMkUqoSb2NpFwkgD9fF+MmsuWmJSjsKS?= =?us-ascii?Q?edSLAmZYDMjD2LZIb585ytg+z+VIayJihEntEuNAYolwCIQRS0vljfjPEP4z?= =?us-ascii?Q?rJlG3LjbRK5WdScxLtfaMwtPwxCGN1xtlOAOIbPT0/AivJfXbjdYYH18vfAD?= =?us-ascii?Q?5mqaTIVEMHWx+E/rzTdn9k/jwy94bfXpaKbJyGxPPpt5HNmCx1vS27Zl3gHI?= =?us-ascii?Q?Kv9eA6Jx5sSYQlb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ZIp1Ky0SHEu?= =?us-ascii?Q?LmjbivPUlo5rXeNlYcPJcbeNFnoHUGakbi6462+kHRRxU6aeBdzww+wMVRPW?= =?us-ascii?Q?4MFpbJbTUs//Z+x4zGFFW0W36rstvDOB+wnHt45SxkaQcwLt73zefRwFTK3b?= =?us-ascii?Q?d4rAs14188OtTgbXA8aJj6ycKm7kO2G3bJnHyztxpukph0dCMuyi8nmrvjzg?= =?us-ascii?Q?+XjJDHuztbJ11uL+8cDjDeSuXnHyMjOlih7XbyLXm0nWn1bOz4fXSzaqkCNT?= =?us-ascii?Q?kkEn5nU7wJ6Ely94v0PRXIpdxDI0rwBrKrV7Fs4Zk2K3/ik+6RkcAuxH9QsQ?= =?us-ascii?Q?sS3BrGIh0cdcDdvRSxN0UGdmfHuWEJChCxIDm6hZXsd+GHzUcizt7R9sC8bI?= =?us-ascii?Q?bAmbJiSyK2N+mRLlKWv+0PsVvMxtQpjEWmQUjoyP6SgVuP0JzJFi0Qq4xJ9f?= =?us-ascii?Q?pYZEQu/U542Iz3XSp7M4U56EIH0JbSuY9Un30yzt/P8Yk+J0N6PtHPUPJLyy?= =?us-ascii?Q?4dH70ND2md/4JsML+dtsxMcGcbI=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e52b55b-35da-4e66-68ff-08d9f8b8a3b7 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:35.9168 (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: HZ4SnmU+7uw0W5Jwt0jw1OheRSed6YACrbC63so5zWN+ZszsLBifNr9dVGFry7QPhB20saIGwe6Db/9GuYKHcotVNndPm/1GYS3AIcYemGs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhqxQ027603 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832665983100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/sysemu/block-backend.h | 1 + block/export/export.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 904d70f49c..250c7465a5 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -124,6 +124,7 @@ DeviceState *blk_get_attached_dev(BlockBackend *blk); char *blk_get_attached_dev_id(BlockBackend *blk); BlockBackend *blk_by_dev(void *dev); BlockBackend *blk_by_qdev_id(const char *id, Error **errp); +BlockBackend *blk_by_export_id(const char *id, Error **errp); void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaq= ue); int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, int64_t bytes, QEMUIOVector *qiov, diff --git a/block/export/export.c b/block/export/export.c index 6d3b9964c8..613b5bc1d5 100644 --- a/block/export/export.c +++ b/block/export/export.c @@ -362,3 +362,21 @@ BlockExportInfoList *qmp_query_block_exports(Error **e= rrp) =20 return head; } + +BlockBackend *blk_by_export_id(const char *id, Error **errp) +{ + BlockExport *exp; + + exp =3D blk_exp_find(id); + if (exp =3D=3D NULL) { + error_setg(errp, "Export '%s' not found", id); + return NULL; + } + + if (!exp->blk) { + error_setg(errp, "Export '%s' is empty", id); + return NULL; + } + + return exp->blk; +} --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832641559930.0033932422405; Fri, 25 Feb 2022 15:44:01 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-55-VeytoN8qOmSK_vGGQWxh9w-1; Fri, 25 Feb 2022 18:43:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9275A1091DA1; Fri, 25 Feb 2022 23:43:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B67692A9C; Fri, 25 Feb 2022 23:43:53 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7A7544ED28; Fri, 25 Feb 2022 23:43:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhn9M027576 for ; Fri, 25 Feb 2022 18:43:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3CD6940CFD18; Fri, 25 Feb 2022 23:43:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3777F40CFD01 for ; Fri, 25 Feb 2022 23:43:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 165BE101AA46 for ; Fri, 25 Feb 2022 23:43:49 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-FFCf8lN9OgSPCSAN8Knbog-4; Fri, 25 Feb 2022 18:43:45 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:37 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:37 +0000 X-MC-Unique: VeytoN8qOmSK_vGGQWxh9w-1 X-MC-Unique: FFCf8lN9OgSPCSAN8Knbog-4 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 03/11] block: make bdrv_find_child() function public Date: Sat, 26 Feb 2022 00:43:00 +0100 Message-ID: <20220225234308.1754763-4-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f4f47ab1-c2b1-4fdb-c878-08d9f8b8a4a5 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: vH8+llE34uG+DW/1kDUXd8oP7a8jB+WeA6d8WL5PKIQJzKzVvSbzLJtcM/71GYD7Vk9Cofa114JX3+p+aOSsbr2HliAFB/tXdz0Sgao7ml7GCUfVNFlPtEdUlDJhr4NeJ8mhLlhbmoZj9OKuPDEE26LT1qwLtfU5tvb5eENXtGg0ahsY7IEWkBoW5WevbbYQygxMbJB0Vy7tkif7R5yVdw4Vn/dPT4ppsKDuvbQ5LkaEQeahEihPHaUIPjzRP+1Zz4RCUZr3i/wYJqV0dyiP0ihePpUBXohjjEYNLzXQkzfNMcIE1DMuGNn3HkmY+cDO91261PbxxLzd+t+iLeHUJHJdKS9Fv7tPowo3B2j1/ckKMFGOCsf3adLBsBDZbs7ba7tRuZfxn/NIOVNaDygFopUHAwz1ioVWMGn1Sn+AvDdkYKMf2GcUl7vrdJhqVygXDlaiQ5wIJejiUipZ5tV5C3TvxmUx4nb4143Ya22ulMDKF4aFdAx4/W3S3fxmsiaOB1F2Bg6IVWPma+CwPi+fj0+xlTOCbMa3gCw2kG4s4mU8HFLHqX3IYuGg4GrAe+qWtNkXyEbUmY+xXLb07uAnBg0Nn30W/G/ppXsST1B6XBzoGwl8mFlEkSfbbq268Nb748PY7Y/QyPuZkppwuX2zPG6HAgHiq4eQWorKA2xW+11aQj18O/61qG9HwCWM8b3ucFkZYxOX2wXYYWhN8XzC4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us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Tenant-Network-Message-Id: f4f47ab1-c2b1-4fdb-c878-08d9f8b8a4a5 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:37.0884 (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: mVqb0fzLqsNPQAb3nWABFmG9NGbelaAGJ94E9eiYb1c0CPGNPHQvjEb4D0VAB5fJH3jwSNkEDFPfuON7ucjIkVI4FTC2U7NQ7mgxukicz3Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhn9M027576 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832645056100002 Content-Type: text/plain; charset="utf-8" To be reused soon. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block_int.h | 1 + block.c | 13 +++++++++++++ blockdev.c | 14 -------------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/block/block_int.h b/include/block/block_int.h index 27008cfb22..e44348e851 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -1430,6 +1430,7 @@ BdrvDirtyBitmap *block_dirty_bitmap_remove(const char= *node, const char *name, BlockDriverState **bitmap_bs, Error **errp); =20 +BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, const char *child_= name); BdrvChild *bdrv_cow_child(BlockDriverState *bs); BdrvChild *bdrv_filter_child(BlockDriverState *bs); BdrvChild *bdrv_filter_or_cow_child(BlockDriverState *bs); diff --git a/block.c b/block.c index b54d59d1fa..601fee163b 100644 --- a/block.c +++ b/block.c @@ -7728,6 +7728,19 @@ int bdrv_make_empty(BdrvChild *c, Error **errp) return 0; } =20 +BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, const char *child_= name) +{ + BdrvChild *child; + + QLIST_FOREACH(child, &parent_bs->children, next) { + if (strcmp(child->name, child_name) =3D=3D 0) { + return child; + } + } + + return NULL; +} + /* * Return the child that @bs acts as an overlay for, and from which data m= ay be * copied in COW or COR operations. Usually this is the backing file. diff --git a/blockdev.c b/blockdev.c index eb9ad9cb89..d20963be2a 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3661,20 +3661,6 @@ out: aio_context_release(aio_context); } =20 -static BdrvChild *bdrv_find_child(BlockDriverState *parent_bs, - const char *child_name) -{ - BdrvChild *child; - - QLIST_FOREACH(child, &parent_bs->children, next) { - if (strcmp(child->name, child_name) =3D=3D 0) { - return child; - } - } - - return NULL; -} - void qmp_x_blockdev_change(const char *parent, bool has_child, const char *child, bool has_node, const char *node, Error **errp) --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832659217821.0500723782277; Fri, 25 Feb 2022 15:44:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-141-TEVwzigXMH62q0-tvb3fPg-1; Fri, 25 Feb 2022 18:44:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DC6E100CCCE; Fri, 25 Feb 2022 23:44:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD2118BD63; Fri, 25 Feb 2022 23:44:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 92C6B1808814; Fri, 25 Feb 2022 23:44:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhpMr027593 for ; Fri, 25 Feb 2022 18:43:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id D8DBB400E101; Fri, 25 Feb 2022 23:43:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D3D044010A12 for ; Fri, 25 Feb 2022 23:43:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B89B080159B for ; Fri, 25 Feb 2022 23:43:51 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-dFAW-75UNHOWdZDAgyBpRg-5; Fri, 25 Feb 2022 18:43:47 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:38 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:38 +0000 X-MC-Unique: TEVwzigXMH62q0-tvb3fPg-1 X-MC-Unique: dFAW-75UNHOWdZDAgyBpRg-5 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 04/11] block: bdrv_replace_child_bs(): move to external transaction Date: Sat, 26 Feb 2022 00:43:01 +0100 Message-ID: <20220225234308.1754763-5-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1c04a6f-ccc9-49f4-9af3-08d9f8b8a54a X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: cv/Jfqocji2yX5vSUAmS/OI+mU/wXeHc3bvhBUJLrbaK81GxxflxLT+03fvXh+N3WcQxUnIU4FThNjdM8fb+8zoyxJncvIUhpYjMwQqUZmlQWYI76plPAgtVa4ZSP43vUcC13C1Z9fl+9oAOuetLrDCpnbWPE9pGdBLCJMeIIjEFOzALxlhOD+RKVYXELLMBbClJt17Jw7R22xtDEytD/bTpjnuWGu9XH88U6kpJCwc4KOIIxS/6FgnXMBZ6AM5MHZvgLEh4wS8/u5L3trVQGfmsQI39Z7rmhvYua04tKgJaHtseLnW7r64ufu+7J/n+fCVFhAsPmsiPXdeMy9+l8xEZY4735bazA2MHZi7l/vAgtt3seseVZ1a5KlWtuzzrA66d1gLtTpdc3yY7ycCI9m37874Xt3Q2zrbf6gz1R+p/JAeMNSk8GUVCSlTVeWEnwxNcziyBK1MkO/OVj82B+ijKjUKCEMRHnUaXTzh9Zt3PB3UMYGKhtdYab4aOkyvfMKb9BAjp1txyET1ZG5ddcOLGnMF2i6ZTYy5WPyk6l1UYmRZ5CAx4dHEJnDdf8Y3f02FS4MAwt/+MHxaRuUnEprmXqMnkcSbyu270BqGesDgTVdo7VKEP6fi7MtRF/Z84TCX+v85h3c0+Krthm3qcB9djyBoMcPmhOJeUll4n+plBAxJnG1LbFYt4tmwN2ZagdCst1B7b1UvZ0vNtZ1TxRA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0y2hBbaoe16Hm5oe6Iv2H1dGLDPzekTjyhxbSwhqC8FMKOuX6kUzsg377atU?= =?us-ascii?Q?uyUUFJZ0C+IaRQTo4nXFhDDGmkYnxMXU1W2TuhpQF3QnwNcnf+8BnJ8TZelL?= =?us-ascii?Q?7O7+3MAw9GFM/g7oaq4hshlVgRrgHYdLB29CK7JsmQagfvrLiWI0DT7mk7Gb?= =?us-ascii?Q?SvsiRR1OgFLcw59wKO+Eb2T7ZF3FRBE1777xelCnuwsY5hh+v/sWlDCFc2zj?= =?us-ascii?Q?KPjkLtYrdXci86Mvd0CvPusPf/bpuC9msO+dnfBQyLsNb7PLy4qJpYYxeh3Y?= =?us-ascii?Q?AbbVpkeAQuaV/u17wCtaEvKzb7F25xYntJY41XkBmR2qhKTQaivh0TUllL7d?= =?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/OxwW6Oio3IRXGn5L2gzxYW5e?= =?us-ascii?Q?/7k/cdsnfBqJ/O/rJaT6c3S73jn6tLS3ZS6r2FLQdfeX7O0mHVVbAbDVfTn7?= =?us-ascii?Q?JpnM2hGsL1srj0FjE+9WOXQWmjVtcqaF/r5tF2osYUxrcN0urEVUja7+T4dN?= =?us-ascii?Q?jB7LDBa++0LsY5a89QPBY/UqnHlo6bIAXm0n9ZNCGQxd13Baem/+TPhjDXtg?= =?us-ascii?Q?YLSwTnnbqS9RfQIN8/3cgP50/iJWph6B/w3k5YUrpwPap5llOLVrhSAfiUCZ?= =?us-ascii?Q?EcJLWXC5ttwDXF4dESvTOYLriWHlIEDLfJilvjIGUZ6la1YVqFEtkM/41+Ob?= =?us-ascii?Q?oJBW6bOJ2YPtfIs4qScSBmQigutn+hpM7/r5v5GompjGJrYes2D3tQX4dCa+?= =?us-ascii?Q?5bqP9nU4UKlb4uCJIvzfKJnl3cMq+GZbw9AuQQJLueitKc1lU+ELbjtR1uBy?= =?us-ascii?Q?XBSjLkkvq3U2brVgdJrrcBE9+js=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1c04a6f-ccc9-49f4-9af3-08d9f8b8a54a X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:38.1217 (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: 2Hunq56/z7yUP/ED7uEyxQ/fZJTIqt+pwK59DjzAkpmRiL2jlyCdDCnefmfLHgNiRf4Up9OQsFEeX+EQeMfMzBlVs15JQ0+BN/y0lXMhHys= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhpMr027593 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832660162100002 Content-Type: text/plain; charset="utf-8" We'll need this functionality as part of external transaction, so make the whole function to be transaction action. For this we need to introduce a transaction action helper: bdrv_drained(), which calls bdrv_drained_begin() and postpone bdrv_drained_end() to .clean() phase. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 2 +- block.c | 42 +++++++++++++++++++++++++++--------------- block/block-backend.c | 8 +++++++- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index e1713ee306..1cc1f736c7 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -362,7 +362,7 @@ int bdrv_append(BlockDriverState *bs_new, BlockDriverSt= ate *bs_top, int bdrv_replace_node(BlockDriverState *from, BlockDriverState *to, Error **errp); int bdrv_replace_child_bs(BdrvChild *child, BlockDriverState *new_bs, - Error **errp); + Transaction *tran, 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 601fee163b..b2f55ff872 100644 --- a/block.c +++ b/block.c @@ -5204,19 +5204,39 @@ out: return ret; } =20 +static void bdrv_drained_clean(void *opaque) +{ + BlockDriverState *bs =3D opaque; + + bdrv_drained_end(bs); + bdrv_unref(bs); +} + +TransactionActionDrv bdrv_drained_drv =3D { + .clean =3D bdrv_drained_clean, +}; + +/* + * Start drained section on @bs, and finish it in .clean action. + * Reference to @bs is kept, so @bs can't be removed during transaction. + */ +static void bdrv_drained(BlockDriverState *bs, Transaction *tran) +{ + bdrv_ref(bs); + bdrv_drained_begin(bs); + tran_add(tran, &bdrv_drained_drv, bs); +} + /* Not for empty child */ int bdrv_replace_child_bs(BdrvChild *child, BlockDriverState *new_bs, - Error **errp) + Transaction *tran, 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; =20 - bdrv_ref(old_bs); - bdrv_drained_begin(old_bs); - bdrv_drained_begin(new_bs); + bdrv_drained(old_bs, tran); + bdrv_drained(new_bs, tran); =20 bdrv_replace_child_tran(&child, new_bs, tran, true); /* @new_bs must have been non-NULL, so @child must not have been freed= */ @@ -5226,15 +5246,7 @@ int bdrv_replace_child_bs(BdrvChild *child, BlockDri= verState *new_bs, refresh_list =3D bdrv_topological_dfs(refresh_list, found, old_bs); refresh_list =3D bdrv_topological_dfs(refresh_list, found, new_bs); =20 - 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; + return bdrv_list_refresh_perms(refresh_list, NULL, tran, errp); } =20 static void bdrv_delete(BlockDriverState *bs) diff --git a/block/block-backend.c b/block/block-backend.c index 97913acfcd..dbbbc56b2c 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -892,7 +892,13 @@ int blk_insert_bs(BlockBackend *blk, BlockDriverState = *bs, Error **errp) */ int blk_replace_bs(BlockBackend *blk, BlockDriverState *new_bs, Error **er= rp) { - return bdrv_replace_child_bs(blk->root, new_bs, errp); + int ret; + Transaction *tran =3D tran_new(); + + ret =3D bdrv_replace_child_bs(blk->root, new_bs, tran, errp); + tran_finalize(tran, ret); + + return ret; } =20 /* --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832657716854.0690760498915; Fri, 25 Feb 2022 15:44:17 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-367-gmSVQ3LHP6OiTYQZ_QzFPw-1; Fri, 25 Feb 2022 18:44:13 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 49CD080D6AC; Fri, 25 Feb 2022 23:44:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 276EF34B59; Fri, 25 Feb 2022 23:44:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EAF0C18087F0; Fri, 25 Feb 2022 23:44:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhopA027583 for ; Fri, 25 Feb 2022 18:43:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3561FC08F24; Fri, 25 Feb 2022 23:43:50 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30B00C202D1 for ; Fri, 25 Feb 2022 23:43:50 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12A501C05AA3 for ; Fri, 25 Feb 2022 23:43:50 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150095.outbound.protection.outlook.com [40.107.15.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-yl9BGgFtNXy350Fzhc-rUQ-1; Fri, 25 Feb 2022 18:43:48 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:40 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:40 +0000 X-MC-Unique: gmSVQ3LHP6OiTYQZ_QzFPw-1 X-MC-Unique: yl9BGgFtNXy350Fzhc-rUQ-1 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 05/11] qapi: add x-blockdev-replace command Date: Sat, 26 Feb 2022 00:43:02 +0100 Message-ID: <20220225234308.1754763-6-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9147b8a1-faef-4e4e-15c2-08d9f8b8a5ef X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: Wy59rUT3EIcAqt+5WzkX9sluJgQPiPuzypp8R4gMXJjf7vDANhppYmkXOpOInXcM8U37tK0bqop5805xflIY6UtITPN2YogeOXbw8PIHbsCpaLelzKR5wVa5/THYyvYBkiZ/yaYXJj7svcxtyLCxaS5oUCwcOfieETZwM9QpoHH05Il8vLXI1AcdTuHz6tti2CAJDabQOfmvpgYDW8iM2aE5WFcR+HqrrguC2SJUFkM+bCv4hRqntStTNjwC7JKb0EXf0bz2NbnniFUFfwodABSRs9OgnUA0jZy88c6Spng89u57NYzleo8vwkvr17qX/wo3PNcMFGMzp8aO1o7kPCUu8adhQ3tI1eHM5dEBm3g6CcYPu/FyElMc1/Wp6T8sdfkGqZzspMxusGAznd+Z5rImTgjkUMbKEcgirn/7dXTZ7RcVL0uwnXFQ5fChbvirOE2FjWTTkpP5g2pBjk75wWpn4l66ZS0rpIdvWz5W4AxrQeMt3g35qWD2QAAy7PQ+FTWFzuxJFoKbmDW7dO9lJUuuJmUzCdAR77pTbGi1N5qyCKzGhHUi+OCwUNkrE3iGDMzkVHZtgh2EIyjZnZvgaJulfpdNOYyy5lQOzPDZqExCe0RYhCeWppGQoK4SMkZyPG+4gpMajetu/f7iwk0fwlR9OxdBe+FDD1536sz1UoQdGXALct9/iRh3t57Du/4zytFxvvKa4V8zCbk4ybfapA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4WRgi3XRD5e7Kz4z52q4E65sN5Ifi0tKI0PCTmdOM68Ie9Lp0SH7j8ZbpJqU?= =?us-ascii?Q?BP5HNwHNixnTWtZpmEA3EHfW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qhzBZuCoO5FwSTKj93YdxNFMJU83WqvSEeRgIcASLRQTD0E0yZA?= =?us-ascii?Q?F4MOA3ptyRDNqfhPtqtl1YX2h91MuxPzYzv/K+HCCO0+60GNSBq6uIPotB7x?= =?us-ascii?Q?YwHOiKCi0rLMOi7hdx3z+cwAn/ddDbIa4OdDAp5Xja75qdwB6hb2BtzyZksf?= =?us-ascii?Q?vbQCs6IOB06RAod5DVP7HCXg4RQJS8fH7aP1wRy94gyLXPCrd40dsvXW4xBk?= =?us-ascii?Q?Nub4/Epo5gJdrNHSyHq7DllBr24pfX4zxYeGec5dVZDJwciQJNlZvaLIVV0/?= =?us-ascii?Q?qZPckmCRwUVjp4nMIhwp9hEn1YlV2BbngX4x05++J3uB+kch3ln+1v6+4jTI?= =?us-ascii?Q?oqNLeEeBAVViFSHJ6WwnQl2AOLgJB9Vr0ahhXEsMAiCvqWcquiTsNYpUC0/H?= =?us-ascii?Q?UO6wXzGvEmFRHFWnzG9q3yGcy8thBRemCRb6xgmjnFaVJoNSfuNqCqdsYqBW?= =?us-ascii?Q?h4Ddr3BUC3iBFVezH72hpxNT1U/LgDZrVkVbeayYDJ65nw2Hb69aTcYsRs/N?= =?us-ascii?Q?jHZ/bicA7FcJssCocpyv6Z0H5PP+YS0/bVxNf4joX+pnteTEj/e3Y9+ZNLVN?= =?us-ascii?Q?ubwtixLV1S6a25SfLTUAWtgn6R3ZPStv3Vwtadw6tdRUrwDkE+3x+gb2PuM/?= =?us-ascii?Q?OATYyTBhDcMf8BKffNgp2ENKYXBlUtKRWzfLyp07PstFOFReED7rNd886SRD?= =?us-ascii?Q?uPiV9A=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9147b8a1-faef-4e4e-15c2-08d9f8b8a5ef X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:39.9663 (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: DytduTaBRl8tfr6gcfsJspzBIorwNaKQ3KEX28+KNLDX83j7F48EK9wPTt/6BVdbC3tglGOs5svxJGj2ACusPXHpC31I4hOXN4Xk4ft4/JY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhopA027583 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832660176100004 Content-Type: text/plain; charset="utf-8" Add a command that can replace bs in following BdrvChild structures: - qdev blk root child - block-export blk root child - any child BlockDriverState selected by child-name Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 62 ++++++++++++++++++++++++++++++++++++++++ blockdev.c | 65 ++++++++++++++++++++++++++++++++++++++++++ stubs/blk-by-qdev-id.c | 9 ++++++ stubs/meson.build | 1 + 4 files changed, 137 insertions(+) create mode 100644 stubs/blk-by-qdev-id.c diff --git a/qapi/block-core.json b/qapi/block-core.json index 9a5a3641d0..f760dc21f5 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -5574,3 +5574,65 @@ { 'command': 'blockdev-snapshot-delete-internal-sync', 'data': { 'device': 'str', '*id': 'str', '*name': 'str'}, 'returns': 'SnapshotInfo' } + +## +# @BlockParentType: +# +# Since 7.0 +## +{ 'enum': 'BlockParentType', + 'data': ['qdev', 'driver', 'export'] } + +## +# @BdrvChildRefQdev: +# +# Since 7.0 +## +{ 'struct': 'BdrvChildRefQdev', + 'data': { 'qdev-id': 'str' } } + +## +# @BdrvChildRefExport: +# +# Since 7.0 +## +{ 'struct': 'BdrvChildRefExport', + 'data': { 'export-id': 'str' } } + +## +# @BdrvChildRefDriver: +# +# Since 7.0 +## +{ 'struct': 'BdrvChildRefDriver', + 'data': { 'node-name': 'str', 'child': 'str' } } + +## +# @BlockdevReplace: +# +# Since 7.0 +## +{ 'union': 'BlockdevReplace', + 'base': { + 'parent-type': 'BlockParentType', + 'new-child': 'str' + }, + 'discriminator': 'parent-type', + 'data': { + 'qdev': 'BdrvChildRefQdev', + 'export': 'BdrvChildRefExport', + 'driver': 'BdrvChildRefDriver' + } } + +## +# @x-blockdev-replace: +# +# Replace a block-node associated with device (selected by +# @qdev-id) or with block-export (selected by @export-id) or +# any child of block-node (selected by @node-name and @child) +# with @new-child block-node. +# +# Since 7.0 +## +{ 'command': 'x-blockdev-replace', 'boxed': true, + 'data': 'BlockdevReplace' } diff --git a/blockdev.c b/blockdev.c index d20963be2a..9fd1783be2 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2229,6 +2229,71 @@ static void blockdev_add_abort(BlkActionState *commo= n) bdrv_unref(s->bs); } =20 +static int blockdev_replace(BlockdevReplace *repl, Transaction *tran, + Error **errp) +{ + BdrvChild *child =3D NULL; + BlockDriverState *new_child_bs; + + if (repl->parent_type =3D=3D BLOCK_PARENT_TYPE_DRIVER) { + BlockDriverState *parent_bs; + + parent_bs =3D bdrv_find_node(repl->u.driver.node_name); + if (!parent_bs) { + error_setg(errp, "Block driver node with node-name '%s' not " + "found", repl->u.driver.node_name); + return -EINVAL; + } + + child =3D bdrv_find_child(parent_bs, repl->u.driver.child); + if (!child) { + error_setg(errp, "Block driver node '%s' doesn't have child " + "named '%s'", repl->u.driver.node_name, + repl->u.driver.child); + return -EINVAL; + } + } else { + /* Other types are similar, they work through blk */ + BlockBackend *blk; + bool is_qdev =3D repl->parent_type =3D=3D BLOCK_PARENT_TYPE_QDEV; + const char *id =3D + is_qdev ? repl->u.qdev.qdev_id : repl->u.export.export_id; + + assert(is_qdev || repl->parent_type =3D=3D BLOCK_PARENT_TYPE_EXPOR= T); + + blk =3D is_qdev ? blk_by_qdev_id(id, errp) : blk_by_export_id(id, = errp); + if (!blk) { + return -EINVAL; + } + + child =3D blk_root(blk); + if (!child) { + error_setg(errp, "%s '%s' is empty, nothing to replace", + is_qdev ? "Device" : "Export", id); + return -EINVAL; + } + } + + assert(child); + assert(child->bs); + + new_child_bs =3D bdrv_find_node(repl->new_child); + if (!new_child_bs) { + error_setg(errp, "Node '%s' not found", repl->new_child); + return -EINVAL; + } + + return bdrv_replace_child_bs(child, new_child_bs, tran, errp); +} + +void qmp_x_blockdev_replace(BlockdevReplace *repl, Error **errp) +{ + Transaction *tran =3D tran_new(); + int ret =3D blockdev_replace(repl, tran, errp); + + tran_finalize(tran, ret); +} + static const BlkActionOps actions[] =3D { [TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT] =3D { .instance_size =3D sizeof(ExternalSnapshotState), diff --git a/stubs/blk-by-qdev-id.c b/stubs/blk-by-qdev-id.c new file mode 100644 index 0000000000..0e751ce4f7 --- /dev/null +++ b/stubs/blk-by-qdev-id.c @@ -0,0 +1,9 @@ +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "sysemu/block-backend.h" + +BlockBackend *blk_by_qdev_id(const char *id, Error **errp) +{ + error_setg(errp, "blk '%s' not found", id); + return NULL; +} diff --git a/stubs/meson.build b/stubs/meson.build index d359cbe1ad..90358823fc 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -1,6 +1,7 @@ stub_ss.add(files('bdrv-next-monitor-owned.c')) stub_ss.add(files('blk-commit-all.c')) stub_ss.add(files('blk-exp-close-all.c')) +stub_ss.add(files('blk-by-qdev-id.c')) stub_ss.add(files('blockdev-close-all-bdrv-states.c')) stub_ss.add(files('change-state-handler.c')) stub_ss.add(files('cmos.c')) --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832668676516.1456499912827; Fri, 25 Feb 2022 15:44:28 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-57-lPQqaKQ4PfWIJPEbyw02gg-1; Fri, 25 Feb 2022 18:44:26 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F5B780EDAC; Fri, 25 Feb 2022 23:44:19 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6E518BD70; Fri, 25 Feb 2022 23:44:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA4331807D65; Fri, 25 Feb 2022 23:44:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhuTc027636 for ; Fri, 25 Feb 2022 18:43:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8812B141DC2B; Fri, 25 Feb 2022 23:43:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8368B141DC28 for ; Fri, 25 Feb 2022 23:43:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6655085A5A8 for ; Fri, 25 Feb 2022 23:43:56 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-tLSQHdIJMTepsJLN_31PeA-6; Fri, 25 Feb 2022 18:43:50 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:41 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:41 +0000 X-MC-Unique: lPQqaKQ4PfWIJPEbyw02gg-1 X-MC-Unique: tLSQHdIJMTepsJLN_31PeA-6 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 06/11] qapi: add x-blockdev-replace transaction action Date: Sat, 26 Feb 2022 00:43:03 +0100 Message-ID: <20220225234308.1754763-7-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cee00592-6548-446c-74cd-08d9f8b8a733 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: WO6fAP8VrfijoWZc+i67vFSH+hvuyd/0dn2tYM+vDjJHSB5BA2C5gEag5EA1+EPOhBJGTv0O+lSChXOGZioerd6wTHDc4ISn3NhmmQ9M+z/1ezrX67UPIFwPL1Cq75UbEqK7EuEUHVhL7U4oaj4goB/mek7MdDr1xua6VFL1jPRL5YQiyszG+yfo1qzJpEfv3XZSvF772cCd2Z9pY5pIe3Wnp7bMPzK4ptu2+o93ka5//IOfsHrbGoioypFj9cyoi9r8Vq+4lT2dVpdfeWq7VHjro4uSyDRn7bUMG5ir/KEBPONNfhbEQDSJcq8VSFG9h+E6EFZ/6kRS8DqAUVujZhWasy9CmokOYfReFCUYzOHYBfiOExBCdiuJOZxSQZeD0G5rUz8cQLgxh8RUleZ0ujc7zlQjj+HHzHc6rAOf2lB5wd0F96LDJv890/gm8Ht4bqf+sckXd/Lj+9hF4toE4tJFz2UNGoS6SePyCjehbrc8j0FXjwU4diJ3VzLtP4z/2m9/BaJLIuD6SGzl1zYXA/34HXVapMAyjMu/tZo6NOeribdGDPaUMrykLQukGErX/idTsQMV0rwad2sdMgZGRYXshnMUSBI0xxv8QEL0JYsTdLetITxNQ6wAxvTtYn3FCn9RsG/8t1YUBxR+fNP6KyH3ENTdrsPCdPIUfWCxTWsuo5V10mZEsOWkCl5fDrgOLt+nWiQkfz8ILgPkGLXgsw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?PAzmZr6IrNyjGYk1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IguPCUmp?= =?us-ascii?Q?+kQqfPMGMRSkzaGanUMOnAhKeEmDvB4lYtJ8P4Rv2BIf/O5/bYpr+RjHVmdN?= =?us-ascii?Q?nysjJYa/+WrBlJASe8DdMlfOXlJaWf62yktIPsRU7Xg1eD9Th1P8Ubc8M4yD?= =?us-ascii?Q?NDzYsO2I3wV6bY6TTW1ZiTaSn0Le0/cSECR+2ecW7vdTkP+IFo9JGMX0jxY/?= =?us-ascii?Q?VPltxCl4seGq0wkdd2F7Ufc1Ta3nh2SJjDQOGDce5hbrwk35TwsgzUyv1EBC?= =?us-ascii?Q?pg5iXsKq06HIjyDgZJkHgf9Ij/MrkZCd7/rvzS97n4ENyDmIU5KNjAj8uFp3?= =?us-ascii?Q?BZq9cyId8J2DiN+aNPtoPGeFky4sS7qGxCMxgtbz9ECYpnyZZ3EgbtyaOt8i?= =?us-ascii?Q?nly5t8vQUwNh2bXdJjtEoH0YSK/u1hoM4dCMP8N/aG5hxoxRzuJIUfgdF4Bs?= =?us-ascii?Q?3cujU11w1Bkklrfp7q620K9y6boN2T9crcj6IvjudQ0IKlxPVoufpnOBYAl2?= =?us-ascii?Q?+HqezjvNrgPLFtUBc7toYdBD+QBeqtVEXl5svQLUIBaY37fD06kgbzcchh7Z?= =?us-ascii?Q?PwXpvIWCV0ao++1tguy+CLoTKcvWLVHkZgKCKMwDQXzDGwPz17zxwFmqu9m6?= =?us-ascii?Q?S7Nd+MJ53dZyVWP7j5FKe0Z4MW2+JCOQqZobkTdw6RMbKAvQGFVuEU8mGx4Y?= =?us-ascii?Q?7pKe/0L4P8hIYFERIxxlIIzvCgZO4UrnmOLk4C5HCKeZSbrHsy5CYxU/5WZR?= =?us-ascii?Q?xpkpM61wD0AkDAXtf3X8Pyz5jB8rswn7Le+lksQLH79lagIa9K5jKgc6MNui?= =?us-ascii?Q?Fsd5iw=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: cee00592-6548-446c-74cd-08d9f8b8a733 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:41.5914 (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: CGdplenZhS757+r7l0lR8qI8vIIszG7C0aPK6+9sV1HIwVbHrRBKd6UCsxaOT1pJf+xqF7ZrQNrkoNt9k7fLT3OJNne/QicVt2b5eNVFNFA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhuTc027636 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832670111100001 Content-Type: text/plain; charset="utf-8" Support blockdev-replace in a transaction. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/transaction.json | 14 +++++++++++++- blockdev.c | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/qapi/transaction.json b/qapi/transaction.json index a938dc7d10..48dd2db1ed 100644 --- a/qapi/transaction.json +++ b/qapi/transaction.json @@ -54,10 +54,12 @@ # @blockdev-snapshot-sync: since 1.1 # @drive-backup: Since 1.6 # @blockdev-add: since 7.0 +# @x-blockdev-replace: since 7.0 # # Features: # @deprecated: Member @drive-backup is deprecated. Use member # @blockdev-backup instead. +# @unstable: Member @x-blockdev-replace is experimental # # Since: 1.1 ## @@ -68,6 +70,7 @@ 'blockdev-backup', 'blockdev-snapshot', 'blockdev-snapshot-internal-sync', 'blockdev-snapshot-sync', 'blockdev-add', + { 'name': 'x-blockdev-replace', 'features': [ 'unstable' ] }, { 'name': 'drive-backup', 'features': [ 'deprecated' ] } ] } =20 ## @@ -150,6 +153,14 @@ { 'struct': 'BlockdevAddWrapper', 'data': { 'data': 'BlockdevOptions' } } =20 +## +# @BlockdevReplaceWrapper: +# +# Since: 7.0 +## +{ 'struct': 'BlockdevReplaceWrapper', + 'data': { 'data': 'BlockdevReplace' } } + ## # @TransactionAction: # @@ -174,7 +185,8 @@ 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternalWrapper= ', 'blockdev-snapshot-sync': 'BlockdevSnapshotSyncWrapper', 'blockdev-add': 'BlockdevAddWrapper', - 'drive-backup': 'DriveBackupWrapper' + 'drive-backup': 'DriveBackupWrapper', + 'x-blockdev-replace': 'BlockdevReplaceWrapper' } } =20 ## diff --git a/blockdev.c b/blockdev.c index 9fd1783be2..8ff0e2afe8 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2294,6 +2294,34 @@ void qmp_x_blockdev_replace(BlockdevReplace *repl, E= rror **errp) tran_finalize(tran, ret); } =20 +typedef struct TranObjState { + BlkActionState common; + Transaction *tran; +} TranObjState; + +static void tran_obj_commit(BlkActionState *common) +{ + TranObjState *s =3D DO_UPCAST(TranObjState, common, common); + + tran_commit(s->tran); +} + +static void tran_obj_abort(BlkActionState *common) +{ + TranObjState *s =3D DO_UPCAST(TranObjState, common, common); + + tran_abort(s->tran); +} + +static void blockdev_replace_prepare(BlkActionState *common, Error **errp) +{ + TranObjState *s =3D DO_UPCAST(TranObjState, common, common); + + s->tran =3D tran_new(); + + blockdev_replace(common->action->u.x_blockdev_replace.data, s->tran, e= rrp); +} + static const BlkActionOps actions[] =3D { [TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT] =3D { .instance_size =3D sizeof(ExternalSnapshotState), @@ -2372,6 +2400,12 @@ static const BlkActionOps actions[] =3D { .prepare =3D blockdev_add_prepare, .abort =3D blockdev_add_abort, }, + [TRANSACTION_ACTION_KIND_X_BLOCKDEV_REPLACE] =3D { + .instance_size =3D sizeof(TranObjState), + .prepare =3D blockdev_replace_prepare, + .commit =3D tran_obj_commit, + .abort =3D tran_obj_abort, + }, /* Where are transactions for MIRROR, COMMIT and STREAM? * Although these blockjobs use transaction callbacks like the backup = job, * these jobs do not necessarily adhere to transaction semantics. --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645832655398675.0087304904426; Fri, 25 Feb 2022 15:44:15 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-28-rIFMsQNVOpm51oAgo2jesg-1; Fri, 25 Feb 2022 18:44:10 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D9EF48145FA; Fri, 25 Feb 2022 23:44:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7A1193278; Fri, 25 Feb 2022 23:44:05 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 887D21809CB4; Fri, 25 Feb 2022 23:44:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhsuZ027614 for ; Fri, 25 Feb 2022 18:43:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3AB90400E88; Fri, 25 Feb 2022 23:43:54 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 358AE492D1B for ; Fri, 25 Feb 2022 23:43:54 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 156A9811E76 for ; Fri, 25 Feb 2022 23:43:54 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150095.outbound.protection.outlook.com [40.107.15.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-ZU3I4M4WM-yy4o3JrTEduA-2; Fri, 25 Feb 2022 18:43:50 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:42 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:42 +0000 X-MC-Unique: rIFMsQNVOpm51oAgo2jesg-1 X-MC-Unique: ZU3I4M4WM-yy4o3JrTEduA-2 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 07/11] block: bdrv_get_xdbg_block_graph(): report export ids Date: Sat, 26 Feb 2022 00:43:04 +0100 Message-ID: <20220225234308.1754763-8-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f131334-be87-423b-d3f9-08d9f8b8a7ef X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: FlSptU962G33QTUfRDTdCR0TxKQV7cJ0A7rmgvT5pt2zE6aATsSYFbg189PYnJ6GFwiDN97YaswLBFlFvR6cljOIz7+Zm7ezRA2iKArH7b9VinLOk/mNAmZfb80Eqk0HIf5Ga+31A/3jk5frSCgu+e1Xl6J2s+jkxQPPwY1gFcrFKxgMtUDfDDJwMrD+KA38kUg6aOjlYfjdjF91OiH573sv1d9fxlV0uYeuNMHf21ApaWiahIz4bC/SHMuBuf8UhO2gw4QQ90CSMwvseK/QyLTLtjTt1lApoL8DLHrvQq5dQGPa9hH6h3s3yhdfOaL48jxx3oBKJAkYf/6/uQddT13B4hRrBfWmKbwcd3KwVUOH/EwGi/GRNV8t7gRUGuRcKnKLsLxTeN+VdFZm7EqAbMAemrSP0VoGMeIJHJ6RlItq81Q8gUXKbmtm59QU1hC4HXTLfWaR/wk9b02g18fkeBFJq14HskMwHqiu8YQRUdMCaVubcaE02p8Dbi7o4w0JJDG8lignxl5/pXpzlXjnTT+KcJ1Zjzu+Ok9X1jo6ioUXkctwQTTHI90mG0XCAUh9O72nghNMaDzjFUN6cckikaUI7VIocFP5aAho8kXq7GZK9piTDS3DF8AAgumyVvBpFfXNiZm2uL/JDYxt9dof4CyrMv+pMA37BxBQzObrlw8BfyOVsMiW01czAflfSsHF9sB/Lyp1tP28m/t6ZFC7AQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?wieumjv8nKsWCNuDRCkNcpjULKg9KmA30GqwPKWwSYiRLgQT8WfISM/G3eyE?= =?us-ascii?Q?xH7E1a904f9qZqhzM2Ee4ERzscGW3V/o2Uv+Y5mbvUY4xHKisMNFZ+AZ0dob?= =?us-ascii?Q?IlXWrd/SpP/4rOMyqQBXsFiqDm3IiLW0XJSBdNeeN3zVl0/IUOlUvSr0cEhM?= =?us-ascii?Q?Mp5kJfNJwxNUSy+EdN7/+wji0pZubFbf6nvZxDw6guGjJZ8UZUBmeCzaQmXU?= =?us-ascii?Q?bDhOxJVOH+Q6UCTn+F5+RczOJtuHVfXOqi+b7BhDLuUaBJ2Dfm/1VjSq+8kb?= =?us-ascii?Q?E79rHaGASkiFuaMIcgiTvQsxkmX31oBAP47qqpk1W1gdicEQG4AiAyc4kShh?= =?us-ascii?Q?R8YvInph5VkRirH3Qk7xwIX3lRQauza0HjdpFY1DbTi0ma+NnReGDlLVsC4y?= =?us-ascii?Q?fV6bsqMC0EBeIFnjUXpqFlbvj7v67u/2xQy7pdGfbQB427C35idVE9HFsO2Z?= =?us-ascii?Q?NfIJDp6s8fCW7Hd/KztRKZ7a52AMN2QYPC9doCBViDVnszKVoTOBhCfxxdw0?= =?us-ascii?Q?CTpZ1r5N7tM/E+h5wizxKTqxNUsQ5OyJhYMyyFl2xm2XaISQUGJAwwvWiuqC?= =?us-ascii?Q?nfKYScudqNrv4Lg8DbMNj57u3TX2DQlQEnMvhIW8FbHM6vYPmieibkIdr8fF?= =?us-ascii?Q?iEprun3LH9M4nGt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-ascii?Q?5n6nloVmoNq9rI8Qlh0Pq7dC6OjPMSLgsmkvTBFQtj2yBIRDVZ91aBiLD8Ry?= =?us-ascii?Q?iKrZkhL4CzfOvxkZuDviYPoGMcNaSWvEqLfQZvaTwQlZbjaYA4Qo7co/sbps?= =?us-ascii?Q?recc5Q=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f131334-be87-423b-d3f9-08d9f8b8a7ef X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:42.6693 (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: MMaraHuV+8AfvQnrvJIfqa3G6dd/Q93z+NBmjA122ffx5rWs1tqa91F8Kulmxi10TCWozQ/Ep7f+F8LfTXxbqh4mN6wirF2eWzshdEgv6Lo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhsuZ027614 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832655961100007 Content-Type: text/plain; charset="utf-8" Currently for block exports we report empty blk names. That's not good. Let's try to find corresponding block export and report its id. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/export.h | 1 + block.c | 4 ++++ block/export/export.c | 13 +++++++++++++ stubs/blk-exp-find-by-blk.c | 9 +++++++++ stubs/meson.build | 1 + 5 files changed, 28 insertions(+) create mode 100644 stubs/blk-exp-find-by-blk.c diff --git a/include/block/export.h b/include/block/export.h index 7feb02e10d..172c180819 100644 --- a/include/block/export.h +++ b/include/block/export.h @@ -80,6 +80,7 @@ struct BlockExport { =20 BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp); BlockExport *blk_exp_find(const char *id); +BlockExport *blk_exp_find_by_blk(BlockBackend *blk); void blk_exp_ref(BlockExport *exp); void blk_exp_unref(BlockExport *exp); void blk_exp_request_shutdown(BlockExport *exp); diff --git a/block.c b/block.c index b2f55ff872..24baf58e80 100644 --- a/block.c +++ b/block.c @@ -5979,7 +5979,11 @@ XDbgBlockGraph *bdrv_get_xdbg_block_graph(Error **er= rp) for (blk =3D blk_all_next(NULL); blk; blk =3D blk_all_next(blk)) { char *allocated_name =3D NULL; const char *name =3D blk_name(blk); + BlockExport *exp =3D blk_exp_find_by_blk(blk); =20 + if (!*name && exp) { + name =3D exp->id; + } if (!*name) { name =3D allocated_name =3D blk_get_attached_dev_id(blk); } diff --git a/block/export/export.c b/block/export/export.c index 613b5bc1d5..ca6c8969ca 100644 --- a/block/export/export.c +++ b/block/export/export.c @@ -54,6 +54,19 @@ BlockExport *blk_exp_find(const char *id) return NULL; } =20 +BlockExport *blk_exp_find_by_blk(BlockBackend *blk) +{ + BlockExport *exp; + + QLIST_FOREACH(exp, &block_exports, next) { + if (exp->blk =3D=3D blk) { + return exp; + } + } + + return NULL; +} + static const BlockExportDriver *blk_exp_find_driver(BlockExportType type) { int i; diff --git a/stubs/blk-exp-find-by-blk.c b/stubs/blk-exp-find-by-blk.c new file mode 100644 index 0000000000..2fc1da953b --- /dev/null +++ b/stubs/blk-exp-find-by-blk.c @@ -0,0 +1,9 @@ +#include "qemu/osdep.h" +#include "sysemu/block-backend.h" +#include "block/export.h" + +BlockExport *blk_exp_find_by_blk(BlockBackend *blk) +{ + return NULL; +} + diff --git a/stubs/meson.build b/stubs/meson.build index 90358823fc..92e362a45e 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -2,6 +2,7 @@ stub_ss.add(files('bdrv-next-monitor-owned.c')) stub_ss.add(files('blk-commit-all.c')) stub_ss.add(files('blk-exp-close-all.c')) stub_ss.add(files('blk-by-qdev-id.c')) +stub_ss.add(files('blk-exp-find-by-blk.c')) stub_ss.add(files('blockdev-close-all-bdrv-states.c')) stub_ss.add(files('change-state-handler.c')) stub_ss.add(files('cmos.c')) --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1645832667500748.6419015640591; Fri, 25 Feb 2022 15:44:27 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-208-bhN58uDaPPy08t4GsKEPoQ-1; Fri, 25 Feb 2022 18:44:24 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 483B780EF8B; Fri, 25 Feb 2022 23:44:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F236F34B5C; Fri, 25 Feb 2022 23:44:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C443C1807D61; Fri, 25 Feb 2022 23:44:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhuk2027626 for ; Fri, 25 Feb 2022 18:43:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id F1919400E101; Fri, 25 Feb 2022 23:43:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ED05440D1B98 for ; Fri, 25 Feb 2022 23:43:55 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D62093C01BA5 for ; Fri, 25 Feb 2022 23:43:55 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150095.outbound.protection.outlook.com [40.107.15.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-vWY_7wn_MEaW88lJuy1-Jg-3; Fri, 25 Feb 2022 18:43:52 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:44 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:44 +0000 X-MC-Unique: bhN58uDaPPy08t4GsKEPoQ-1 X-MC-Unique: vWY_7wn_MEaW88lJuy1-Jg-3 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 08/11] iotests.py: qemu_img_create: use imgfmt by default Date: Sat, 26 Feb 2022 00:43:05 +0100 Message-ID: <20220225234308.1754763-9-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4410047e-7462-4324-67ac-08d9f8b8a8a0 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: amovOHKQQJfZyocOdYabNxcm8KdXXWBpNzDZOqFWXRjvv/2Uh3Q6r2rHoBkeY1wtzjc/3/srFKpGJm3pQ7dWh3b+mXP+CPJNYpUJP5+qbItc1H9HBdkmURXtoNXovDac1ogVFqX+4y/wuzEUnelLdiUd8S6igN0kSIDkBKV1pGm8GVHyWDm3fcCuIyhCYB41rx0DptrQghjcTS246byzKp4ij3cp1VfjdNO/EtMkuCU5kizfbM9aShnPbv98/Y+dWunirtZ20KvKIb6jSy4iId6UKJ/DaKPn5K4ahnc7h7mqIj7olAzTxzvwRQ7ibTHTx+zmNcvmekh5VnktSfLwM10Nmhnt1lKNF7w6eKjk3ZspkMXcPIxe5TVY86A9A0M47P4KwKGK+LvjEZd2o2E1OOzE3ba2UUxGmuPA0U7JQ3Lh8redK0rLzZdd7wWnxnlADgox7yRTJ3Y5zex3cojz7KeCyni5P2KcRuf5qcrLnxOVAgfQXJGLdmGt7Vtao4ODJsAPU/cTxmxTdcNmRvmT3be/0DKwG2ZPqsdtGufzHC2Lk0Ld8VlFZYyDfnq/JjvpAfyXj9BBpMYc2/z+Ran70+r1HHYnrgagTN/XPoLuuOh4UlEQnvqoTvYX3kdXpdFT3PbAAdjoU/4rDZyXK/zy7i91k6+tGbE/c3B/sXqtjqVbFLQd0j3bRcpt2q8l67+PH4Ty5JKZmhkgL+4r3r1UKw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(4744005)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DWcCMvOXFlpUunOjnlVcobG66jhXUZcONHiW5y8mc/tNYLrxaGAY4gjKEcb/?= =?us-ascii?Q?FgKUOGM/OqkvcYpIlEKNbKCgsj1cJs/pSugxzhV22DZXvLqnOQyu4LSmRISk?= =?us-ascii?Q?sZy3FSduYp9ydzWZ9kdddIE8Mns2xn70F2T3m7dgGlCrJxl+tTvm94JtumSY?= =?us-ascii?Q?WdkajUfH2rjmtzTov8gId793Lr4mvysrr+aOQYxOUOwE5eNi2TqnIUVnHF1g?= =?us-ascii?Q?sLsiI4n91SDshmVixVexnDgRYjCW90/7elfRn/C6V5YybJPskMHwQBA+yOOq?= =?us-ascii?Q?avcEjxpvwvFOH7u2Tjw6hiGkkpUIiVh8slzpUbL3BvVnVvVUn9mC+s5owXgg?= =?us-ascii?Q?SSMUZXmvoaaUK6R6MaMxX3n2x2S3ZKVbWqK8GU61fgzluOHkJsKiiqasaQ1l?= =?us-ascii?Q?J2OwH4+o8KX4+F2CVuICndJTtXvFBIhQocg7Yf7ar7oOHPNfyiyyh2h1Vyl8?= =?us-ascii?Q?lgTx5ga1Ayx6D3IYlRwPsyB25YeF82kmmODORZLSQ+/N/NFeLp6cAWtIWKHF?= =?us-ascii?Q?Lg6dbYoIngGZPzh098jajLRUZXf1M3CLVua6EBKbE2EeolUG1t+pJ3BOyohX?= =?us-ascii?Q?8A+ky1NqVgmePCDgnbpsA1CGKUo+Z4FjGWBdH4Nsptpm7HftYvrlwRuZ6mx7?= =?us-ascii?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4xGbzyT6bjvni3861?= =?us-ascii?Q?Vn6s2+MJRoa//wfY5JuYIzBVv3Pm/h+uRaiivZu+Nnsisi7jWkEQw2b57Rzz?= =?us-ascii?Q?A4REp0PBQ4QNxJbPAN7JpEJQcRKGvPlhjoh+utdOMzaSjLJB+lHtpwMIsX+R?= =?us-ascii?Q?xxnQkA=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4410047e-7462-4324-67ac-08d9f8b8a8a0 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:44.0296 (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: nvsPI/rp56J3dlr8uhUGsGBK5t5d1dhdzihMXUkhJzjtwREAi/Sd1Co4tdI1HzQZP3Cc4f2SquaroAfEqEXpQNCiM6rXJkvKpjMAIVqOywk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhuk2027626 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832668002100005 Content-Type: text/plain; charset="utf-8" Less typing: let's use imgfmt by default if user doesn't specify neither -f nor --image-opts. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 6ba65eb1ff..ca17a5c64c 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -233,6 +233,8 @@ def ordered_qmp(qmsg, conv_keys=3DTrue): return qmsg =20 def qemu_img_create(*args): + if '-f' not in args and '--image-opts' not in args: + args =3D ['-f', imgfmt] + list(args) return qemu_img('create', *args) =20 def qemu_img_measure(*args): --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832672044705.25125952902; Fri, 25 Feb 2022 15:44:32 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-349-AzC1hI1KMDKUT-KYO_4PTA-1; Fri, 25 Feb 2022 18:44:27 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 95D7780EDB1; Fri, 25 Feb 2022 23:44:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7889388F1D; Fri, 25 Feb 2022 23:44:22 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4D83144A5E; Fri, 25 Feb 2022 23:44:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhvHL027643 for ; Fri, 25 Feb 2022 18:43:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 516404010A0E; Fri, 25 Feb 2022 23:43:57 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CDB84010A14 for ; Fri, 25 Feb 2022 23:43:57 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 362B4802319 for ; Fri, 25 Feb 2022 23:43:57 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-1-qQHSIyOCSoN4HEVa_8Cg-7; Fri, 25 Feb 2022 18:43:53 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:45 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:45 +0000 X-MC-Unique: AzC1hI1KMDKUT-KYO_4PTA-1 X-MC-Unique: 1-qQHSIyOCSoN4HEVa_8Cg-7 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 09/11] iotests.py: introduce VM.assert_edges_list() method Date: Sat, 26 Feb 2022 00:43:06 +0100 Message-ID: <20220225234308.1754763-10-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d6a1faf-73b0-4167-f1cf-08d9f8b8a976 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: Hmj+PF5Q5ozDuw/3sNzoTrkCzKA+3XuH9uC5l9/QyacKPb3mHwJp8OJpUIPDmT9K0m03ir9RTVEUrQAu7MU3g1SVwrlpe4F3XAW3XkauPaTXAYKqV4deRGvLXXUAlAAuFko+vr/9VylT2rleTJkgkoDlgFVRdQvXMz62SiHsOG+v968+bRzcC7myDbyKXzVmJhfvFsSfCI+39JWtMunA8Y40JdY+aVhJOSGrJBCT8GSQ72O08+9oBbECJH/v29d+Ch964VnScKGQkkl0NuKMN8XcODt5RF3wIO3ePqnLqzIhHlLwUvLUvGbsSJ64TplnW0Mg+n8iqAPqHsOHpBIeW5UacF7YNyx57pF+YGp8h8unWAxdaI2YU/2Oe3RxFTb80frQj78tFipOBmYAnyxQYQS6XV05U9vbQq+1QO9KSkeYZPblctUOe7CmbRs/Xo51fwNEGh5eX54vEIQDW0XGa/xvVMCO0LBr/DQxgbczUcCNTh6rl3MklYbx3UhEf59hH2bW24qtwz5e3kz+1Wm7s4BMjigA+Ic0h28ynOAYLALtQaXjwlwrVg6jE4mBfO2JVOJ+OpesxiWOyccmXPyakKkj+a8ACsB+vfOMArl5tNfO5OlyTslfOq4xNplIPsU9ZvMo2m84w+x/IyuhlPmwGycwqirDMRGzmnHiH7xXriRxhFNAD5oKygCIBUoDGsoMuEs9wsFUmMOd4ujPXyzuLQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?V1/ZxOQiwqxNsK7W5gEseWZJOc7kBJUGxPf3ZxjLXA5DfPSBjaru3Lx34klH?= =?us-ascii?Q?qV74J8j/TrX5LAicNokfyMjfQ5UKVTd8FEV2DsRidA5CEvQi4v9Ewq6JRm50?= =?us-ascii?Q?XTWNhsWv/PTkuxFkAVExov+BmnjDUFbzI04zdMCYPvZXb3th10cHuaC/xgnI?= =?us-ascii?Q?pI9JgUUJXGHrl5F/sqGDoJunTIsr55uB++LNfYCEELpxgqjRbJGMhd59/ps9?= =?us-ascii?Q?4v4jigv9kedX1qHC0+TGG/pH7g6QoysWiQtQzXrMuYnZtpYjtm+HmGGExDPn?= =?us-ascii?Q?O4y5HKhRVIhPDDhP/YIbP/hv5jHW8wXAQ6RIfu9U0ZyJJSNPb3W44wPdF9CT?= =?us-ascii?Q?ORAGtLFo9A6Z0cvQBmwDIXJi4XIlDXsDFwJ7jvE44RBWMe4GmEAcrE7Gss7N?= =?us-ascii?Q?7KGoWkqDCm9EX8eKsXVraqm1bKEXg6JsFxJNPK4Fh2tRkMbLHkAgZhv8gBlR?= =?us-ascii?Q?It4amK19T127a21H9UGp9OXzGFYmM/eE0co9EV8MslrsCM0cx20MwcDURZAE?= =?us-ascii?Q?UmWhrOV1sD/ufCpEVeTPhiaPxJrmVlt505umUtED6L3ygQUqqK/fX43in51U?= =?us-ascii?Q?QiZdagddLdm4kSTsvtYqRu2flukw7/dNROF/PMdy9KUakGTJgq0IPvjcmJ+2?= =?us-ascii?Q?ClN0m16HIb3QQlPRW7rosPi8qPe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ii?Q?xBHqHQe9smfot+kH38xYbNslN6bBNAkaJRJptu626Ok1l1oZo9IwrZ+jQbOE?= =?us-ascii?Q?MPymb+10hKSLlWhlQIpz4twMpsuIZi+BssO2oB2osRz58gsMIYAMR+VkcdPF?= =?us-ascii?Q?AG8wMw=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d6a1faf-73b0-4167-f1cf-08d9f8b8a976 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:45.3419 (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: eX90B0trBWHf6VELkFUaEhKifPFN/g4p6+ANf+DIoA8ef4+c2+ufW7ZAz/tag1GpZuJQXA9A/42dDGdcopanvfbEsHcp8FkZmAKYuHkJeOA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhvHL027643 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832674066100005 Content-Type: text/plain; charset="utf-8" Add an alternative method to check block graph, to be used in further commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/iotests.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index ca17a5c64c..1b48c5b9c9 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -960,6 +960,23 @@ def check_bitmap_status(self, node_name, bitmap_name, = fields): =20 return fields.items() <=3D ret.items() =20 + def get_block_graph(self): + """ + Returns block graph in form of edges list, where each edge is a tu= ple: + (parent_node_name, child_name, child_node_name) + """ + graph =3D self.qmp('x-debug-query-block-graph')['return'] + + nodes =3D {n['id']: n['name'] for n in graph['nodes']} + # Check that all names are unique: + assert len(set(nodes.values())) =3D=3D len(nodes) + + return [(nodes[e['parent']], e['name'], nodes[e['child']]) + for e in graph['edges']] + + def assert_edges_list(self, edges): + assert sorted(edges) =3D=3D sorted(self.get_block_graph()) + def assert_block_path(self, root, path, expected_node, graph=3DNone): """ Check whether the node under the given path in the block graph --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832659279995.343702622394; Fri, 25 Feb 2022 15:44:19 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-213-cNJxfLW-M-CxyLgmn1ew5Q-1; Fri, 25 Feb 2022 18:44:15 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DBB9180EDA9; Fri, 25 Feb 2022 23:44:08 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B963493278; Fri, 25 Feb 2022 23:44:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8CDEC46F9A; Fri, 25 Feb 2022 23:44:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNhw9f027651 for ; Fri, 25 Feb 2022 18:43:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6243AC202D1; Fri, 25 Feb 2022 23:43:58 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D95BC202CB for ; Fri, 25 Feb 2022 23:43:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 455D58039D6 for ; Fri, 25 Feb 2022 23:43:58 +0000 (UTC) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150095.outbound.protection.outlook.com [40.107.15.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-z1tq680vMuqnXWRYVcJCRw-4; Fri, 25 Feb 2022 18:43:54 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:47 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:47 +0000 X-MC-Unique: cNJxfLW-M-CxyLgmn1ew5Q-1 X-MC-Unique: z1tq680vMuqnXWRYVcJCRw-4 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 10/11] iotests.py: add VM.qmp_check() helper Date: Sat, 26 Feb 2022 00:43:07 +0100 Message-ID: <20220225234308.1754763-11-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d529dd2b-0640-4b3d-2d43-08d9f8b8aa3d X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: V3MyoQcKtlxrNtewyXAdGZDZJFv/DJmVPyziMnrTr4sgPTQH1GgdUFUYnyJAz8+mK/oIhfiYvD1KzD92d1F/OsNX3niUM9/xZhFeZzMQwZPiKx9j7EBHoG3L5bIwuoCvpjetlXE43VzLZcspHFUVBF3NqrnWjssAOGh3REi9GgB2TwvNjmwXYBhOEy6TXqsg+OQzTPU0hJAT+Y/427xe5W4H/AhjiXdupHsNJXtIcu39b827cGth9jv01W5QOATb1xWcvO72nx8mLPE1u6IbjR6nOupYlvKbl+wUZSFFr4rc2L9Z8onB4luSAbXNTXmTeM9MHRx/4XEgDx78Yw9g4FV+kKjUOhLsSFuyci8garV64fAgcE3TXH1jRmVvEB+yxbU9WgV6MYNTGMz1bTLuRX5/uf2491vv6NF7sV+X0bGAeZUsI1k9++pUfpK9e4lMB/++o4U2riADHaIzjojV/DaGyKbaT9ndzkkMjwCtja0CNmPQFcfmVhEtP8WarXJQUjPxGIVWKK1zbT7Br3DLC2/UaXKuPCeKRxnvqQxhe5H6VfIt1pL/P25TyXzKV806vMhlUd7XO6RfwDm+mjDz+u8tobBnCMZElwOUed++tYT8dLQLQh32O0eDgM24aSf4sCa65jtk8vsEw1RzOwbv2iIr2ZwfwJeYE683RkITBtjaj016S+A4RkbfAg0ltKPp3RsR2LO889MWHzCqvnVYlQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(4744005)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?B2q6wUaGiPV/B0DqBVyaHxabMsAhB+ZY4uFgwObzuSpn7lWsWaauvGgZr1c5?= =?us-ascii?Q?dw5OYwgnPq/35u11eenKLLR3rNbwURqHVKf40qQcibc5nMc+0sPdAgVzhroN?= =?us-ascii?Q?rNkwHrSn/hA3U4Z8hA5ta1/Wb43+Q9CAWgPSjJzu5fkafQtEZNYr/fvvFqh8?= =?us-ascii?Q?D84D0gTG7LaOwZL59RYLzzMAg5H3F7XC0XFk18GwtVO/GVj/9wvzD9rT04OY?= =?us-ascii?Q?iqgfe/DBHcfHc0Qb7EAYoG4zNCEVRAoiqJbqavZmgguq0apcN6A37xhM/2Du?= =?us-ascii?Q?2BP1el/lkOho0Lm1JdzdMfEd+Kg9sitixVHkGd4PzT4YGtJseTpAYMft0if9?= =?us-ascii?Q?mCDcrHTyALyiqt1+S0zHKAXky5whQ3/QBhG61tRTYyoUs+Sp+lOD6DJsznF6?= =?us-ascii?Q?+bL/nuFOk3+uIo2utg8vw2x3lVGnCuRxchJmI18MUEFreNNluDAjWPjhC9ro?= =?us-ascii?Q?J8jOd0TjzN4SeFN6iRMWj361s3wEqV7l1s8jOWyskJbawq9UadeK3/2vcPCD?= =?us-ascii?Q?l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zpbr5cD7u6647c?= =?us-ascii?Q?tJMYHzcXpQzioB1SCNi209Vul1pdLYkC9kgGgaFT0KFNibohARM/OxvxReXa?= =?us-ascii?Q?UROCKt78L+XdgMMqCh6ZGcZumVR1Ya0t+ENqz7VnLnZKxgPoxNrNaUKLR3F9?= =?us-ascii?Q?S6/dlhUzQvZM3FSrcy7s7vqJMQJaYmU9HqvfX+qGdInc/UvCXeipBU2MVeKv?= =?us-ascii?Q?5KuGacnz1Zyoq6hNpf3XdA2L7vTvWBW7Ev1I2iS5fxheJux7JwI9CkqN04ZU?= =?us-ascii?Q?eNyH7Q=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d529dd2b-0640-4b3d-2d43-08d9f8b8aa3d X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:47.2794 (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: f115asgwFh48it6s4ViEYZHrWuT73NN61leICkK4KEYYAGQeuqZ5WRwjzdAUGBExW0yuJiubYaQ10Zlo8RCCwAqEUfytQIo7PPBsId2nPbk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNhw9f027651 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832660142100001 Content-Type: text/plain; charset="utf-8" I'm tired of this pattern being everywhere. Let's add a helper. Signed-off-by: Vladimir Sementsov-Ogievskiy --- 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 1b48c5b9c9..dd33970454 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -977,6 +977,10 @@ def get_block_graph(self): def assert_edges_list(self, edges): assert sorted(edges) =3D=3D sorted(self.get_block_graph()) =20 + def qmp_check(self, *args, **kwargs): + result =3D self.qmp(*args, **kwargs) + assert result =3D=3D {'return': {}} + def assert_block_path(self, root, path, expected_node, graph=3DNone): """ Check whether the node under the given path in the block graph --=20 2.31.1 From nobody Thu May 9 23:01:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645832658903496.86712592933134; Fri, 25 Feb 2022 15:44:18 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-0DhHeqwDOYCnwQvMJJV5yQ-1; Fri, 25 Feb 2022 18:44:16 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C92C51091DAB; Fri, 25 Feb 2022 23:44:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A90F887D91; Fri, 25 Feb 2022 23:44:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D2C944A59; Fri, 25 Feb 2022 23:44:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21PNi0KQ027663 for ; Fri, 25 Feb 2022 18:44:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id EC6821454542; Fri, 25 Feb 2022 23:43:59 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E71C61454545 for ; Fri, 25 Feb 2022 23:43:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CA862811E78 for ; Fri, 25 Feb 2022 23:43:59 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80095.outbound.protection.outlook.com [40.107.8.95]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-486-zAHXXVovPfGxLXINiUFf6g-8; Fri, 25 Feb 2022 18:43:56 -0500 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by DB8PR08MB4172.eurprd08.prod.outlook.com (2603:10a6:10:af::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Fri, 25 Feb 2022 23:43:48 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::49c:67e9:3e24:8714%3]) with mapi id 15.20.5017.021; Fri, 25 Feb 2022 23:43:48 +0000 X-MC-Unique: 0DhHeqwDOYCnwQvMJJV5yQ-1 X-MC-Unique: zAHXXVovPfGxLXINiUFf6g-8 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 11/11] iotests: add filter-insertion Date: Sat, 26 Feb 2022 00:43:08 +0100 Message-ID: <20220225234308.1754763-12-vsementsov@virtuozzo.com> In-Reply-To: <20220225234308.1754763-1-vsementsov@virtuozzo.com> References: <20220225234308.1754763-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: VE1PR03CA0006.eurprd03.prod.outlook.com (2603:10a6:802:a0::18) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1181dc66-0401-40dc-af5e-08d9f8b8ab58 X-MS-TrafficTypeDiagnostic: DB8PR08MB4172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: f24uvEAvUrlBLzzQqCvlpZAXLUllKKr6kpG4h9CjRGJJUMk4i9TOeKN+f49QasgB8m3OzzoylZAyKO0Hy3sYu1uhXhXFad1f49GozYIyUD/9FxO8OR6DK+XGdoqMkv0wIlX21HhCk4Po83m5jB9TqUgaR7SzxsGqzoDzvLIIz/dTky/p5F4RdYrIFha5olTxRAY7HxAMLUigrJtlUC0wzFnJv6BlHjXjJd580R2KBlxWSqVLH24yMyTgR5yqMv0Yy3CsRF5/vfQlJQ9Y1EreUVN8qU3Lgj8fUIgIJioBu+sjT9tzOGYk7/0B4JstJxn0EgrtRPIOlug1j/PrwxYA7poZa44NbPnsR2+/NnDTKdSmPa9/qrQqotYRf2/KWFsKt+daNDhNDxqWuWhxyxo/QcAPhJze6l8yBs98530ENN1sQ9fSTnFwgfwNK660vMBV/4Pss4N48ZjdEhZHxpvPcm/0nV2VxoduC6jGYf2Djbbi6CFwiJgjNc7Sdb33iTob5b44xTlU5cv1098DauFpj8LUi6VwuO/QCtEUXVBNrVp7P1Y5xbuQBv05TklVjGXaRLLYbEgFDmyl5kufSAQ4qpUY9IcF98dy5+1hv7iG5v9pkGOEm51e+2I/oDWEu76Ft78oAyCdvPz1TwYZKix0zYRW+IoeVbatRfGNWjXxpYKddjBm9hwJLt/wwk9CuVHW2x7rIeWiROfxNdrdAJq8hqNTtyKqsYCao1tYUx83NAZhg3FC/PZ6yECQpzMfmtSf6oQf4TB46Xf0dYFTg40Xewm8wOKH9dTcEhhPR8wWukqSOjplliNy1wc8rqRReYzo X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(6916009)(6506007)(8676002)(66556008)(5660300002)(83380400001)(6666004)(7416002)(8936002)(52116002)(508600001)(6486002)(6512007)(2616005)(26005)(316002)(36756003)(38350700002)(1076003)(38100700002)(2906002)(86362001)(4326008)(186003)(66946007)(66476007)(2004002); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?pFFIbWdQV2hhPYQZdnhir+x2aizoBGDNJLNb6670Atq662tF5MYSFvukyZof?= =?us-ascii?Q?ktHgpwEKsxhEGTbJFoNrDvfF7+rXzoywTNwI/i+P4rWbM/OwjEYEA1WjN8jC?= =?us-ascii?Q?QXKtd6n7DeImLvXt4Qfah2R4MSYOolDTwDa77eIv8FQweK64wWojqzsr4UFj?= =?us-ascii?Q?PuB8N5pxpl2l9jz3NV4/6w86xq6GYcFF+Fl5RasX2kFE3gRMZeUBkZ53UtCW?= =?us-ascii?Q?oqIVfdgs34357KvlAfQ8L28CncLU8DaBwpj5+LWW6ghG5Ius5OnlwoOQq558?= =?us-ascii?Q?c+n+b7oT1j52IXcksHmJFUtw9lDp6eM9t0f+xuk4wO6BBLiW5N8cEuBDc/WS?= =?us-ascii?Q?IEvcgcITqVCoC0EXSDx7tBHg5PpL5T/foHEpWQlVb9soNGnTQYGjdxX2BLwQ?= =?us-ascii?Q?8gF61VioJrrInqZERtNWEoS2pm818Ecwqpwg65HbbYQHIonBlSqyGe0PYG4s?= =?us-ascii?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OSCPlprQz32wYGDTTPdjt?= =?us-ascii?Q?+O2j852vN5LNFcDE1bUBxa22neawZYxDSkCo0kkKCyvYGe72sd9ROyKgKWKc?= =?us-ascii?Q?uu+ilAS5oCpnrGleDuMyZl/U7XvxhffiWQfPKQq8kdeen8Pu2fpR9DvukabD?= =?us-ascii?Q?OOxPvEaaDK/ei5ek95x1qU/Q6EOkJxNKW+UFTrIX+P4CWwn2XOCfsLTW3j98?= =?us-ascii?Q?iXsJT2+29TidaC2MUC6Ra/BfiF7PcAvROcETfTbhFfwhXxVp7mY782Nay6MJ?= =?us-ascii?Q?1phg5oSUw63vVdTKB8j3e4dU4cKFki7tC/mroHxjog9SaMODgt5OroOwdR7t?= =?us-ascii?Q?QSfLrw=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1181dc66-0401-40dc-af5e-08d9f8b8ab58 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2022 23:43:48.3741 (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: iVO6qh4wG7pCGkfrW9833XQNl3AZ6DAxBNubZ6YL70gL9rLMmpyf1FNdg6FiNAt96u999KRt404Ik2kiAyozO9PD/xHucqVz4YeBALJn7QY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB4172 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 21PNi0KQ027663 X-loop: libvir-list@redhat.com Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, libvir-list@redhat.com, dim@virtuozzo.com, igor@virtuozzo.com, qemu-devel@nongnu.org, armbru@redhat.com, hreitz@redhat.com, pkrempa@redhat.com, yur@virtuozzo.com, nshirokovskiy@virtuozzo.com, stefanha@redhat.com, den@openvz.org, pbonzini@redhat.com, eblake@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1645832660176100003 Content-Type: text/plain; charset="utf-8" Demonstrate new API for filter insertion and removal. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/filter-insertion | 253 ++++++++++++++++++ tests/qemu-iotests/tests/filter-insertion.out | 5 + 2 files changed, 258 insertions(+) create mode 100755 tests/qemu-iotests/tests/filter-insertion create mode 100644 tests/qemu-iotests/tests/filter-insertion.out diff --git a/tests/qemu-iotests/tests/filter-insertion b/tests/qemu-iotests= /tests/filter-insertion new file mode 100755 index 0000000000..4898d6e043 --- /dev/null +++ b/tests/qemu-iotests/tests/filter-insertion @@ -0,0 +1,253 @@ +#!/usr/bin/env python3 +# +# Tests for inserting and removing filters in a block graph. +# +# Copyright (c) 2022 Virtuozzo International GmbH. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import os + +import iotests +from iotests import qemu_img_create, try_remove + + +disk =3D os.path.join(iotests.test_dir, 'disk') +sock =3D os.path.join(iotests.sock_dir, 'sock') +size =3D 1024 * 1024 + + +class TestFilterInsertion(iotests.QMPTestCase): + def setUp(self): + qemu_img_create(disk, str(size)) + + self.vm =3D iotests.VM() + self.vm.launch() + + self.vm.qmp_check('blockdev-add', { + 'node-name': 'disk0', + 'driver': 'qcow2', + 'file': { + 'node-name': 'file0', + 'driver': 'file', + 'filename': disk + } + }) + + def tearDown(self): + self.vm.shutdown() + os.remove(disk) + try_remove(sock) + + def test_simple_insertion(self): + vm =3D self.vm + + vm.qmp_check('blockdev-add', { + 'node-name': 'filter', + 'driver': 'preallocate', + 'file': 'file0' + }) + + vm.qmp_check('x-blockdev-replace', { + 'parent-type': 'driver', + 'node-name': 'disk0', + 'child': 'file', + 'new-child': 'filter' + }) + + # Filter inserted: + # disk0 -file-> filter -file-> file0 + vm.assert_edges_list([ + ('disk0', 'file', 'filter'), + ('filter', 'file', 'file0') + ]) + + vm.qmp_check('x-blockdev-replace', { + 'parent-type': 'driver', + 'node-name': 'disk0', + 'child': 'file', + 'new-child': 'file0' + }) + + # Filter replaced, but still exists: + # dik0 -file-> file0 <-file- filter + vm.assert_edges_list([ + ('disk0', 'file', 'file0'), + ('filter', 'file', 'file0') + ]) + + vm.qmp_check('blockdev-del', node_name=3D'filter') + + # Filter removed + # dik0 -file-> file0 + vm.assert_edges_list([ + ('disk0', 'file', 'file0') + ]) + + def test_tran_insert_under_qdev(self): + vm =3D self.vm + + vm.qmp_check('device_add', driver=3D'virtio-scsi') + vm.qmp_check('device_add', id=3D'sda', driver=3D'scsi-hd', drive= =3D'disk0') + + vm.qmp_check('transaction', actions=3D[ + { + 'type': 'blockdev-add', + 'data': { + 'node-name': 'filter', + 'driver': 'compress', + 'file': 'disk0' + } + }, { + 'type': 'x-blockdev-replace', + 'data': { + 'parent-type': 'qdev', + 'qdev-id': 'sda', + 'new-child': 'filter' + } + } + ]) + + # Filter inserted: + # sda -root-> filter -file-> disk0 -file-> file0 + vm.assert_edges_list([ + # parent_node_name, child_name, child_node_name + ('sda', 'root', 'filter'), + ('filter', 'file', 'disk0'), + ('disk0', 'file', 'file0'), + ]) + + vm.qmp_check('x-blockdev-replace', { + 'parent-type': 'qdev', + 'qdev-id': 'sda', + 'new-child': 'disk0' + }) + vm.qmp_check('blockdev-del', node_name=3D'filter') + + # Filter removed: + # sda -root-> disk0 -file-> file0 + vm.assert_edges_list([ + # parent_node_name, child_name, child_node_name + ('sda', 'root', 'disk0'), + ('disk0', 'file', 'file0'), + ]) + + def test_tran_insert_under_nbd_export(self): + vm =3D self.vm + + vm.qmp_check('nbd-server-start', + addr=3D{'type': 'unix', 'data': {'path': sock}}) + vm.qmp_check('block-export-add', id=3D'exp1', type=3D'nbd', + node_name=3D'disk0', name=3D'exp1') + vm.qmp_check('block-export-add', id=3D'exp2', type=3D'nbd', + node_name=3D'disk0', name=3D'exp2') + vm.qmp_check('object-add', qom_type=3D'throttle-group', + id=3D'tg', limits=3D{'iops-read': 1}) + + vm.qmp_check('transaction', actions=3D[ + { + 'type': 'blockdev-add', + 'data': { + 'node-name': 'filter', + 'driver': 'throttle', + 'throttle-group': 'tg', + 'file': 'disk0' + } + }, { + 'type': 'x-blockdev-replace', + 'data': { + 'parent-type': 'export', + 'export-id': 'exp1', + 'new-child': 'filter' + } + } + ]) + + # Only exp1 is throttled, exp2 is not: + # exp1 -root-> filter + # | + # |file + # v + # exp2 -file-> disk0 -file> file0 + vm.assert_edges_list([ + # parent_node_name, child_name, child_node_name + ('exp1', 'root', 'filter'), + ('filter', 'file', 'disk0'), + ('disk0', 'file', 'file0'), + ('exp2', 'root', 'disk0') + ]) + + vm.qmp_check('x-blockdev-replace', { + 'parent-type': 'export', + 'export-id': 'exp2', + 'new-child': 'filter' + }) + + # Both throttled: + # exp1 -root-> filter <-file- exp2 + # | + # |file + # v + # disk0 -file> file0 + vm.assert_edges_list([ + # parent_node_name, child_name, child_node_name + ('exp1', 'root', 'filter'), + ('filter', 'file', 'disk0'), + ('disk0', 'file', 'file0'), + ('exp2', 'root', 'filter') + ]) + + # Check, that filter is in use and can't be removed + result =3D vm.qmp('blockdev-del', node_name=3D'filter') + self.assert_qmp(result, 'error/desc', 'Node filter is in use') + + vm.qmp_check('transaction', actions=3D[ + { + 'type': 'x-blockdev-replace', + 'data': { + 'parent-type': 'export', + 'export-id': 'exp1', + 'new-child': 'disk0' + } + }, { + 'type': 'x-blockdev-replace', + 'data': { + 'parent-type': 'export', + 'export-id': 'exp2', + 'new-child': 'disk0' + } + } + ]) + vm.qmp_check('blockdev-del', node_name=3D'filter') + + # Filter removed: + # exp1 -root-> disk0 <-file- exp2 + # | + # |file + # v + # file0 + vm.assert_edges_list([ + # parent_node_name, child_name, child_node_name + ('exp1', 'root', 'disk0'), + ('disk0', 'file', 'file0'), + ('exp2', 'root', 'disk0') + ]) + + +if __name__ =3D=3D '__main__': + iotests.main( + supported_fmts=3D['qcow2'], + supported_protocols=3D['file'] + ) diff --git a/tests/qemu-iotests/tests/filter-insertion.out b/tests/qemu-iot= ests/tests/filter-insertion.out new file mode 100644 index 0000000000..8d7e996700 --- /dev/null +++ b/tests/qemu-iotests/tests/filter-insertion.out @@ -0,0 +1,5 @@ +... +---------------------------------------------------------------------- +Ran 3 tests + +OK --=20 2.31.1