From nobody Sat Feb 7 15:12:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linux.ibm.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1531306218032390.5864940762624; Wed, 11 Jul 2018 03:50:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5762F308FB9B; Wed, 11 Jul 2018 10:50:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 15EDF3001A5A; Wed, 11 Jul 2018 10:50:14 +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 A563118037F0; Wed, 11 Jul 2018 10:50:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6BAnoeK017758 for ; Wed, 11 Jul 2018 06:49:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 28DA960172; Wed, 11 Jul 2018 10:49:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx15.extmail.prod.ext.phx2.redhat.com [10.5.110.44]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FEFD6016F for ; Wed, 11 Jul 2018 10:49:46 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4317530832EB for ; Wed, 11 Jul 2018 10:49:45 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6BAnYsP006664 for ; Wed, 11 Jul 2018 06:49:44 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2k5cuh0fph-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Jul 2018 06:49:44 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Jul 2018 11:49:42 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 11 Jul 2018 11:49:41 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w6BAne8C36962478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Jul 2018 10:49:40 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4E0611C04A; Wed, 11 Jul 2018 13:50:01 +0100 (BST) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A4DBF11C052; Wed, 11 Jul 2018 13:50:01 +0100 (BST) Received: from s38lp19.boeblingen.de.ibm.com (unknown [9.152.161.19]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 11 Jul 2018 13:50:01 +0100 (BST) From: Bjoern Walk To: libvir-list@redhat.com Date: Wed, 11 Jul 2018 12:49:19 +0200 In-Reply-To: <20180711104922.26783-1-bwalk@linux.ibm.com> References: <20180711104922.26783-1-bwalk@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18071110-0008-0000-0000-00000251E9CE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18071110-0009-0000-0000-000021B81CF2 Message-Id: <20180711104922.26783-7-bwalk@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-11_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807110116 X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 207 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 11 Jul 2018 10:49:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 11 Jul 2018 10:49:45 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, SPF_PASS) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.44 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Bjoern Walk Subject: [libvirt] [PATCH 6/9] qemu: set state information for guest panic event 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 11 Jul 2018 10:50:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since version 2.12, QEMU reports additional information in case of a guest panic. Let's set the state information when handling the guest panic event and make it available for later. Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Signed-off-by: Bjoern Walk --- src/qemu/qemu_driver.c | 11 +++++++++-- src/qemu/qemu_monitor.c | 31 +++++++++++++++++++++++++++++++ src/qemu/qemu_monitor.h | 1 + 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 871f2dde..495c38db 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4255,6 +4255,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; virObjectEventPtr event =3D NULL; virQEMUDriverConfigPtr cfg =3D virQEMUDriverGetConfig(driver); + char *state_info =3D NULL; bool removeInactive =3D false; unsigned long flags =3D VIR_DUMP_MEMORY_ONLY; =20 @@ -4268,10 +4269,15 @@ processGuestPanicEvent(virQEMUDriverPtr driver, goto endjob; } =20 - if (info) + if (info) { qemuProcessGuestPanicEventInfo(driver, vm, info); + state_info =3D qemuMonitorGuestPanicEventInfoFormatMsgCompact(info= ); + } =20 - virDomainObjSetState(vm, VIR_DOMAIN_CRASHED, VIR_DOMAIN_CRASHED_PANICK= ED); + virDomainObjSetStateFull(vm, + VIR_DOMAIN_CRASHED, + VIR_DOMAIN_CRASHED_PANICKED, + state_info); =20 event =3D virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_CRASHED, @@ -4329,6 +4335,7 @@ processGuestPanicEvent(virQEMUDriverPtr driver, qemuDomainRemoveInactiveJob(driver, vm); =20 cleanup: + VIR_FREE(state_info); virObjectUnref(cfg); } =20 diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index bc116e4e..1ca54283 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4240,6 +4240,37 @@ qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon) } =20 =20 +char * +qemuMonitorGuestPanicEventInfoFormatMsgCompact(qemuMonitorEventPanicInfoPt= r info) +{ + char *ret =3D NULL; + + switch (info->type) { + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_HYPERV: + ignore_value(virAsprintf(&ret, + "arg1=3D'0x%llx', arg2=3D'0x%llx', " + "arg3=3D'0x%llx', arg4=3D'0x%llx', arg5= =3D'0x%llx'", + info->data.hyperv.arg1, info->data.hyperv= .arg2, + info->data.hyperv.arg3, info->data.hyperv= .arg4, + info->data.hyperv.arg5)); + break; + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390: + ignore_value(virAsprintf(&ret, "%s core=3D'%d' psw-mask=3D'0x%016l= lx' " + "psw-addr=3D'0x%016llx'", + info->data.s390.reason, + info->data.s390.core, + info->data.s390.psw_mask, + info->data.s390.psw_addr)); + break; + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE: + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST: + break; + } + + return ret; +} + + char * qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr info) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index e8ed2d04..e6fb39c5 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -109,6 +109,7 @@ struct _qemuMonitorEventPanicInfo { } data; }; =20 +char *qemuMonitorGuestPanicEventInfoFormatMsgCompact(qemuMonitorEventPanic= InfoPtr info); char *qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr= info); void qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info); =20 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list