From nobody Wed Jun 24 21:39:42 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=1781788885; cv=none; d=zohomail.com; s=zohoarc; b=EZdspuJCVGAbXfeyO4UTKMJ2wsdGGfVsrSgoRpOtlzZpzNavvvXmlrLIrCcI7s34d5YPiEN1jYVHw3Zy3UTUj6h3ZoBzrrF3kKE9UeRSKCUGOBOztpIf/lMXYebRjgVLViYR13mB2D65PaA02TQHvO6U62cTYnlqV35bJa8k8/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781788885; 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=WcV/iLQWpoRp85wVdcggfmXUWGUj6CqkgOmPixknjBw=; b=hLeoH0/4R13WEk7MBgjTSFBoNpDixsbT9EdQUubPhMvb3+L/VGnsuizuSWkisaJ1DJLs54VTNYqXK8jWhCdvDZMF0TtXZoT9uPxDTb6APT+M9BnmVQo3R4ACP6oJyOH47T8POgZfEA9DKpSH/omZDHNyxBtU8kByCiceR/+7pzs= 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 1781788885891984.2556048442551; Thu, 18 Jun 2026 06:21:25 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 8B9D741DCF; Thu, 18 Jun 2026 09:21:24 -0400 (EDT) Received: from [172.19.199.7] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id CF14641DE9; Thu, 18 Jun 2026 09:20:34 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 7474041D2B; Thu, 18 Jun 2026 09:20:24 -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 13BD44195E for ; Thu, 18 Jun 2026 09:20:22 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-eg4DYobaNTed0eK1KUof5A-1; Thu, 18 Jun 2026 09:20:20 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 660A31955E9F for ; Thu, 18 Jun 2026 13:20:18 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.24.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 95D291956088 for ; Thu, 18 Jun 2026 13:20:17 +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=0.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781788822; 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=WcV/iLQWpoRp85wVdcggfmXUWGUj6CqkgOmPixknjBw=; b=HoLT77yYL7olJpWs4yzHvluO49cZhjujnNQP4tMOYS8+CJHvN7MEj527V7H2hjChAW2IZJ oKlkyU1juxiZqVwWCR+eOfZF6ewBpG15rtqKmT1bk0WZ2b1XaXb/Cx7of6zKpOdWBEdzLR Gpb4jCd6FaChpi2h5QDtOYQeYsuZ8SM= X-MC-Unique: eg4DYobaNTed0eK1KUof5A-1 X-Mimecast-MFC-AGG-ID: eg4DYobaNTed0eK1KUof5A_1781788820 To: devel@lists.libvirt.org Subject: [PATCH 1/2] qemuProcessQMPStop: Preserve error when killing qemu used for capability probing Date: Thu, 18 Jun 2026 15:20:13 +0200 Message-ID: <5bc59640d80160a1e81278673a4defbc69f20d08.1781788771.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JDMv8FcfAzOE-INJy_3rLtsIyV2yWgz3GHxf6MNrFzc_1781788820 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GPWRFJIYJC6WSLLVVGDOJXDTYJG4QMH5 X-Message-ID-Hash: GPWRFJIYJC6WSLLVVGDOJXDTYJG4QMH5 X-MailFrom: pkrempa@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: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1781788888582158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa When probing of capabilities fails 'qemuProcessQMPStop' kills the qemu process, but also resets the error. The virResetLastError() was originally intended to reset the error from 'virProcessKillPainfully', it also resets any probing error resulting in the following: $ virsh start VM error: Failed to start domain 'VM' error: An error occurred, but the cause is unknown Keep the error clearing as this might be called on success but preserve the original error around it. Fixes: db7b0b12b7b07b8a0313161e3cbedb38a74e5954 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_process.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index cbe5cb33d3..4c94ff3c91 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -10239,6 +10239,8 @@ static qemuMonitorCallbacks callbacks =3D { static void qemuProcessQMPStop(qemuProcessQMP *proc) { + virErrorPtr err; + if (proc->mon) { virObjectUnlock(proc->mon); g_clear_pointer(&proc->mon, qemuMonitorClose); @@ -10255,10 +10257,12 @@ qemuProcessQMPStop(qemuProcessQMP *proc) virDomainObjEndAPI(&proc->vm); if (proc->pid !=3D 0) { + virErrorPreserveLast(&err); VIR_DEBUG("Killing QMP caps process %lld", (long long)proc->pid); virProcessKillPainfully(proc->pid, true); virResetLastError(); proc->pid =3D 0; + virErrorRestore(&err); } if (proc->pidfile) --=20 2.54.0 From nobody Wed Jun 24 21:39:42 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=1781788993; cv=none; d=zohomail.com; s=zohoarc; b=lym3XTfgysmYSJnbFvYq4XimYtqHPSd1kIUHelX4SxKq8HqdOfYnE57QxfkilV1OYjSpC15ws26PjYk61A6lQpCmUSz+x1bqe+No5LU+LIfjMwcAnBYvKriYd+oDpJKv1opr6Z+6UqV0n/kkEh4yDsN3QsxbdAS6GQ5xkGyTMdw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1781788993; 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=MqMx2OlbY60sjUaWT7KNQcJro8CkvibLnAa2Uxi+kiQ=; b=EGnDT6rhRz7tgNU+u6ljUfQNNKyYGvXs3wV9G8g9WeCCvM0XFpKRVLdN7C1M65jRMhb83nF4iqQZvVnZ4PEsdw/peOCOUYQ3o3mwBsCarsbkIeABRHjqh11glWZbr3f3Dcd9dnZ73Lk21HKvGq222Pudrq0hLrlcMOpbzVAgbyM= 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 1781788993352100.97805396209822; Thu, 18 Jun 2026 06:23:13 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 2E0C641D35; Thu, 18 Jun 2026 09:23:12 -0400 (EDT) Received: from [172.19.199.7] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id 86EB6423DD; Thu, 18 Jun 2026 09:20:45 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id B8CEE41D2B; Thu, 18 Jun 2026 09:20:27 -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 9EB4D4195E for ; Thu, 18 Jun 2026 09:20:26 -0400 (EDT) Received: from mx-prod-mc-08.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-453-jck-4SRCP92xXdL5YD_uQg-1; Thu, 18 Jun 2026 09:20:22 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7F74A1806CB0 for ; Thu, 18 Jun 2026 13:20:19 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.24.18]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C953E195608C for ; Thu, 18 Jun 2026 13:20:18 +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=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_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=1781788826; 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=MqMx2OlbY60sjUaWT7KNQcJro8CkvibLnAa2Uxi+kiQ=; b=LWY6ncjIJavRcmBFfUy3fJrLUbWgI96oY6f44/8fhenxuSWG2VKGycdsC5S6TZ33l1dxr9 3iE4k0459U1DkZWsusyt70Vo3Jxy/j/ieKpyHuWtdSrv/bbMry6Il6ZkV99RN1kcHw6SAr RI0/83m7lPiAwb8mqVDxvlEXlUgTRW8= X-MC-Unique: jck-4SRCP92xXdL5YD_uQg-1 X-Mimecast-MFC-AGG-ID: jck-4SRCP92xXdL5YD_uQg_1781788821 To: devel@lists.libvirt.org Subject: [PATCH 2/2] virQEMUCapsLogProbeFailure: Reraise error with more information Date: Thu, 18 Jun 2026 15:20:14 +0200 Message-ID: <2d01b6c602a742ad78348bdb5b788bcb96b10eba.1781788771.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: P9v3zXTrEnJXjvDN7NcFbiGd4yaWpFxWv4gLzy_36Aw_1781788821 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: C6MERRXKI6MAOG7KMTJYVPLOZ3BNGTQZ X-Message-ID-Hash: C6MERRXKI6MAOG7KMTJYVPLOZ3BNGTQZ X-MailFrom: pkrempa@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: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1781788995711158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa While we don't normally try to re-wrap errors to be more descriptive, probing of qemu capabilities is a special case as the errors can be cryptic and don't give users enough information about what's going on. An example is (obtained from a patched qemu which accidentally returned a broken QMP schema): $ virsh start VM error: Failed to start domain 'VM' error: internal error: Duplicate hash table key 'str' The error is unusable. On the other hand in 'virQEMUCapsLogProbeFailure' we do special logging of the caps probing failure with a custom UUID so that it can be easily found in the logs which reports a much better error message. Re-raise the same as a normal error too so that the user gets similar experience: $ virsh start VM error: Failed to start domain 'VM' error: internal error: Failed to probe capabilities for /home/user/git/qe= mu.git/build/qemu-system-x86_64: internal error: Duplicate hash table key '= str' This does mean though that the error is logged twice, once via the custom log entry and second via 'virReportError'. Given that this error is extremely unlikely, having two log entries IMO doesn't warant reworking the whole error reporting infra to allow passing extra metadata just for this one case. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_capabilities.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a28f87ad2b..be57dcad8e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6065,6 +6065,10 @@ virQEMUCapsLogProbeFailure(const char *binary) meta, _("Failed to probe capabilities for %1$s: %2$s"), binary, virGetLastErrorMessage()); + + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Failed to probe capabilities for %1$s: %2$s"), + binary, virGetLastErrorMessage()); } --=20 2.54.0