From nobody Sun Oct 5 01:50:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; 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 8.43.85.245 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=1757591075; cv=none; d=zohomail.com; s=zohoarc; b=jDm2GfBI/3ahruF79Gh2NufJCIvGri7Hd+/+WulO/fYAghefbn22EhAvKGbLZ8VJ1XVZLfoLa2I3cWZ/j0W9nANxxdp/nV0E1jkbbxDJZI//WViN9TE1nuAFe0REcPrjZLnhAcIr7VXcw9R5+qMRDMXRSowAQa6D1dPvcZvvIH8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757591075; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=vGlzI9ol8oqLVPI2i02fzYDtb5/mETZ9pnNrHn+8h5w=; b=XlN9FjOY9cTiuu9HZ+PjegCGfuHl8Rv+pPt72EXBGZRWiOwk5MtDu2C6zzaOHgcdBW3l1MkwpukEfAOqvPYU7Vq4eHDTSgaUVcGbQVnZlAhvozp/dZ7RzSlwRc8WUiunyeLUo32l+ofKFknJbJfJ9BPZOEAemE6GHnR2WejzYMw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 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 [8.43.85.245]) by mx.zohomail.com with SMTPS id 1757591075323193.5489307445796; Thu, 11 Sep 2025 04:44:35 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 6A65B3F369; Thu, 11 Sep 2025 07:44:34 -0400 (EDT) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 0581F41BCD; Thu, 11 Sep 2025 07:41:43 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 6374141B43; Thu, 11 Sep 2025 07:41:28 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 9E31041B47 for ; Thu, 11 Sep 2025 07:41:27 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-647-h0ukNycnMXekw03Th-tDDA-1; Thu, 11 Sep 2025 07:41:25 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EEBBB1800291 for ; Thu, 11 Sep 2025 11:41:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.3.236]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 400181800452 for ; Thu, 11 Sep 2025 11:41:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1757590887; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vGlzI9ol8oqLVPI2i02fzYDtb5/mETZ9pnNrHn+8h5w=; b=JEl46w7Vl+PPJakl/+c4U9IHRO7A6Rb5NgdvC/vrwtfYPByQ19PAwIz3HV+cykygpOlc7b ApmJSvpVsXQkpzK8mtHa5QXZFUV6almMxRcGxKFQilM5IYmJwH5sJJPNpTpXCBeXCZiSlu I58qNQyety8cq4g7QQhBFrmWqfCgCAI= X-MC-Unique: h0ukNycnMXekw03Th-tDDA-1 X-Mimecast-MFC-AGG-ID: h0ukNycnMXekw03Th-tDDA_1757590885 To: devel@lists.libvirt.org Subject: [PATCH 2/2] ch: Unlock domain in virCHEventStopProcess() on all exit paths Date: Thu, 11 Sep 2025 13:41:19 +0200 Message-ID: <76d94eff991ba5eeae943768af725946120ba48e.1757590801.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mNUJp11iNILYfEMAsVCcqQP6cpB117vwTS_BqZDRit8_1757590885 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 5R6HBVTT7WMPBB4564V2AZT2E7N5HJIN X-Message-ID-Hash: 5R6HBVTT7WMPBB4564V2AZT2E7N5HJIN X-MailFrom: mprivozn@redhat.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 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: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1757591076484116601 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik The aim of virCHEventStopProcess() is to clean up after stopped domain by calling virCHProcessStop(). But in order to do that it needs to acquire a job and in order to do that it needs to lock the domain object. Well, the object is not unlocked in all exit paths, i.e. when job acquiring fails the domain object is left locked. Signed-off-by: Michal Privoznik --- src/ch/ch_events.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ch/ch_events.c b/src/ch/ch_events.c index 25c7ecf90a..cd2f92a493 100644 --- a/src/ch/ch_events.c +++ b/src/ch/ch_events.c @@ -55,13 +55,12 @@ virCHEventStopProcess(virDomainObj *vm, virDomainShutoffReason reason) { virCHDriver *driver =3D CH_DOMAIN_PRIVATE(vm)->driver; + VIR_LOCK_GUARD lock =3D virObjectLockGuard(vm); =20 - virObjectLock(vm); if (virDomainObjBeginJob(vm, VIR_JOB_DESTROY)) return -1; virCHProcessStop(driver, vm, reason, VIR_CH_PROCESS_STOP_FORCE); virDomainObjEndJob(vm); - virObjectUnlock(vm); =20 return 0; } --=20 2.49.1