From nobody Sun Sep 28 15:25:50 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=1758797304; cv=none; d=zohomail.com; s=zohoarc; b=A1qZAURMyOLEXJPl8Ud+k0i6qBDiVRFp6MNVafkqXbqmfGidHa2HedSfAFNuxQo5mdiL0S91XTcDCPhqXFCGqaZONnkEOo6XFm1coCBr4BhZ7QUOwp3zhTLELSgkB02LLnDbhEhDyc3dDrri20a0rxlxghWimBR3WnPdgD9vJ7c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758797304; h=Content-Type: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=4eqRD9Zdeyk92VWPnwKxNF1eluR+jCOfRnC3AfnbZNU=; b=fwSolSu/U55pClvPHvdIeTFkcajaUF7ubEGO2gXTLw3vIY1qBBcMGKK/cIc/q8ath9mG8cPkh9yNrcSXtA4691yJLy5Hl+KWvpEgDfmaYs4kakDeaRacMKe/6VvCHuAB1f6xBn95AwJc+KjOq4oYBA7oh4qguzCdGftHnESHPl8= 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 1758797304354711.3007433987804; Thu, 25 Sep 2025 03:48:24 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 467354408A; Thu, 25 Sep 2025 06:48:23 -0400 (EDT) Received: from [172.19.199.14] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 479784435C; Thu, 25 Sep 2025 05:49:50 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id D15B941C83; Thu, 25 Sep 2025 05:48:31 -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 75EC341ABE for ; Thu, 25 Sep 2025 05:46:20 -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-467-t0MUrkWyNHW2HU3sj-E1Ag-1; Thu, 25 Sep 2025 05:46:18 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 0A374180057D; Thu, 25 Sep 2025 09:46:17 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.163]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B185730002D2; Thu, 25 Sep 2025 09:46:11 +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=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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=1758793580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4eqRD9Zdeyk92VWPnwKxNF1eluR+jCOfRnC3AfnbZNU=; b=EcWH1+3a6U+Etd+psp7eblV+SOKlWT0Tu4lXusmwzPosv0uVfxNtbcdbq1tKrqPA98qfME GpwqIvnjRzsm7IZ9jNn9XzZSvmQqhx/+a1qMz8fF+MoZoa/1Vg4/SdZL3k/B/H+VHx0wgG sPPEnI57hLp8J8sU6sb2ts3F44yTRZE= X-MC-Unique: t0MUrkWyNHW2HU3sj-E1Ag-1 X-Mimecast-MFC-AGG-ID: t0MUrkWyNHW2HU3sj-E1Ag_1758793577 To: qemu-devel@nongnu.org Subject: [PATCH v4 15/23] util: don't skip error prefixes when QMP is active Date: Thu, 25 Sep 2025 10:44:33 +0100 Message-ID: <20250925094441.1651372-16-berrange@redhat.com> In-Reply-To: <20250925094441.1651372-1-berrange@redhat.com> References: <20250925094441.1651372-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Message-ID-Hash: RCS3RONIMYUNYX2S34XGKQKN76MMT3KH X-Message-ID-Hash: RCS3RONIMYUNYX2S34XGKQKN76MMT3KH X-MailFrom: berrange@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 CC: Hanna Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Kevin Wolf , qemu-rust@nongnu.org, Richard Henderson , Markus Armbruster , Christian Schoenebeck , qemu-block@nongnu.org, Stefan Weil , "Dr. David Alan Gilbert" , Manos Pitsidianakis , Gerd Hoffmann , devel@lists.libvirt.org, Paolo Bonzini 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: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1758797305661116600 The vreport() function will print to HMP if available, otherwise to stderr. In the event that vreport() is called during execution of a QMP command, it will print to stderr, but mistakenly omit the message prefixes (timestamp, guest name, program name). Signed-off-by: Daniel P. Berrang=C3=A9 --- util/error-report.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/error-report.c b/util/error-report.c index b262ad01cb..872158ad90 100644 --- a/util/error-report.c +++ b/util/error-report.c @@ -159,7 +159,7 @@ static void print_loc(void) int i; const char *const *argp; =20 - if (!monitor_cur() && g_get_prgname()) { + if (!monitor_cur_is_hmp() && g_get_prgname()) { error_printf("%s:", g_get_prgname()); sep =3D " "; } @@ -203,14 +203,14 @@ static void vreport(report_type type, const char *fmt= , va_list ap) { gchar *timestr; =20 - if (message_with_timestamp && !monitor_cur()) { + if (message_with_timestamp && !monitor_cur_is_hmp()) { timestr =3D real_time_iso8601(); error_printf("%s ", timestr); g_free(timestr); } =20 /* Only prepend guest name if -msg guest-name and -name guest=3D... ar= e set */ - if (error_with_guestname && error_guest_name && !monitor_cur()) { + if (error_with_guestname && error_guest_name && !monitor_cur_is_hmp())= { error_printf("%s ", error_guest_name); } =20 --=20 2.50.1