From nobody Tue Feb 10 02:42:38 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 1487959999468937.6631131496098; Fri, 24 Feb 2017 10:13:19 -0800 (PST) Received: from localhost ([::1]:39095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chKMn-00022W-6w for importer@patchew.org; Fri, 24 Feb 2017 13:13:17 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chJrR-00084e-AY for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:40:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chJrQ-0002KG-34 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:40:53 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chJrP-0002K1-TC for qemu-devel@nongnu.org; Fri, 24 Feb 2017 12:40:52 -0500 Received: by mail-wr0-x242.google.com with SMTP id 89so3129484wrr.1 for ; Fri, 24 Feb 2017 09:40:51 -0800 (PST) Received: from 640k.lan (94-39-187-56.adsl-ull.clienti.tiscali.it. [94.39.187.56]) by smtp.gmail.com with ESMTPSA id s26sm8814533wra.66.2017.02.24.09.40.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 09:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KNI7Dlzkt7l8U1askl4WIJSSeP1coZ90IXXrfVIgjW0=; b=XX/qg4Ndjn4xkT6cCaUEw1gN+gofQGmYQfpnL+P/8MpzFru1KOgCPLPPKiZQxuIonw TmoefsMgaflGdH+l/akvJSsDeRjpb5MIdscEnbGgEUbosmgVj/BV6eZ8A2DN7SSfWiWz 15djPIn5zxjk/Hew+v20fy2ph0V+1aJe2Sa43ggE/kwX+UvbRLtYrt6G/NWLFHakj857 lNYB0XxgA4gsETA86cxGTmlIi4/E+/SB+8Cw6n48NCNmupsCIfsdTU3Lsj3B5XfbRTRE QrFLkt5HouBVJo20jn8vxm7VTwA2pUU1/SZHb7AiZFHG8g90tOT7HO/QmFgI8dP/b9y0 3Z5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=KNI7Dlzkt7l8U1askl4WIJSSeP1coZ90IXXrfVIgjW0=; b=WZYOnqg+WU5Wx4ZMqD+Z0xqvmA/4YhgKhY2+tTZJf8ksfymwNcK/OlVEmwTgZfOfMx 4eebEtnlsilkH6Zdjr4oR90+RDWmiZB/vFZoMF/InCiVbIW0t90WNICW/R04DQ3G3q9l UEC+7zF6uWWT12pyPGNs/kOZtZNvdLvqquoUUZe4qjy8C75X414X39msnchWToY2T/sT lrz1nSjPEVYH8UJizEAr/pary3zF+QM0MpyyIhH+E1aSKoDogRThlakLZjJNrVAJDYhI sXvDGz31bRSti4FMSVg22vMM/3+/ewO5m66wvRl+Js8c+xMYjsC8X/X3sQnRuSTPnAQu D+FQ== X-Gm-Message-State: AMke39kkjZnaYZR8gOlcllAcxNwORUZQVWfP+O+Kw6Qb3Zy2krw5NEPndiZ7wYZckmuJqQ== X-Received: by 10.223.167.138 with SMTP id j10mr3616048wrc.178.1487958050734; Fri, 24 Feb 2017 09:40:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 24 Feb 2017 18:40:29 +0100 Message-Id: <1487958030-51417-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487958030-51417-1-git-send-email-pbonzini@redhat.com> References: <1487958030-51417-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL 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 e9a6364..b142e15 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -5872,6 +5872,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 @@ -5879,6 +5889,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 fd7add2..63be816 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3502,19 +3502,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 b5d0a19..e307ae0 100644 --- a/vl.c +++ b/vl.c @@ -1697,14 +1697,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 1.8.3.1