From nobody Mon Feb 9 17:24:02 2026 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=suse.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 1638203961479385.50490341279135; Mon, 29 Nov 2021 08:39:21 -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-516-rxfgbGY2NpaOdO2cLOcoIA-1; Mon, 29 Nov 2021 11:39:16 -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 2601A19357BE; Mon, 29 Nov 2021 16:39:12 +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 0731560622; Mon, 29 Nov 2021 16:39:12 +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 943D84A700; Mon, 29 Nov 2021 16:39:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1ATGd9MP017761 for ; Mon, 29 Nov 2021 11:39:09 -0500 Received: by smtp.corp.redhat.com (Postfix) id 90220401E4B; Mon, 29 Nov 2021 16:39:09 +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 8ADAC401E2A for ; Mon, 29 Nov 2021 16:39:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 6B15E8007B1 for ; Mon, 29 Nov 2021 16:39:09 +0000 (UTC) Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-583-pWWwZ--wNeufbfLMgfyQiw-1; Mon, 29 Nov 2021 11:39:07 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04lp2056.outbound.protection.outlook.com [104.47.14.56]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-40-YJUZ_jb1MiiEbivwUArn1Q-1; Mon, 29 Nov 2021 17:39:05 +0100 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) by AM9PR04MB7537.eurprd04.prod.outlook.com (2603:10a6:20b:282::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.22; Mon, 29 Nov 2021 16:39:04 +0000 Received: from AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::c58b:de4e:3ba7:9ef6]) by AM0PR04MB4899.eurprd04.prod.outlook.com ([fe80::c58b:de4e:3ba7:9ef6%4]) with mapi id 15.20.4734.024; Mon, 29 Nov 2021 16:39:04 +0000 Received: from localhost (75.169.35.15) by AS9PR06CA0066.eurprd06.prod.outlook.com (2603:10a6:20b:464::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23 via Frontend Transport; Mon, 29 Nov 2021 16:39:03 +0000 X-MC-Unique: rxfgbGY2NpaOdO2cLOcoIA-1 X-MC-Unique: pWWwZ--wNeufbfLMgfyQiw-1 X-MC-Unique: YJUZ_jb1MiiEbivwUArn1Q-1 From: Jim Fehlig To: libvir-list@redhat.com Subject: [PATCH 5/6] libxl: Search for virDomainObj in event handler threads Date: Mon, 29 Nov 2021 09:38:44 -0700 Message-ID: <20211129163845.12713-6-jfehlig@suse.com> In-Reply-To: <20211129163845.12713-1-jfehlig@suse.com> References: <20211129163845.12713-1-jfehlig@suse.com> X-ClientProxiedBy: AS9PR06CA0066.eurprd06.prod.outlook.com (2603:10a6:20b:464::11) To AM0PR04MB4899.eurprd04.prod.outlook.com (2603:10a6:208:c5::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68bf9063-c053-474f-2e5e-08d9b356c15b X-MS-TrafficTypeDiagnostic: AM9PR04MB7537: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0 X-Microsoft-Antispam-Message-Info: vGvcwRabEDJBrdMg+9aAaLJvR0CW+hVFmBNwTwfMKLjjGz+NV8O/s6G7pxWTesfDeTjd4VSseoPoV04ClKEAlVf8i9JTKwwxJzsphWAo8cgkopAXfWiD5F3JHjJpu+29XQwEF5jvCqs1GI3G1YEp2kyzr5Ve2wZ7641V+5zFaP4jQKYy3U7otiKuX7hQr5IyHViazgwSUxjoWB/kf965AfWZtUFHXgNoCxUC6oP3GPLreWIdQCLmU0T9guVlHopOko9M81tRsrQREfXdxQtlAVbgAxvzEGWf2Tq+3Kj3Ojft89KK/Lq0Fv+2JLfbN2p1axLdvKEXM3GdH6RO9ZD+xPoLi2rtQ2NfoQyU9vMwwDU4FmlK799cA+DrfsDSCft8pOss++Z8NdWCCiyodON+jCaYhHwogr0rVJtDoWo2kQX3w07a34VblMBf9R+2gg2RNz3ALbT6SqazG3e75GnUbU2FpoHBvEUg4TN9PrWwY1OOtA4s1gdwyv58KeI2bSbF3WbWrd4N0eHFRRQcsvD4YBgfiO3LnqzEpGLa6j/s1hom2k1hSlc2Edv3XPD0OjkuLfVxukoi7JrJfs2nKhnv34cgLAef6xYXFtvxlPNaNFTJWG+iNaEUzwk0lWWXhze3OcwyrtRivTVad9ITQUhq/g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4899.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(86362001)(316002)(66946007)(66556008)(2906002)(956004)(8676002)(38100700002)(6496006)(6666004)(186003)(508600001)(2616005)(66476007)(8936002)(6486002)(1076003)(83380400001)(26005)(5660300002)(36756003)(6916009); DIR:OUT; SFP:1101 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?A86Fnk9ODIbTQFVz5kL3ECCLg6lLh7IrCtVHEW5XHrAwI+mEej/n1Bqd4GxN?= =?us-ascii?Q?kvdN067AQM02Gy/3aKK/kmFuAOR3eC3yoQgTN27l11eD9ve46oFg5MVtfwEt?= =?us-ascii?Q?qQC2bg0LfrEsmo9G236ZBoh9fuWZJblxpBasI91Bo17jdtVADudn4Gnxhp6u?= =?us-ascii?Q?mBRwLU+PsNh3WnzphYfXyQC+M48iGGogyNXIbalFu1HrbGuaRA38ETiM2Izp?= =?us-ascii?Q?3OH9KVe9yqEZWXa4xWCuQW18W/FpcIQxcW3Vggrg8x5+M/pM29leXSrRx0WJ?= =?us-ascii?Q?MYszw3m7eshQ43NKZVoY8uBajLriUe3gUZIfCd8GkZr5ffrCHdm+V8oXK4tj?= =?us-ascii?Q?qmkAnh8EjA+E4iz0NY2wyP+bNMcPZ/UH6eAwzkNS7KLTD1aEsm5EZo/jHQJ7?= =?us-ascii?Q?oO7tFo+RK3IdnTB2eqnX9GLsm9kCTOq8zuNDK29NNiZmjqCCvptgfRj+fOu7?= =?us-ascii?Q?bUow9T66mWdk4X4VuDiaVnXTfqiVlu7jmd1CKOH4B8TQMgNgNryXDGvYI6wo?= =?us-ascii?Q?GIA6LzWFoEGD19jAX8UNMJxRYe7Huqe2lAJB9kh4Bn0n/L4Z5u0reKzwrse0?= =?us-ascii?Q?hAF8GBSy6P57lF9Hy2gs6z7T08f/2TBroy9wNYISsDPSIdgoC6WPu5bX4+pw?= =?us-ascii?Q?tQ7IqRp7ngUeOR1ey0uBWSms5ZkWKHkgKhwQGnJCFDClL5IlGZNXitLccXGm?= =?us-ascii?Q?7qPaDfD6GHHoCWyzhqBysFEmm2icUWJupfe93zhKf7R1Kovj44H7BGJaw/8r?= =?us-ascii?Q?QXnpcWv+2yiayU5on4btRsSR1JDEhMK4xfc3nI4WnD/eRKek9Ecf6NZAHFJr?= =?us-ascii?Q?7/uowNolZyxHBUh1ItdkJRuyYKXJ+caSpEHiL0qichS3PlKy7azWrOJmSz7H?= =?us-ascii?Q?6D4rUFviWC25iwC642RRZ1cFitbFDRH7/zEFIg9f6yIiPI9IvufkkRCssLiY?= =?us-ascii?Q?XLuGMe9qsU+KC3pC68vBD+qMw09kZHwT6PyWqADhJNQcclPneWCzzgwPDpwK?= =?us-ascii?Q?GhAJxex1ON7bT0f3NZo85RzFe992lEkf52NwSZS/0Gt6fP4mRo+wc6Wl4FvH?= =?us-ascii?Q?t97bhDBGK/ZD4AXVDGlD6OoKukaBkaduSrdjrCTO2nzdYeHTSxdO+zZGKWOH?= =?us-ascii?Q?TR0KDOUNWDhO8wqp3V4V/Sa962NH23LJZa9zYX5dzId5nFNYOsxqhIOhG2g2?= =?us-ascii?Q?xLOAd0mLpOZ2NQYGdaEMC494p/wOUvwW5qf941BMzQZmxl9RGw4UkcphQHy3?= =?us-ascii?Q?jzsTKjVvO8DN8AxZhkWk0tSPzNYvqPHAmYpCSNQynXBni9G/Pxw+rNWr0nyD?= =?us-ascii?Q?DpWS5zM5rVz7ihuYreX5dlNbKgdm3OWfHdIGm/LB72VmiNc7QM2w754za+zG?= =?us-ascii?Q?xPQG54ZUIChImqaC86Id1b6KrbjdYi7AVux0dJkScOT4O6siIF3IYh7EVLIp?= =?us-ascii?Q?Z7fM8BSxx3IvPTBHPa2oSvySKfP+7ZsfalQybaUVPqSlJOFcK6nMsh73wvRJ?= =?us-ascii?Q?lq3Q4gXH2yjg+xxN7Z7G+rodjbc+TyiCfzKNMF+WMyvrcMArhUPsEpSZTj33?= =?us-ascii?Q?R95Or/W+MYEMCD02OLHemYRdhgunGqXKJgLfn/1DSCAkvt6VhvRVVeGnJg6T?= =?us-ascii?Q?46bd6y7wttbae4AnoeRMQrU=3D?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68bf9063-c053-474f-2e5e-08d9b356c15b X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4899.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2021 16:39:04.4901 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nMN0U4FVR/hoa+IJjaptSiK9ShMhRHE5Ej/gKzVatHhaPXGRHJow8VPyOchd1+YjRGx1FWOA/TKcfMc53jF9kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7537 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.10 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 1ATGd9MP017761 X-loop: libvir-list@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: 1638203962856100001 Content-Type: text/plain; charset="utf-8" libxl can deliver events and invoke callbacks on any application thread calling into libxl. This can cause deadlock in the libvirt libxl driver Thread 19 (Thread 0x7f31411ec700 (LWP 14068) "libvirtd"): #0 0x00007f318520cc7d in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x00007f3185205ed5 in pthread_mutex_lock () from /lib64/libpthread.so.0 #2 0x00007f3189488015 in virMutexLock (m=3D) at ../../src/u= til/virthread.c:79 #3 0x00007f3189463f3b in virObjectLock (anyobj=3D) at ../..= /src/util/virobject.c:433 #4 0x00007f31894f2f41 in virDomainObjListSearchID (payload=3D0x7f317400a6d= 0, name=3D, data=3D0x7f31411eaeac) at ../../src/conf/virdoma= inobjlist.c:105 JWF: the 'payload' is virDomainObj with domid 28712, 'data'= is domid 28710. So looking for 28710 but firsh compare with 28712, which i= s the virDomainObj we started working with in f15 and is locked. #5 0x00007f3189437ac5 in virHashSearch (ctable=3D0x7f3124025a30, iter=3Dit= er@entry=3D0x7f31894f2f30 , data=3Ddata@entry=3D0= x7f31411eaeac, name=3Dname@entry=3D0x0) at ../../src/util/virhash.c:745 #6 0x00007f31894f3919 in virDomainObjListFindByID (doms=3D0x7f3124025430, = id=3D) at ../../src/conf/virdomainobjlist.c:121 #7 0x00007f3152f292e5 in libxlDomainEventHandler (data=3D0x7f3124023d80, e= vent=3D0x7f310c010ae0) at ../../src/libxl/libxl_domain.c:660 #8 0x00007f3152c6ff5d in egc_run_callbacks (egc=3Degc@entry=3D0x7f31411eaf= 50) at libxl_event.c:1427 #9 0x00007f3152c718bd in libxl__egc_cleanup (egc=3D0x7f31411eaf50) at libx= l_event.c:1458 #10 libxl__ao_inprogress (ao=3Dao@entry=3D0x7f310c00b8a0, file=3Dfile@entry= =3D0x7f3152cce987 "libxl_domain.c", line=3Dline@entry=3D730, func=3Dfunc@en= try=3D0x7f3152ccf750 <__func__.22238> "libxl_domain_unpause") at libxl_even= t.c:2047 #11 0x00007f3152c8c5b8 in libxl_domain_unpause (ctx=3D0x7f3124015a40, domid= =3D, ao_how=3Dao_how@entry=3D0x0) at libxl_domain.c:730 #12 0x00007f3152f2a584 in libxl_domain_unpause_0x041200 (domid=3D, ctx=3D) at /usr/include/libxl.h:1756 #13 libxlDomainStart (driver=3Ddriver@entry=3D0x7f3124023d80, vm=3Dvm@entry= =3D0x7f317400a6d0, start_paused=3Dstart_paused@entry=3Dfalse, restore_fd=3D= restore_fd@entry=3D-1, restore_ver=3D, restore_ver@entry=3D2= ) at ../../src/libxl/libxl_domain.c:1482 #14 0x00007f3152f2a6e3 in libxlDomainStartNew (driver=3Ddriver@entry=3D0x7f= 3124023d80, vm=3Dvm@entry=3D0x7f317400a6d0, start_paused=3Dstart_paused@ent= ry=3Dfalse) at ../../src/libxl/libxl_domain.c:1545 #15 0x00007f3152f2a789 in libxlDomainShutdownHandleRestart (driver=3D0x7f31= 24023d80, vm=3D0x7f317400a6d0) at ../../src/libxl/libxl_domain.c:464 JWF: d= omid here is 28712 #16 0x00007f3152f2a9e4 in libxlDomainShutdownThread (opaque=3D) at ../../src/libxl/libxl_domain.c:559 #17 0x00007f3189487ee2 in virThreadHelper (data=3D) at ../..= /src/util/virthread.c:196 #18 0x00007f3185203539 in start_thread () from /lib64/libpthread.so.0 #19 0x00007f3184f3becf in clone () from /lib64/libc.so.6 Frame 16 runs a thread created to handle domain shutdown processing for domid 28712. In this case the event contained the reboot reason, so the old domain is destroyed and a new one is created by libxlDomainStart new. After starting the domain, it is unpaused by calling libxl_domain_unpause in frame 12. While the thread is running within libxl, libxl takes the opportunity to deliver a pending domain shutdown event for unrelated domid 28710. While searching for the associated virDomainObj by ID, a deadlock is encountered when attempting to lock the virDomainObj for domid 28712, which is already locked since this thread is processing its shutdown event. The deadlock can be avoided by moving the search for a virDomainObj associated with the event domid to the shutdown thread. The same is done for the death thread. Signed-off-by: Jim Fehlig --- src/libxl/libxl_domain.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index d6c5f7e5b7..366e3b9263 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -480,7 +480,6 @@ libxlDomainShutdownHandleRestart(libxlDriverPrivate *dr= iver, struct libxlEventHandlerThreadInfo { libxlDriverPrivate *driver; - virDomainObj *vm; libxl_event *event; }; =20 @@ -489,7 +488,7 @@ static void libxlDomainShutdownThread(void *opaque) { struct libxlEventHandlerThreadInfo *shutdown_info =3D opaque; - virDomainObj *vm =3D shutdown_info->vm; + virDomainObj *vm =3D NULL; libxl_event *ev =3D shutdown_info->event; libxlDriverPrivate *driver =3D shutdown_info->driver; virObjectEvent *dom_event =3D NULL; @@ -499,6 +498,12 @@ libxlDomainShutdownThread(void *opaque) =20 libxl_domain_config_init(&d_config); =20 + vm =3D virDomainObjListFindByID(driver->domains, ev->domid); + if (!vm) { + /* Nothing to do if we can't find the virDomainObj */ + goto cleanup; + } + if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) goto cleanup; =20 @@ -616,12 +621,18 @@ static void libxlDomainDeathThread(void *opaque) { struct libxlEventHandlerThreadInfo *death_info =3D opaque; - virDomainObj *vm =3D death_info->vm; + virDomainObj *vm =3D NULL; libxl_event *ev =3D death_info->event; libxlDriverPrivate *driver =3D death_info->driver; virObjectEvent *dom_event =3D NULL; g_autoptr(libxlDriverConfig) cfg =3D libxlDriverConfigGet(driver); =20 + vm =3D virDomainObjListFindByID(driver->domains, ev->domid); + if (!vm) { + /* Nothing to do if we can't find the virDomainObj */ + goto cleanup; + } + if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) goto cleanup; =20 @@ -650,7 +661,6 @@ libxlDomainEventHandler(void *data, libxl_event *event) { libxlDriverPrivate *driver =3D data; libxl_shutdown_reason xl_reason =3D event->u.domain_shutdown.shutdown_= reason; - virDomainObj *vm =3D NULL; g_autoptr(libxlDriverConfig) cfg =3D NULL; struct libxlEventHandlerThreadInfo *thread_info =3D NULL; virThread thread; @@ -671,12 +681,6 @@ libxlDomainEventHandler(void *data, libxl_event *event) if (xl_reason =3D=3D LIBXL_SHUTDOWN_REASON_SUSPEND) goto cleanup; =20 - vm =3D virDomainObjListFindByID(driver->domains, event->domid); - if (!vm) { - /* Nothing to do if we can't find the virDomainObj */ - goto cleanup; - } - /* * Start event-specific threads to handle shutdown and death. * They are potentially lengthy operations and we don't want to be @@ -686,7 +690,6 @@ libxlDomainEventHandler(void *data, libxl_event *event) thread_info =3D g_new0(struct libxlEventHandlerThreadInfo, 1); =20 thread_info->driver =3D driver; - thread_info->vm =3D vm; thread_info->event =3D (libxl_event *)event; thread_name =3D g_strdup_printf("shutdown-event-%d", event->domid); /* @@ -701,15 +704,14 @@ libxlDomainEventHandler(void *data, libxl_event *even= t) goto cleanup; } /* - * virDomainObjEndAPI is called in the shutdown thread, where - * libxlEventHandlerThreadInfo and libxl_event are also freed. + * libxlEventHandlerThreadInfo and libxl_event are freed in the + * shutdown thread */ return; } else if (event->type =3D=3D LIBXL_EVENT_TYPE_DOMAIN_DEATH) { thread_info =3D g_new0(struct libxlEventHandlerThreadInfo, 1); =20 thread_info->driver =3D driver; - thread_info->vm =3D vm; thread_info->event =3D (libxl_event *)event; thread_name =3D g_strdup_printf("death-event-%d", event->domid); /* @@ -724,14 +726,13 @@ libxlDomainEventHandler(void *data, libxl_event *even= t) goto cleanup; } /* - * virDomainObjEndAPI is called in the death thread, where - * libxlEventHandlerThreadInfo and libxl_event are also freed. + * libxlEventHandlerThreadInfo and libxl_event are freed in the + * death thread */ return; } =20 cleanup: - virDomainObjEndAPI(&vm); VIR_FREE(thread_info); cfg =3D libxlDriverConfigGet(driver); /* Cast away any const */ --=20 2.33.0