From nobody Sat May 30 15:30:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1779276377; cv=none; d=zohomail.com; s=zohoarc; b=eMq1P1ao07U7XVoyIAqFiZWH2lNj/0q9KkuE0UJkrfHlTboRJRCEYPATEftnJdXWrqgFRz+Dl777Ot7c0p4tUgz3GcTNvcFLHGUTxMNeU7SuU0fjd+R1ByawW4vfr7vw3xDrEvSSn1tDvAOVKDKWU0FHPbNwd8/ATh6LyjsxbP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779276377; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=fpfH8xOGsvpuvyvxzv9tUjhJSdTTOZEzhuTZ/AOWlqU=; b=hW61Mf1MIV0zvYMozRgnt+LfVY9gxRKBLeFe0Exi7wQLG7J6+i79s2AMDWpYqHBZ+dPEqLXEkbqfPVkKbLMFQFXLFzm8aXbUdnGTJPy1IpIu+/iy8wGwqbaMHFwp6OtLT1R8S/cWpN0ZfBZkMRvMJqoJbeuwlvQlSldYYYtoT38= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1779276377019173.7518692331049; Wed, 20 May 2026 04:26:17 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id CD85841972; Wed, 20 May 2026 07:26:13 -0400 (EDT) Received: from [172.19.199.4] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id D2D2441B73; Wed, 20 May 2026 07:24:01 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B9D4C41979; Wed, 20 May 2026 07:23:44 -0400 (EDT) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 51D604187A for ; Wed, 20 May 2026 07:23:42 -0400 (EDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64K5acDj2408080 for ; Wed, 20 May 2026 11:23:41 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4e6gxwxuc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:41 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.7/8.18.1.7) with ESMTP id 64KBF2fw036242 for ; Wed, 20 May 2026 11:23:41 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4e84edhm10-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:40 +0000 (GMT) Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 64KBM3QP016439 for ; Wed, 20 May 2026 11:23:40 GMT Received: from akulhall-vm1-ol9.osdevelopmeniad.oraclevcn.com (akulhall-vm1-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.255.191]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 4e84edhm0k-2; Wed, 20 May 2026 11:23:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=fpfH8 xOGsvpuvyvxzv9tUjhJSdTTOZEzhuTZ/AOWlqU=; b=FAt+Dz6SwEKZVlJMcclCg sFkhVOM19nTO3B2n/PuJr3FdBErUOSZRKPD4BMOl33KX+edO1RSY/xEA1hvYoHPB cGavdapDK4EmJ10QCChVjyxKTXIORHVdlqPkn74gpmr9A3yl5ehEEczg1GHbwuHu wBiME3zxWHbxJsC424bWJ3Uy8j1GRjBdkgwrTJEiVssj7MtV9aIR/3sCTspb+uxd BgrBc9+zu+uUIA1Ng5oJtvq2Fvdp3WavRAbYSFsde/QOY+TT0Ouqyaow0JbeUpTC 8D/wk51dClQehFHv3rcBYMFIRq8mbGU65sjjyYxnS32JM26Gh8bA5d4FheLGMZSm g== To: devel@lists.libvirt.org Subject: [PATCH 1/7] qemu: expose process event handler to tests Date: Wed, 20 May 2026 16:49:32 +0530 Message-ID: <20260520112323.1484419-2-akash.kulhalli@oracle.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260520112323.1484419-1-akash.kulhalli@oracle.com> References: <20260520112323.1484419-1-akash.kulhalli@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2605130000 definitions=main-2605200108 X-Authority-Analysis: v=2.4 cv=UOjt2ify c=1 sm=1 tr=0 ts=6a0d99bd b=1 cx=c_pps a=e1sVV491RgrpLwSTMOnk8w==:117 a=e1sVV491RgrpLwSTMOnk8w==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22 a=3I1J8UUJPc9JN9BFgKH3:22 a=mDV3o1hIAAAA:8 a=yPCof4ZbAAAA:8 a=HTlyMO5rB3nywkCtlK0A:9 a=5yU3S35YU4bGjq-dph-N:22 a=Bho9c0fBagfJEIQBS7DQ:22 cc=ntf awl=host:13839 X-Proofpoint-ORIG-GUID: TsCTIyRyt5NUFSuer9f-Hillpbr39xrA X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDExMCBTYWx0ZWRfX94660OWeM2AM 3w8LhFRxqKa/uQ+apWd+BYtbRBx6e83SvevcwGVu5g8oDkcZfGoF3TW/BJcLpaQ72PgLO1xF+un FvoCFUWZysuuQD+moKNFk0dA3kTRmomcg1HToAoJxHBw9MX4BCXGD+SuqQ2UgcLSydBAX+RwpDP wx1d14Mdb8hAhbrvyOVEvwQSNPLwwAwW/2KrywMeuNYRAGH5Hm/rK3/agIC3qaDrisKfB89f2vR QsFLN5vEaqyG+6g54ECIs/4jbNMpp+RqK5EHehMpWy91OfvTEEwLtwASsZyadKxzwhY+anW09g2 JfpoLdxOXfOxe4M9kS0i4QvcZm8T+m38KjBYyB73M3HE7EJ0rXOi66toBhi3GAiIqtxP7KLMMQn 5H8DvTGnuHhMmiKxMCcg258xZ8YgW2cyKsyviukqeArXATECGVFePce5P6UMseKOFfbJG97PPEb Okba/97qowXJxcq1hcKg6Mlmz8wQ3Bw7no0bnv/g= X-Proofpoint-GUID: TsCTIyRyt5NUFSuer9f-Hillpbr39xrA Message-ID-Hash: F6ZUNHEYYDDMF75OEY5JIDIHTHK4LXUJ X-Message-ID-Hash: F6ZUNHEYYDDMF75OEY5JIDIHTHK4LXUJ X-MailFrom: akash.kulhalli@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: akash.kulhalli@oracle.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Akash Kulhalli via Devel Reply-To: Akash Kulhalli X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1779276377331158500 Content-Type: text/plain; charset="utf-8" Async QEMU process events are normally completed through qemuProcessEventHandler(). Tests that exercise DEVICE_DELETED completion need to drive that same path instead of mirroring the production logic loca= lly. Move the declaration to a guarded private header and make the handler non-static so test code can wire it into a test worker pool. This does not change runtime behaviour. Signed-off-by: Akash Kulhalli --- src/qemu/qemu_driver.c | 9 +++++---- src/qemu/qemu_driverpriv.h | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 src/qemu/qemu_driverpriv.h diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index eda1f42054af..c6d18f6575b7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -31,6 +31,8 @@ #include =20 #include "qemu_driver.h" +#define LIBVIRT_QEMU_DRIVERPRIV_H_ALLOW +#include "qemu_driverpriv.h" #include "qemu_agent.h" #include "qemu_alias.h" #include "qemu_block.h" @@ -139,9 +141,6 @@ VIR_ENUM_IMPL(qemuDumpFormat, "win-dmp", ); =20 - -static void qemuProcessEventHandler(void *data, void *opaque); - static int qemuStateCleanup(void); =20 static int qemuDomainObjStart(virConnectPtr conn, @@ -4149,7 +4148,9 @@ processShutdownCompletedEvent(virDomainObj *vm) } =20 =20 -static void qemuProcessEventHandler(void *data, void *opaque) +void +qemuProcessEventHandler(void *data, + void *opaque) { struct qemuProcessEvent *processEvent =3D data; virDomainObj *vm =3D processEvent->vm; diff --git a/src/qemu/qemu_driverpriv.h b/src/qemu/qemu_driverpriv.h new file mode 100644 index 000000000000..4fb0cc22b026 --- /dev/null +++ b/src/qemu/qemu_driverpriv.h @@ -0,0 +1,27 @@ +/* + * qemu_driverpriv.h: private declarations for QEMU driver internals + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef LIBVIRT_QEMU_DRIVERPRIV_H_ALLOW +# error "qemu_driverpriv.h may only be included by qemu_driver.c or test s= uites" +#endif /* LIBVIRT_QEMU_DRIVERPRIV_H_ALLOW */ + +#pragma once + +void +qemuProcessEventHandler(void *data, + void *opaque); --=20 2.47.3 From nobody Sat May 30 15:30:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1779276436; cv=none; d=zohomail.com; s=zohoarc; b=A8op9HyKh4u5cnQyNaGloQhYCveszlIaiyDJ52qxjvrwLBm7f2EIDojDBnRKy2aTpWEsxBYUg8zFCAh60UNAsyIjhrU1QLsA/WS5ROV6BRRptFklEGbfP5KpFkR74JXFf4CDh1xbz8iLF1m26P0KeLVn+vfmTJY1WMmTvsFgLsc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779276436; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=4DyV+FaNcpkOgI9KeLf7P6FVPAh8LQhvpsMhzCtzczM=; b=cuzcOiqBinjkOsXZKaUj7xtojkKInZBC1ZdBPt2XUHNDKJMTgGUmNe4bs9QoFKEAnmn4n4fZ7fExXSTL5DwMJRKaDTFnseyN8t7L2q2aXn9BsOI/AKVTCdD9PBTH6xK6vc3feSUxi0gjkPfCZfcyqlrQ0pjM8asfiiFmo2bLFbQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1779276436121840.2821010022535; Wed, 20 May 2026 04:27:16 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 00F9D41B50; Wed, 20 May 2026 07:27:14 -0400 (EDT) Received: from [172.19.199.4] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 1FF5C41BBB; Wed, 20 May 2026 07:24:10 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2F630418F8; Wed, 20 May 2026 07:23:45 -0400 (EDT) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 9B1534184C for ; Wed, 20 May 2026 07:23:42 -0400 (EDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64JNiRla3392660 for ; Wed, 20 May 2026 11:23:42 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4e6h1sxtev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:41 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.7/8.18.1.7) with ESMTP id 64KBF4tq036490 for ; Wed, 20 May 2026 11:23:41 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4e84edhm18-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:41 +0000 (GMT) Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 64KBM3QR016439 for ; Wed, 20 May 2026 11:23:40 GMT Received: from akulhall-vm1-ol9.osdevelopmeniad.oraclevcn.com (akulhall-vm1-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.255.191]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 4e84edhm0k-3; Wed, 20 May 2026 11:23:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=4DyV+ FaNcpkOgI9KeLf7P6FVPAh8LQhvpsMhzCtzczM=; b=iL1s5MY8N+bPLTmMvfRI4 nv7ZxtMSFfYVhd3rBLRD9I1B2+Fa2mBgfnUC55+XReUPyrvD/3P8kiGmiRABJw41 z5gc9VOX5UdbaA7QDhYcQ6HE8GMqHH0SsyqAytqE44NCDJnfT1z56099KH3QFOUY bUmtLtEaN1IfBxyWumpCiWHJ/g2egeJTZRWjVwSrHfymRMzEW59TO2HLu3yp3nkE wx8nnDBDz2mNlGwEuKdXpvVJtQrtrrlGKI03LAHanFbk3RJDVnwj0gyx5XnrUzfK cEI+YvSgBSHY27wVIIcoKhqj7Mebe/0mLrXSooaWSAd+vuW61KTtH897G/h8Z7nJ Q== To: devel@lists.libvirt.org Subject: [PATCH 2/7] tests: add helper for DEVICE_DELETED events Date: Wed, 20 May 2026 16:49:33 +0530 Message-ID: <20260520112323.1484419-3-akash.kulhalli@oracle.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260520112323.1484419-1-akash.kulhalli@oracle.com> References: <20260520112323.1484419-1-akash.kulhalli@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2605130000 definitions=main-2605200108 X-Proofpoint-ORIG-GUID: IYZ8MGkQomcVVDCgU9Dguc-TybCjA8dA X-Authority-Analysis: v=2.4 cv=aoKCzyZV c=1 sm=1 tr=0 ts=6a0d99bd b=1 cx=c_pps a=e1sVV491RgrpLwSTMOnk8w==:117 a=e1sVV491RgrpLwSTMOnk8w==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22 a=o5oIOnhZENCTenyL_yNV:22 a=yPCof4ZbAAAA:8 a=tjU_jw4RVW5mis4LcWkA:9 a=5yU3S35YU4bGjq-dph-N:22 a=Bho9c0fBagfJEIQBS7DQ:22 cc=ntf awl=host:13839 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDExMCBTYWx0ZWRfXzzl4Pttmketq 7hCloDoIcBf3nPVVXKzm37c2BrOehq33UhTD4wAnZZN84ndNMuQ7MlhHCn5QZ7s00Pv3V1VFFHV B7YOARlzfnLyQnzZck7VIjA400irptgRMezuvuusgdLx5/uW03p+KYg8m6bETTIqQ0TPyDixkA2 6kSsKzx/ZDOVHERZU0HQgfamSSP87EXYfFLehE6hMnu+EeWfpWeucVHIeytfJjqudmvFiG9bHAQ F8WnLr0NgHl9ldgehE3vChLrWTVluC8F9hUzSkqDy5WFDxVxjwj8CvPQM0BK1qv0MiAK9WypPOd K4J9SxlI4YWMZ+r6EEtkVMl9z7nj+Nrwmn5R/864BP40x84aZ7bDkhhTx+RFME+evIfy9i0G7Ej dJdMrIT8cJAAWQ9qYH4X6eDr6lFOsN9opvWbzsS3i+STCT+7vL7QO/NtWc/N/6kAqyDfDzQoVYS wfq4DQEchdBTx6gbY65Z7FSOQfwf2kUZyr6eZlIs= X-Proofpoint-GUID: IYZ8MGkQomcVVDCgU9Dguc-TybCjA8dA Message-ID-Hash: H4MMOI4VSTWST2GA6MBXMYV27DLYDY4Z X-Message-ID-Hash: H4MMOI4VSTWST2GA6MBXMYV27DLYDY4Z X-MailFrom: akash.kulhalli@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: akash.kulhalli@oracle.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Akash Kulhalli via Devel Reply-To: Akash Kulhalli X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1779276437841158500 Content-Type: text/plain; charset="utf-8" Add qemuMonitorTestEmitDeviceDeleted() so monitor tests can emit a DEVICE_DELETED event after the command reply has already been consumed. The helper uses the monitor callback path directly and avoids adding event JSON to command/reply fixtures. Signed-off-by: Akash Kulhalli --- tests/qemumonitortestutils.c | 9 +++++++++ tests/qemumonitortestutils.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index b6e17fc2cac4..e83dd1d9c40b 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -1240,3 +1240,12 @@ qemuMonitorTestGetDomainObj(qemuMonitorTest *test) { return test->vm; } + +void +qemuMonitorTestEmitDeviceDeleted(qemuMonitorTest *test, + const char *alias) +{ + virObjectLock(test->mon); + qemuMonitorEmitDeviceDeleted(test->mon, alias); + virObjectUnlock(test->mon); +} diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index 4f136410ee61..c87cdf0e6a32 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -109,5 +109,8 @@ qemuAgent * qemuMonitorTestGetAgent(qemuMonitorTest *test); virDomainObj * qemuMonitorTestGetDomainObj(qemuMonitorTest *test); +void +qemuMonitorTestEmitDeviceDeleted(qemuMonitorTest *test, + const char *alias); =20 G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorTest, qemuMonitorTestFree); --=20 2.47.3 From nobody Sat May 30 15:30:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1779276606; cv=none; d=zohomail.com; s=zohoarc; b=U27COb88e6k6uZkIvUYrafnF+Zf9PRvTxDurve4drVB9+0RiReJloEQ8cJn1qQoMM4CS83YqwbYoTVjOGg7rc+pS/678MJjuMO8vNrmPlu0YFqAguU4ruxsK8AXxvIwfwit4ixjaiQ6rLhnW7ALwTLrvGXGwRs+QgWzNO2MKMTc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779276606; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=P0G4cngVz8hZXG9evf5lUxyYyF9QbJErfqt/aXTaHcs=; b=N2/mBdDH/f1aGTIcmpkQhZA+eJiMwBwPPQdBsuaDpSsAUWLvm2U0yJmS28ehgrrPNYdQL8n2Aa++XSpf7XzNXfptUR4ZOxf9yguaMIOTFFYbxfoEts2LUj5m4OQ2YxfSGORQ8lp4CVQ+VCS5b7k4aw+X9GpK9GCsSMf0279CeiI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1779276606844613.9701252094067; Wed, 20 May 2026 04:30:06 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id AFCB14195B; Wed, 20 May 2026 07:30:05 -0400 (EDT) Received: from [172.19.199.4] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 834E741CA9; Wed, 20 May 2026 07:24:22 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 128494184C; Wed, 20 May 2026 07:23:46 -0400 (EDT) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A399B41952 for ; Wed, 20 May 2026 07:23:42 -0400 (EDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64K61Md92566185 for ; Wed, 20 May 2026 11:23:42 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4e6h1sxtew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:41 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.7/8.18.1.7) with ESMTP id 64KBF3YO036327 for ; Wed, 20 May 2026 11:23:41 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4e84edhm1c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:41 +0000 (GMT) Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 64KBM3QT016439 for ; Wed, 20 May 2026 11:23:41 GMT Received: from akulhall-vm1-ol9.osdevelopmeniad.oraclevcn.com (akulhall-vm1-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.255.191]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 4e84edhm0k-4; Wed, 20 May 2026 11:23:40 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=P0G4c ngVz8hZXG9evf5lUxyYyF9QbJErfqt/aXTaHcs=; b=kfEwXKCXyu6z+X7HnBpxD 16BZ/UydpzWYizmMaDbpbz3Qc5r6FNyeGXTqLwOuIYfyWu7lS1TItzE6aP3xqWmp MKNzXW4VjwgZv0HESjSzvrmeH8U02DbI6o1cQgl4M8x0d5X5tuvD5+kqWOLszi+V IlarjPOj0VHX5C8u+J/+PMNaMg8HzcvWL9ueilH5TR9zVLueQWDXFN4oS7A7vBBq Qq/LF7lITD+zfXPB8IxsGDdP9AO69XFftInKMbRGv0mpJ2R7Jw5rahgcgEVeaq3n izM4iaV9i7CFaSz1/IbkrkB0AyNxmLy+eUVr9n6SHx8GFRbUa6yxlJy50U/EpBBV Q== To: devel@lists.libvirt.org Subject: [PATCH 3/7] qemuhotplugtest: support async vcpu unplug completion Date: Wed, 20 May 2026 16:49:34 +0530 Message-ID: <20260520112323.1484419-4-akash.kulhalli@oracle.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260520112323.1484419-1-akash.kulhalli@oracle.com> References: <20260520112323.1484419-1-akash.kulhalli@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2605130000 definitions=main-2605200108 X-Proofpoint-ORIG-GUID: iHIx43hdjRtU9l3sKBbTqZQbTQYM2oKN X-Authority-Analysis: v=2.4 cv=aoKCzyZV c=1 sm=1 tr=0 ts=6a0d99be b=1 cx=c_pps a=e1sVV491RgrpLwSTMOnk8w==:117 a=e1sVV491RgrpLwSTMOnk8w==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22 a=o5oIOnhZENCTenyL_yNV:22 a=yPCof4ZbAAAA:8 a=PxoBaiUbynIOylaeyzEA:9 a=5yU3S35YU4bGjq-dph-N:22 a=Bho9c0fBagfJEIQBS7DQ:22 cc=ntf awl=host:13839 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDExMCBTYWx0ZWRfX+ea6R2GuaXtd c+9vUA1NGlNtbQOoEAnSadZSPwU7sdp9iofHJFSxJlEpDZ86LliIlWfUH8MVLJ5a/a09+KWJkAV CMWrT0rgBWqVtdwrHlHmElUKGaYLwlu9vWLehZkyw3i21C25KEuNn9wZQNdVTZm15LjxlRrD10U dfA05F8V7/pLcbkrKxL7nBT+2iN4fu8SflivkFWCfl9QQcYqawlCRgqiMkgxgspgX6Nb6Rw9Bcm zVKH3FO2NmX6eXkXh8sb9xXF6EIHZFThsCM07F774SSCla47AKrDvuiHkc8/afFahjVH4PLYR3r 1QzISQqWHCGEIN11yD1mMnuw8o3iUfWi3NuZYFbtmz4+nAGvFOKwKsVjQHJRYRSAqKusUgu1azL jZMod84oloppnV9qPyv1bSDly/bIpfOg6gxSb6yYKRbKMlLg69UzgW5B6NBSDZbKFjO3p0ggqC0 vIoPEGgSy+Wc3ku4Z5mmGCD08KMyBclNasK9JYbc= X-Proofpoint-GUID: iHIx43hdjRtU9l3sKBbTqZQbTQYM2oKN Message-ID-Hash: F53AISL4F5K7FCJ3DIKS254YK7UVK7FY X-Message-ID-Hash: F53AISL4F5K7FCJ3DIKS254YK7UVK7FY X-MailFrom: akash.kulhalli@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: akash.kulhalli@oracle.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Akash Kulhalli via Devel Reply-To: Akash Kulhalli X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1779276611423154100 Content-Type: text/plain; charset="utf-8" Add async CPU hotplug harness support so tests can observe the state between device_del and DEVICE_DELETED, and then complete the unplug through the QEMU driver's normal process-event path. The async path compares the pending live XML, emits DEVICE_DELETED events via the monitor test helper, waits for the driver worker to process them, and validates the vcpu-removed events before running the existing final XML checks. Signed-off-by: Akash Kulhalli --- tests/qemuhotplugtest.c | 350 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 350 insertions(+) diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 7e49b9ad3661..9696448e5b4e 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -19,8 +19,11 @@ =20 #include =20 +#include "domain_event.h" #include "qemu/qemu_alias.h" #include "qemu/qemu_conf.h" +#define LIBVIRT_QEMU_DRIVERPRIV_H_ALLOW +#include "qemu/qemu_driverpriv.h" #include "qemu/qemu_hotplug.h" #include "qemumonitortestutils.h" #include "testutils.h" @@ -28,6 +31,9 @@ #include "testutilsqemuschema.h" #include "virhostdev.h" #include "virfile.h" +#include "virthread.h" +#include "virthreadpool.h" +#include "virtime.h" #include "qemufakedrivers.h" =20 #define LIBVIRT_QEMU_CAPSPRIV_H_ALLOW @@ -44,6 +50,7 @@ enum { }; =20 #define QEMU_HOTPLUG_TEST_DOMAIN_ID 7 +#define QEMU_HOTPLUG_TEST_DOMAIN_PID 12345 =20 struct qemuHotplugTestData { const char *domain_filename; @@ -325,6 +332,146 @@ struct testQemuHotplugCpuParams { }; =20 =20 +struct testQemuHotplugCpuAsyncParams { + const char *test; + int newcpus; + const char *cpumap; + virConnectPtr conn; + const char **deviceDeletedAliases; + size_t ndeviceDeletedAliases; + const char *removedVcpus; + const char *arch; + GHashTable *capsLatestFiles; + GHashTable *capsCache; + GHashTable *schemaCache; +}; + + +struct testQemuHotplugCpuAsyncData { + int eventCallbackID; + virMutex lock; + virCond cond; + bool lockInitialized; + bool condInitialized; + virBitmap *removedVcpusExpected; + virBitmap *removedVcpusActual; + bool removedVcpusInvalid; + bool removedVcpusDuplicate; + bool ownsWorkerPool; +}; + + +static int +testQemuHotplugCpuAsyncDataInit(struct testQemuHotplugCpuAsyncData *asyncD= ata, + const char *test) +{ + asyncData->eventCallbackID =3D -1; + + if (driver.workerPool) { + VIR_TEST_VERBOSE("stale qemu worker pool in async cpu test '%s'", + test); + return -1; + } + + if (virMutexInit(&asyncData->lock) < 0) + return -1; + asyncData->lockInitialized =3D true; + + if (virCondInit(&asyncData->cond) < 0) + return -1; + asyncData->condInitialized =3D true; + + if (!(driver.workerPool =3D virThreadPoolNewFull(0, 1, 0, + qemuProcessEventHandler, + "qemuProcessEventHandle= r", + NULL, &driver))) + return -1; + + asyncData->ownsWorkerPool =3D true; + + return 0; +} + + +static void +testQemuHotplugCpuAsyncDataClear(struct testQemuHotplugCpuAsyncData *async= Data, + virConnectPtr conn) +{ + if (asyncData->eventCallbackID >=3D 0) + virObjectEventStateDeregisterID(conn, driver.domainEventState, + asyncData->eventCallbackID, true); + + if (asyncData->ownsWorkerPool) + g_clear_pointer(&driver.workerPool, virThreadPoolFree); + + if (asyncData->condInitialized) + virCondDestroy(&asyncData->cond); + if (asyncData->lockInitialized) + virMutexDestroy(&asyncData->lock); + + g_clear_pointer(&asyncData->removedVcpusExpected, virBitmapFree); + g_clear_pointer(&asyncData->removedVcpusActual, virBitmapFree); +} + + +static int +testQemuHotplugCpuWaitVcpuRemoved(struct testQemuHotplugCpuAsyncData *asyn= cData) +{ + g_autofree char *expected =3D NULL; + g_autofree char *actual =3D NULL; + unsigned long long now; + unsigned long long deadline; + size_t expectedCount =3D virBitmapCountBits(asyncData->removedVcpusExp= ected); + size_t actualCount; + int ret =3D -1; + + if (virTimeMillisNow(&now) < 0) + return -1; + deadline =3D now + 1000; + + virMutexLock(&asyncData->lock); + while (virBitmapCountBits(asyncData->removedVcpusActual) < expectedCou= nt) { + if (virCondWaitUntil(&asyncData->cond, &asyncData->lock, deadline)= < 0) + break; + } + + actualCount =3D virBitmapCountBits(asyncData->removedVcpusActual); + + if (asyncData->removedVcpusInvalid) { + VIR_TEST_VERBOSE("async cpu test reported an unexpected vCPU id"); + goto cleanup; + } + + if (asyncData->removedVcpusDuplicate) { + VIR_TEST_VERBOSE("async cpu test received duplicate vcpu-removed e= vents"); + goto cleanup; + } + + if (actualCount < expectedCount) { + VIR_TEST_VERBOSE("timed out waiting for vcpu-removed events" + " (%zu/%zu received)", + actualCount, expectedCount); + goto cleanup; + } + + if (!virBitmapEqual(asyncData->removedVcpusExpected, + asyncData->removedVcpusActual)) { + expected =3D virBitmapFormat(asyncData->removedVcpusExpected); + actual =3D virBitmapFormat(asyncData->removedVcpusActual); + VIR_TEST_VERBOSE("expected removed vCPUs '%s', got '%s'", + NULLSTR(expected), NULLSTR(actual)); + goto cleanup; + } + + ret =3D 0; + + cleanup: + virMutexUnlock(&asyncData->lock); + + return ret; +} + + static struct testQemuHotplugCpuData * testQemuHotplugCpuPrepare(const struct testQemuHotplugCpuParams *params) { @@ -407,6 +554,124 @@ testQemuHotplugCpuFinalize(struct testQemuHotplugCpuD= ata *data) } =20 =20 +static void +testQemuHotplugCpuVcpuRemoved(virConnectPtr conn G_GNUC_UNUSED, + virDomainPtr dom G_GNUC_UNUSED, + unsigned int vcpuid, + void *opaque) +{ + struct testQemuHotplugCpuAsyncData *asyncData =3D opaque; + + virMutexLock(&asyncData->lock); + + if (virBitmapIsBitSet(asyncData->removedVcpusActual, vcpuid)) + asyncData->removedVcpusDuplicate =3D true; + + if (virBitmapSetBit(asyncData->removedVcpusActual, vcpuid) < 0) + asyncData->removedVcpusInvalid =3D true; + + virCondBroadcast(&asyncData->cond); + virMutexUnlock(&asyncData->lock); +} + + +static int +testQemuHotplugCpuRegisterVcpuRemoved(struct testQemuHotplugCpuData *data, + const struct testQemuHotplugCpuAsync= Params *async, + struct testQemuHotplugCpuAsyncData *= asyncData) +{ + g_autoptr(virBitmap) expected =3D NULL; + size_t maxvcpus =3D virDomainDefGetVcpusMax(data->vm->def); + + if (!async->removedVcpus) { + VIR_TEST_VERBOSE("async cpu test '%s' is missing expected removed = vCPUs", + async->test); + return -1; + } + + if (virBitmapParse(async->removedVcpus, &expected, maxvcpus) < 0) + return -1; + + if (!(asyncData->removedVcpusActual =3D virBitmapNew(maxvcpus))) + return -1; + + asyncData->removedVcpusExpected =3D g_steal_pointer(&expected); + + if (virDomainEventStateRegisterID(async->conn, + driver.domainEventState, + NULL, + VIR_DOMAIN_EVENT_ID_VCPU_REMOVED, + VIR_DOMAIN_EVENT_CALLBACK(testQemuHo= tplugCpuVcpuRemoved), + asyncData, + NULL, + &asyncData->eventCallbackID) < 0) + return -1; + + return 0; +} + + +static int +testQemuHotplugCpuCompleteAsync(struct testQemuHotplugCpuData *data, + const struct testQemuHotplugCpuAsyncParams= *async, + struct testQemuHotplugCpuAsyncData *asyncD= ata) +{ + g_autofree char *activeXML =3D NULL; + g_autofree char *pendingLiveFile =3D NULL; + size_t i; + bool vmUnlocked =3D false; + int ret =3D -1; + + if (!async->deviceDeletedAliases || + async->ndeviceDeletedAliases =3D=3D 0) { + VIR_TEST_VERBOSE("async cpu test '%s' is missing DEVICE_DELETED al= iases", + async->test); + return -1; + } + + if (!(activeXML =3D virDomainDefFormat(data->vm->def, driver.xmlopt, + VIR_DOMAIN_DEF_FORMAT_SECURE))) + return -1; + + pendingLiveFile =3D g_strdup_printf("%s/qemuhotplugtestcpus/%s-result-= pending-live.xml", + abs_srcdir, async->test); + + if (virTestCompareToFile(activeXML, pendingLiveFile) < 0) + return -1; + + if (testQemuHotplugCpuRegisterVcpuRemoved(data, async, asyncData) < 0) + return -1; + + /* qemuDomainRefreshVcpuInfo() validates vCPU TIDs against the emulator + * PID. A running QEMU process always has a non-zero PID, so mirror th= at + * before DEVICE_DELETED processing reports unplugged vCPUs with tid = =3D=3D 0. */ + data->vm->pid =3D QEMU_HOTPLUG_TEST_DOMAIN_PID; + + virObjectUnlock(data->vm); + vmUnlocked =3D true; + + for (i =3D 0; i < async->ndeviceDeletedAliases; i++) + qemuMonitorTestEmitDeviceDeleted(data->mon, + async->deviceDeletedAliases[i]); + + if (testQemuHotplugCpuWaitVcpuRemoved(asyncData) < 0) + goto cleanup; + + virThreadPoolDrain(driver.workerPool); + + virObjectLock(data->vm); + vmUnlocked =3D false; + + ret =3D 0; + + cleanup: + if (vmUnlocked) + virObjectLock(data->vm); + + return ret; +} + + static int testQemuHotplugCpuGroup(const void *opaque) { @@ -442,6 +707,71 @@ testQemuHotplugCpuGroup(const void *opaque) } =20 =20 +static int +testQemuHotplugCpuAsync(const struct testQemuHotplugCpuAsyncParams *async, + bool group) +{ + struct testQemuHotplugCpuData *data =3D NULL; + struct testQemuHotplugCpuAsyncData asyncData =3D { .eventCallbackID = =3D -1 }; + struct testQemuHotplugCpuParams params =3D { + .test =3D async->test, + .arch =3D async->arch, + .capsLatestFiles =3D async->capsLatestFiles, + .capsCache =3D async->capsCache, + .schemaCache =3D async->schemaCache, + }; + g_autoptr(virBitmap) map =3D NULL; + int ret =3D -1; + int rc; + + if (!(data =3D testQemuHotplugCpuPrepare(¶ms))) + return -1; + + if (testQemuHotplugCpuAsyncDataInit(&asyncData, async->test) < 0) + goto cleanup; + + if (group) { + rc =3D qemuDomainSetVcpusInternal(&driver, data->vm, data->vm->def, + data->vm->newDef, async->newcpus, + true, true); + } else { + if (virBitmapParse(async->cpumap, &map, 128) < 0) + goto cleanup; + + rc =3D qemuDomainSetVcpuInternal(&driver, data->vm, data->vm->def, + data->vm->newDef, map, false, + true); + } + + if (rc < 0) + goto cleanup; + + if (testQemuHotplugCpuCompleteAsync(data, async, &asyncData) < 0) + goto cleanup; + + ret =3D testQemuHotplugCpuFinalize(data); + + cleanup: + testQemuHotplugCpuAsyncDataClear(&asyncData, async->conn); + testQemuHotplugCpuDataFree(data); + return ret; +} + + +static int +testQemuHotplugCpuGroupAsync(const void *opaque) +{ + return testQemuHotplugCpuAsync(opaque, true); +} + + +static int +testQemuHotplugCpuIndividualAsync(const void *opaque) +{ + return testQemuHotplugCpuAsync(opaque, false); +} + + static int testQemuHotplugCpuIndividual(const void *opaque) { @@ -818,6 +1148,26 @@ mymain(void) ret =3D -1; \ } while (0) =20 +#define DO_TEST_CPU_INDIVIDUAL_ASYNC(archname, prefix, mapstr, alias, remo= ved) \ + do { \ + const char *aliases[] =3D { alias }; \ + const struct testQemuHotplugCpuAsyncParams async =3D { \ + .test =3D prefix, \ + .cpumap =3D mapstr, \ + .conn =3D conn, \ + .deviceDeletedAliases =3D aliases, \ + .ndeviceDeletedAliases =3D G_N_ELEMENTS(aliases), \ + .removedVcpus =3D removed, \ + .arch =3D archname, \ + .capsLatestFiles =3D capsLatestFiles, \ + .capsCache =3D capsCache, \ + .schemaCache =3D schemaCache, \ + }; \ + if (virTestRun("hotplug vcpus individual async " prefix, \ + testQemuHotplugCpuIndividualAsync, &async) < 0) \ + ret =3D -1; \ + } while (0) + DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", tru= e, false); DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "6,7", t= rue, true); DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", fal= se, true); --=20 2.47.3 From nobody Sat May 30 15:30:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1779277115; cv=none; d=zohomail.com; s=zohoarc; b=ijI8pgN4u3s6gtGIx5q2w7nX9b/fb1FafsOTR7g68oBcAlpj5cfm9xgNbGnnimt8NJ/UL1wEMwT8q7cFrxhsXJW992efvTyLa/PLZWjKAVDOmkegumGMvI3huj6l/YIVOrGK8IoIXJt5WEwEOaSABs3WrC0CNgwefraCkw2Vwao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779277115; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=bGFyQp7xYOjE3SLUR7oasb170UbGNP/f+3peKVAq9Zg=; b=WFnDTpdVmrN041HfPIFFuZ5tWaN4GU96Uqd1/n7k3m7lUAAJ4kg7n8Vx9Ac0yRnSgq5bg2Pr0hzDoCb/vMvllRu/gN25bwJfshOVy+Ilw12/1/c59HXR6bOGz/D68pUMfSuz1jhl29upWW2affDBBJYsdX6RJSlVE77QuIq2g+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1779277115670852.6664478414851; Wed, 20 May 2026 04:38:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 4DF9E3F963; Wed, 20 May 2026 07:38:34 -0400 (EDT) Received: from [172.19.199.4] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 11FDC4197C; Wed, 20 May 2026 07:24:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2028C41952; Wed, 20 May 2026 07:23:48 -0400 (EDT) Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id E84E441972 for ; Wed, 20 May 2026 07:23:42 -0400 (EDT) Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64K8XBBx658661 for ; Wed, 20 May 2026 11:23:42 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4e6h1sxy2n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:42 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.7/8.18.1.7) with ESMTP id 64KBF2Tj036214 for ; Wed, 20 May 2026 11:23:41 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 4e84edhm1k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 20 May 2026 11:23:41 +0000 (GMT) Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.18.1.12/8.18.1.12) with ESMTP id 64KBM3QV016439 for ; Wed, 20 May 2026 11:23:41 GMT Received: from akulhall-vm1-ol9.osdevelopmeniad.oraclevcn.com (akulhall-vm1-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.255.191]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 4e84edhm0k-5; Wed, 20 May 2026 11:23:41 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=corp-2025-04-25; bh=bGFyQ p7xYOjE3SLUR7oasb170UbGNP/f+3peKVAq9Zg=; b=fPgj1W8LJy2q6CAeAVe66 40SBBHH/slgiKZm/AU2xIbN9f5qRt97C0nP7HoXYdzM0Tp8cPsCQk7WZX5ZTpCj6 4qeJs6C6OvQYhLz/meU/4ifpIJgqGkcmI7OVjTw2YgBCeRc0QIp5065IbCWxBfbK FIq305eOOZws1pesbqspE2kV/R/83IgYGfrujps71LqDiZVdNTv1N4aMRQt6TM2A sRUC9qMkxpxuQfVgstPR65j3LBKq+m2Yp8EyZdHuf+6XyKo4nIkXG4NaT9REzduG MDZK7NX0mAoC8S5FDAedpkLqupNE329bYewfrao3tH0alRBPUtQ0HELV2PUwXPNH A== To: devel@lists.libvirt.org Subject: [PATCH 4/7] qemuhotplugtest: test setvcpu async unplug Date: Wed, 20 May 2026 16:49:35 +0530 Message-ID: <20260520112323.1484419-5-akash.kulhalli@oracle.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260520112323.1484419-1-akash.kulhalli@oracle.com> References: <20260520112323.1484419-1-akash.kulhalli@oracle.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 lowpriorityscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2605130000 definitions=main-2605200108 X-Proofpoint-GUID: ig5PtOHsfqPZihxdPr_nWq915t_Oxe27 X-Authority-Analysis: v=2.4 cv=d9jFDxjE c=1 sm=1 tr=0 ts=6a0d99be b=1 cx=c_pps a=e1sVV491RgrpLwSTMOnk8w==:117 a=e1sVV491RgrpLwSTMOnk8w==:17 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=jiCTI4zE5U7BLdzWsZGv:22 a=BqU2WV_vvsyTyxaotp0D:22 a=yPCof4ZbAAAA:8 a=poIMxrWE-6J9Kj8ljIgA:9 a=twhJ2ZlS-ekJXLOV:21 a=5yU3S35YU4bGjq-dph-N:22 a=Bho9c0fBagfJEIQBS7DQ:22 cc=ntf awl=host:13839 X-Proofpoint-ORIG-GUID: ig5PtOHsfqPZihxdPr_nWq915t_Oxe27 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDExMCBTYWx0ZWRfXzUOOXC97wPbt SxuJ40axdYI61t5DVMDlM/qOUhuM3JOIPLNQtDRFsWvRgzI1K3cgJkMQ7PRZvrWW6IGgw+a69/5 +pwMYfJdHJccQUKAe11MK63+jcW1xScno1Vq/c67hCjD8EbgGXaoAXRDS0B8905VFO6wiPsO++z F4t0GY79EKF/epmo68aBZoHaow5WG8Tt7r87IoA+mHle7XSbzVj0qOWy8us0f5i4bK6YRbM9q2L W6q9puwcuQ7upjeGJsjgToxqJVFj8ssoXho+9LM1CTRax1LZyRepdRAzU6umXeGuPE4b5P7ajoO r5uj3xuDaAyB9nMWyujQ5E7APBwYHi4PO6+uhM502aATRZbE09FQadTIR8LsCAyLRy9rbF1rvI0 FCUbkEMzwIUw40abe/0nJrNTPgp5GeP3WsSedP8BDvLu2wfLUOkVsUaC+8zFKc3adeNlZNqW/PH hHlnHuIxnrrPndQiaCMp+u1UbuJg9sac7pPvj378= Message-ID-Hash: XNBDAY6ONS2ACVODOEN6IUPIMDNIRGVM X-Message-ID-Hash: XNBDAY6ONS2ACVODOEN6IUPIMDNIRGVM X-MailFrom: akash.kulhalli@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: akash.kulhalli@oracle.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Akash Kulhalli via Devel Reply-To: Akash Kulhalli X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1779277118306158500 Content-Type: text/plain; charset="utf-8" Add async unplug coverage for the setvcpu path. The x86 case covers removal of a single hotpluggable vCPU entity, while the ppc64 case covers removal of a grouped hotpluggable entity. Both cases veri= fy the pending XML before DEVICE_DELETED, the final XML after completion, and = the expected vcpu-removed events. Signed-off-by: Akash Kulhalli --- tests/qemuhotplugtest.c | 4 + ...c64-modern-individual-del-async-domain.xml | 68 ++++++ ...4-modern-individual-del-async-monitor.json | 227 ++++++++++++++++++ ...odern-individual-del-async-result-conf.xml | 68 ++++++ ...odern-individual-del-async-result-live.xml | 71 ++++++ ...dividual-del-async-result-pending-live.xml | 71 ++++++ ...x86-modern-individual-del-async-domain.xml | 42 ++++ ...6-modern-individual-del-async-monitor.json | 186 ++++++++++++++ ...odern-individual-del-async-result-conf.xml | 42 ++++ ...odern-individual-del-async-result-live.xml | 50 ++++ ...dividual-del-async-result-pending-live.xml | 50 ++++ 11 files changed, 879 insertions(+) create mode 100644 tests/qemuhotplugtestcpus/ppc64-modern-individual-del-a= sync-domain.xml create mode 100644 tests/qemuhotplugtestcpus/ppc64-modern-individual-del-a= sync-monitor.json create mode 100644 tests/qemuhotplugtestcpus/ppc64-modern-individual-del-a= sync-result-conf.xml create mode 100644 tests/qemuhotplugtestcpus/ppc64-modern-individual-del-a= sync-result-live.xml create mode 100644 tests/qemuhotplugtestcpus/ppc64-modern-individual-del-a= sync-result-pending-live.xml create mode 100644 tests/qemuhotplugtestcpus/x86-modern-individual-del-asy= nc-domain.xml create mode 100644 tests/qemuhotplugtestcpus/x86-modern-individual-del-asy= nc-monitor.json create mode 100644 tests/qemuhotplugtestcpus/x86-modern-individual-del-asy= nc-result-conf.xml create mode 100644 tests/qemuhotplugtestcpus/x86-modern-individual-del-asy= nc-result-live.xml create mode 100644 tests/qemuhotplugtestcpus/x86-modern-individual-del-asy= nc-result-pending-live.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 9696448e5b4e..402f58cbfc19 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -1171,10 +1171,14 @@ mymain(void) DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", tru= e, false); DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "6,7", t= rue, true); DO_TEST_CPU_INDIVIDUAL("x86_64", "x86-modern-individual-add", "7", fal= se, true); + DO_TEST_CPU_INDIVIDUAL_ASYNC("x86_64", "x86-modern-individual-del-asyn= c", + "7", "vcpu7", "7"); =20 DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "16-23", tr= ue, false); DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "16-22", tr= ue, true); DO_TEST_CPU_INDIVIDUAL("ppc64", "ppc64-modern-individual", "17", true,= true); + DO_TEST_CPU_INDIVIDUAL_ASYNC("ppc64", "ppc64-modern-individual-del-asy= nc", + "16-23", "vcpu16", "16-23"); =20 qemuTestDriverFree(&driver); virObjectUnref(data.vm); diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-do= main.xml b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-doma= in.xml new file mode 100644 index 000000000000..29f1a5ac45dc --- /dev/null +++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-del-async-domain.xml @@ -0,0 +1,68 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hvm + + + + POWER9 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + +
+ + + + + +