From nobody Tue Feb 10 01:15:38 2026 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635243462; cv=none; d=zohomail.com; s=zohoarc; b=SWzGZKkQLRa3FGhcy+YHaD3TLzxsn91IQXjOWj5EUvPg5ZyTKhAWZ9qx81d/gJSCOJwC4c8R3W2F9i7dwCfBZhunlfl/v4cRLcO0xOGQgz1X+JLFVipaiu9JBGJQvXNSVsrabDaIcE/RI15V0SbgzgOewTef7Y+CvE+Irzb9x/U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635243462; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yXitFVFwMPI1hn1PUNWwuJqpY4ULDdENDYJDnq7IR3E=; b=nUMw2UWh2VAtwKQszga4IbRp7G8BRF5/CruIrP4ksonc4u8ZdRG+BLHzP3zXuzNkjjtsyC/IiCJNsUKa1U4unWUJdFIrspgrMfbu1ylgUsCCkJT8J910+NGOnhl6lUYBEB9m1w3vaBJYzsaw4nDI9EEHh+V2YEhtvKkGa8BGQf8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1635243462642698.8159890457727; Tue, 26 Oct 2021 03:17:42 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-81-Dxb6svF3MJWBeSCKhDm1lA-1; Tue, 26 Oct 2021 06:17:39 -0400 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 E9AF7101B4A0; Tue, 26 Oct 2021 10:17:34 +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 CD1336FEED; Tue, 26 Oct 2021 10:17:34 +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 9C8174EA31; Tue, 26 Oct 2021 10:17:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 19QAHIr0008334 for ; Tue, 26 Oct 2021 06:17:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3CCAB171FF; Tue, 26 Oct 2021 10:17:18 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8BFB5C1CF for ; Tue, 26 Oct 2021 10:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635243461; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yXitFVFwMPI1hn1PUNWwuJqpY4ULDdENDYJDnq7IR3E=; b=UYAHgUcvvO4Dw89MGAdOpF6PH5kNjB/zWh2wK3kWMu7uDThrSNVeLBX/UD4GAJBCg0F3Gi Ka8Oory1k9h4BTlGoijoDM3HpIxxBYb5GC91PxGSkD0f83CKdzqDykOZHkj83nTayE586l nd3T08GoT5Yk8h+ETPx0lxvm9nFVSWE= X-MC-Unique: Dxb6svF3MJWBeSCKhDm1lA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/3] qemu: Set "qemu-event" thread identity Date: Tue, 26 Oct 2021 12:17:07 +0200 Message-Id: <82ecb3204297517a8a4a00c5c747730a8ae8297d.1635243314.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635243463848100001 Content-Type: text/plain; charset="utf-8" It may happen that qemuProcessStop() is called from "qemu-event" thread. But this thread doesn't have any virIdentity set (virIdentity being thread local) and therefore it may be unable to open connection to secondary drivers. It is unable to do so in split daemon scenario, because in there opening a connection is coupled with copying current thread identity onto the connection. Code-wise, virIdentityGetCurrent() returns NULL which in turn makes virGetConnectGeneric() fail. This problem does not occur in monolithic daemon scenario, because no identity copying is done there. Long story short, inability to open secondary driver connection can lead to unwanted results. Therefore, do what qemuProcessReconnectHelper() does - set the new thread identity to be the one of the caller. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2013573 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index a8bf0ecc6f..70b5f37e6b 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -571,6 +571,7 @@ qemuStateInitialize(bool privileged, size_t i; const char *defsecmodel =3D NULL; g_autofree virSecurityManager **sec_managers =3D NULL; + g_autoptr(virIdentity) identity =3D virIdentityGetCurrent(); =20 qemu_driver =3D g_new0(virQEMUDriver, 1); =20 @@ -915,7 +916,7 @@ qemuStateInitialize(bool privileged, * events that will be dispatched to the worker pool */ qemu_driver->workerPool =3D virThreadPoolNewFull(0, 1, 0, qemuProcessE= ventHandler, "qemu-event", - NULL, + identity, qemu_driver); if (!qemu_driver->workerPool) goto error; --=20 2.32.0