From nobody Fri May 3 15:47:16 2024 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1518696256918200.4797455088443; Thu, 15 Feb 2018 04:04:16 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3CA9776D4; Thu, 15 Feb 2018 12:04:13 +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 700785D9C9; Thu, 15 Feb 2018 12:04:12 +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 3FE20180CB22; Thu, 15 Feb 2018 12:04:10 +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 w1FBwUwZ024727 for ; Thu, 15 Feb 2018 06:58:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id 559615C89C; Thu, 15 Feb 2018 11:58:30 +0000 (UTC) Received: from mx1.redhat.com (ext-mx01.extmail.prod.ext.phx2.redhat.com [10.5.110.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 464445F729 for ; Thu, 15 Feb 2018 11:58:26 +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 DFE225FD63 for ; Thu, 15 Feb 2018 11:58:25 +0000 (UTC) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1FBt79w006879 for ; Thu, 15 Feb 2018 06:58:25 -0500 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 2g55k29yn9-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 15 Feb 2018 06:58:24 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Feb 2018 11:58:23 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Feb 2018 11:58:20 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1FBwJE649217760; Thu, 15 Feb 2018 11:58:19 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B17FF5204C; Thu, 15 Feb 2018 10:50:19 +0000 (GMT) Received: from s38lp19.boeblingen.de.ibm.com (unknown [9.152.161.19]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9229652043; Thu, 15 Feb 2018 10:50:19 +0000 (GMT) From: Bjoern Walk To: libvir-list@redhat.com Date: Thu, 15 Feb 2018 12:58:17 +0100 X-TM-AS-GCONF: 00 x-cbid: 18021511-0040-0000-0000-0000040FFF05 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021511-0041-0000-0000-00002613C94B Message-Id: <20180215115817.249749-1-bwalk@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-15_05:, , 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802150149 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.25]); Thu, 15 Feb 2018 11:58:26 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 15 Feb 2018 11:58:26 +0000 (UTC) for IP:'148.163.158.5' DOMAIN:'mx0b-001b2d01.pphosted.com' HELO:'mx0a-001b2d01.pphosted.com' FROM:'bwalk@linux.vnet.ibm.com' RCPT:'' X-RedHat-Spam-Score: -0.701 (RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2) 148.163.158.5 mx0b-001b2d01.pphosted.com 148.163.158.5 mx0b-001b2d01.pphosted.com X-Scanned-By: MIMEDefang 2.83 on 10.5.110.25 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Bjoern Walk Subject: [libvirt] [PATCH libvirt] qemu: log the crash information for S390 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.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 15 Feb 2018 12:04:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Since QEMU 2.12 guest crash information for S390 is available in the QEMU monitor, e.g.: { "timestamp": { "seconds": 1518004739, "microseconds": 552563 }, "event": "GUEST_PANICKED", "data": { "action": "pause", "info": { "core": 0, "psw-addr": 1102832, "reason": "disabled-wait", "psw-mask": 562956395872256, "type": "s390" } } } Let's log this information into the domain log file, e.g.: 2018-02-08 13:11:26.075+0000: panic s390: core=3D'0' psw-mask=3D'0x0002= 000180000000' psw-addr=3D'0x000000000010f146' reason=3D'disabled-wait' Reviewed-by: Boris Fiuczynski Signed-off-by: Bjoern Walk Reviewed-by: John Ferlan --- src/qemu/qemu_monitor.c | 19 ++++++++++++++++++- src/qemu/qemu_monitor.h | 12 ++++++++++++ src/qemu/qemu_monitor_json.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9b5ad72c..8c394583 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4363,7 +4363,14 @@ qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorE= ventPanicInfoPtr info) 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, "s390: core=3D'%d' psw-mask=3D'0x%0= 16llx' " + "psw-addr=3D'0x%016llx' reason=3D'%s'", + info->data.s390.core, + info->data.s390.psw_mask, + info->data.s390.psw_addr, + info->data.s390.reason)); + break; case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE: case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST: break; @@ -4379,6 +4386,16 @@ qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicI= nfoPtr info) if (!info) return; =20 + switch (info->type) { + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390: + VIR_FREE(info->data.s390.reason); + break; + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE: + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_HYPERV: + case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST: + break; + } + VIR_FREE(info); } =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index ea0c01ae..4b3a5e21 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -73,6 +73,7 @@ struct _qemuMonitorMessage { typedef enum { QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE =3D 0, QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_HYPERV, + QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390, =20 QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST } qemuMonitorEventPanicInfoType; @@ -88,12 +89,23 @@ struct _qemuMonitorEventPanicInfoHyperv { unsigned long long arg5; }; =20 +typedef struct _qemuMonitorEventPanicInfoS390 qemuMonitorEventPanicInfoS39= 0; +typedef qemuMonitorEventPanicInfoS390 *qemuMonitorEventPanicInfoS390Ptr; +struct _qemuMonitorEventPanicInfoS390 { + /* S390 specific guest panic information */ + int core; + unsigned long long psw_mask; + unsigned long long psw_addr; + char *reason; +}; + typedef struct _qemuMonitorEventPanicInfo qemuMonitorEventPanicInfo; typedef qemuMonitorEventPanicInfo *qemuMonitorEventPanicInfoPtr; struct _qemuMonitorEventPanicInfo { qemuMonitorEventPanicInfoType type; union { qemuMonitorEventPanicInfoHyperv hyperv; + qemuMonitorEventPanicInfoS390 s390; } data; }; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 242b92ea..5c1f6836 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -576,6 +576,44 @@ qemuMonitorJSONGuestPanicExtractInfoHyperv(virJSONValu= ePtr data) return NULL; } =20 +static qemuMonitorEventPanicInfoPtr +qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValuePtr data) +{ + qemuMonitorEventPanicInfoPtr ret; + int core; + unsigned long long psw_mask, psw_addr; + const char *reason =3D NULL; + + if (VIR_ALLOC(ret) < 0) + return NULL; + + ret->type =3D QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390; + + if (virJSONValueObjectGetNumberInt(data, "core", &core) < 0 || + virJSONValueObjectGetNumberUlong(data, "psw-mask", &psw_mask) < 0 = || + virJSONValueObjectGetNumberUlong(data, "psw-addr", &psw_addr) < 0)= { + goto error; + } + + ret->data.s390.core =3D core; + ret->data.s390.psw_mask =3D psw_mask; + ret->data.s390.psw_addr =3D psw_addr; + + reason =3D virJSONValueObjectGetString(data, "reason"); + if (!reason) + goto error; + + if (VIR_STRDUP(ret->data.s390.reason, reason) < 0) + goto no_memory; + + return ret; + + error: + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("malformed s390 panic d= ata")); + no_memory: + qemuMonitorEventPanicInfoFree(ret); + return NULL; +} =20 static qemuMonitorEventPanicInfoPtr qemuMonitorJSONGuestPanicExtractInfo(virJSONValuePtr data) @@ -584,6 +622,8 @@ qemuMonitorJSONGuestPanicExtractInfo(virJSONValuePtr da= ta) =20 if (STREQ_NULLABLE(type, "hyper-v")) return qemuMonitorJSONGuestPanicExtractInfoHyperv(data); + else if (STREQ_NULLABLE(type, "s390")) + return qemuMonitorJSONGuestPanicExtractInfoS390(data); =20 virReportError(VIR_ERR_INTERNAL_ERROR, _("unknown panic info type '%s'"), NULLSTR(type)); --=20 2.13.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list