From nobody Thu Apr 25 07:22:56 2024 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=1683633080; cv=none; d=zohomail.com; s=zohoarc; b=KXoLfIOd/GNmMpDK+E0xnHDCZxngF0pOosgtK0h/WbSA1jMkO2gqJT4aOgQt+TcBSYOtkOt3YeOVD55y0EfVj7BVPneeicOuX5I6PrsaxYW7gBIuePyIX5HWMe0SjGYbw7K8Erio6rywe8z+6EPQwOBuXdeih8IgQS2E/O5neN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683633080; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=FTiJflNNKYYLPXmC/YG+e4ZPIFekE3x7i7s6NqyZH2A=; b=XS7UtSFDmI11I6GO/7Zvu8c7nzM6NB9c+BMrBLmDpAFi1vIXt7riVl7iKyD7ADY313q409a1fFGheEngYYS2GZPmwKQPs4TMm8seDN1YGS+gN8VIR8pbQ61ziwRD2KU+lSUeAn+6Qge/XCdmg4GDo7XinhrQlRXqAjJ2cGY6YnY= 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 1683633080133261.78051161494955; Tue, 9 May 2023 04:51:20 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-41-rEgP4tkCPIOP2QDnJ6DC8A-1; Tue, 09 May 2023 07:51:14 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 63689868C9D; Tue, 9 May 2023 11:51:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D9AEC15BA0; Tue, 9 May 2023 11:51:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C817119465BD; Tue, 9 May 2023 11:51:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 054A819465BC for ; Tue, 9 May 2023 11:51:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CF5CD2026D25; Tue, 9 May 2023 11:51:10 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7721C2026D16 for ; Tue, 9 May 2023 11:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1683633079; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FTiJflNNKYYLPXmC/YG+e4ZPIFekE3x7i7s6NqyZH2A=; b=BpykEXRArjzREsz0qqVgQRu/aMbswjGmc7N5ZG+9RrUA9A3f/j/sasfUc6kWixzFT3UpeC dGp7xs2VXJppCM2eP6zhYRYvCaUa6BWQCBrbRlKwsErm0VvglFY20+WKmYm+enn6rY4TZN uyuEcNXqsQUYGsmNeaH5d6udKWAm8Eg= X-MC-Unique: rEgP4tkCPIOP2QDnJ6DC8A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu: Report domain name in unexpectedly closed monitor message Date: Tue, 9 May 2023 14:51:08 +0300 Message-Id: <50aef3d7fe6744141f2883eac8b5ee7813c3f5a3.1683633068.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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: 1683633081827100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When QEMU closes the monitor suddenly, the following error message is reported: internal error: qemu unexpectedly closed the monitor: ... And this works. But other error messages produced in the same function include domain name too. Do that for the unexpectedly closed monitor message too. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 71ebd356ad..dacf161971 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -513,15 +513,18 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED, =20 if (error || mon->goteof) { if (hangup && mon->logFunc !=3D NULL) { + g_autofree char *errmsg =3D NULL; + /* Check if an error message from qemu is available and if so,= use * it to overwrite the actual message. It's done only in early * startup phases or during incoming migration when the message * from qemu is certainly more interesting than a * "connection reset by peer" message. */ - mon->logFunc(mon, - _("qemu unexpectedly closed the monitor"), - mon->logOpaque); + + errmsg =3D g_strdup_printf(_("QEMU unexpectedly closed the mon= itor (vm=3D'%1$s')"), + mon->domainName); + mon->logFunc(mon, errmsg, mon->logOpaque); virCopyLastError(&mon->lastError); virResetLastError(); } --=20 2.39.3