From nobody Tue Feb 10 01:36:00 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488201000072967.4373995538679; Mon, 27 Feb 2017 05:10:00 -0800 (PST) Received: from localhost ([::1]:52393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciL3s-0007xS-QJ for importer@patchew.org; Mon, 27 Feb 2017 08:09:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciKgw-0004p8-AS for qemu-devel@nongnu.org; Mon, 27 Feb 2017 07:46:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciKgu-0000gE-3x for qemu-devel@nongnu.org; Mon, 27 Feb 2017 07:46:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53256) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ciKgt-0000fr-SS for qemu-devel@nongnu.org; Mon, 27 Feb 2017 07:46:12 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 EBAB285540; Mon, 27 Feb 2017 12:46:11 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-118.ams2.redhat.com [10.36.117.118]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1RCjpeB028718; Mon, 27 Feb 2017 07:46:10 -0500 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 27 Feb 2017 13:45:50 +0100 Message-Id: <20170227124551.8673-17-pbonzini@redhat.com> In-Reply-To: <20170227124551.8673-1-pbonzini@redhat.com> References: <20170227124551.8673-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 27 Feb 2017 12:46:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 16/17] qapi: flatten GuestPanicInformation union X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Denis V . Lunev" , Anton Nefedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Anton Nefedov Signed-off-by: Anton Nefedov Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Eric Blake Message-Id: <1487614915-18710-3-git-send-email-den@openvz.org> Signed-off-by: Paolo Bonzini --- qapi-schema.json | 12 ++++++++++++ target/i386/cpu.c | 15 ++++++--------- vl.c | 12 ++++++------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 150ee98..ad341b2 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -5906,6 +5906,16 @@ 'data': [ 'pause', 'poweroff' ] } =20 ## +# @GuestPanicInformationType: +# +# An enumeration of the guest panic information types +# +# Since: 2.9 +## +{ 'enum': 'GuestPanicInformationType', + 'data': [ 'hyper-v'] } + +## # @GuestPanicInformation: # # Information about a guest panic @@ -5913,6 +5923,8 @@ # Since: 2.9 ## {'union': 'GuestPanicInformation', + 'base': {'type': 'GuestPanicInformationType'}, + 'discriminator': 'type', 'data': { 'hyper-v': 'GuestPanicInformationHyperV' } } =20 ## diff --git a/target/i386/cpu.c b/target/i386/cpu.c index b6f157d..8c3e882 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3501,19 +3501,16 @@ static GuestPanicInformation *x86_cpu_get_crash_inf= o(CPUState *cs) GuestPanicInformation *panic_info =3D NULL; =20 if (env->features[FEAT_HYPERV_EDX] & HV_X64_GUEST_CRASH_MSR_AVAILABLE)= { - GuestPanicInformationHyperV *panic_info_hv =3D - g_malloc0(sizeof(GuestPanicInformationHyperV)); panic_info =3D g_malloc0(sizeof(GuestPanicInformation)); =20 - panic_info->type =3D GUEST_PANIC_INFORMATION_KIND_HYPER_V; - panic_info->u.hyper_v.data =3D panic_info_hv; + panic_info->type =3D GUEST_PANIC_INFORMATION_TYPE_HYPER_V; =20 assert(HV_X64_MSR_CRASH_PARAMS >=3D 5); - panic_info_hv->arg1 =3D env->msr_hv_crash_params[0]; - panic_info_hv->arg2 =3D env->msr_hv_crash_params[1]; - panic_info_hv->arg3 =3D env->msr_hv_crash_params[2]; - panic_info_hv->arg4 =3D env->msr_hv_crash_params[3]; - panic_info_hv->arg5 =3D env->msr_hv_crash_params[4]; + panic_info->u.hyper_v.arg1 =3D env->msr_hv_crash_params[0]; + panic_info->u.hyper_v.arg2 =3D env->msr_hv_crash_params[1]; + panic_info->u.hyper_v.arg3 =3D env->msr_hv_crash_params[2]; + panic_info->u.hyper_v.arg4 =3D env->msr_hv_crash_params[3]; + panic_info->u.hyper_v.arg5 =3D env->msr_hv_crash_params[4]; } =20 return panic_info; diff --git a/vl.c b/vl.c index e10a27b..7f57ded 100644 --- a/vl.c +++ b/vl.c @@ -1717,14 +1717,14 @@ void qemu_system_guest_panicked(GuestPanicInformati= on *info) } =20 if (info) { - if (info->type =3D=3D GUEST_PANIC_INFORMATION_KIND_HYPER_V) { + if (info->type =3D=3D GUEST_PANIC_INFORMATION_TYPE_HYPER_V) { qemu_log_mask(LOG_GUEST_ERROR, "HV crash parameters: (%#"PRIx64 " %#"PRIx64" %#"PRIx64" %#"PRIx64" %#"PRIx64")\n= ", - info->u.hyper_v.data->arg1, - info->u.hyper_v.data->arg2, - info->u.hyper_v.data->arg3, - info->u.hyper_v.data->arg4, - info->u.hyper_v.data->arg5); + info->u.hyper_v.arg1, + info->u.hyper_v.arg2, + info->u.hyper_v.arg3, + info->u.hyper_v.arg4, + info->u.hyper_v.arg5); } qapi_free_GuestPanicInformation(info); } --=20 2.9.3