From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anton Nefedov <anton.nefedov@virtuozzo.com>,
"Denis V . Lunev" <den@openvz.org>,
Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [PATCH 16/17] qapi: flatten GuestPanicInformation union
Date: Mon, 27 Feb 2017 13:45:50 +0100 [thread overview]
Message-ID: <20170227124551.8673-17-pbonzini@redhat.com> (raw)
In-Reply-To: <20170227124551.8673-1-pbonzini@redhat.com>
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Eric Blake <eblake@redhat.com>
Message-Id: <1487614915-18710-3-git-send-email-den@openvz.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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' ] }
##
+# @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' } }
##
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_info(CPUState *cs)
GuestPanicInformation *panic_info = NULL;
if (env->features[FEAT_HYPERV_EDX] & HV_X64_GUEST_CRASH_MSR_AVAILABLE) {
- GuestPanicInformationHyperV *panic_info_hv =
- g_malloc0(sizeof(GuestPanicInformationHyperV));
panic_info = g_malloc0(sizeof(GuestPanicInformation));
- panic_info->type = GUEST_PANIC_INFORMATION_KIND_HYPER_V;
- panic_info->u.hyper_v.data = panic_info_hv;
+ panic_info->type = GUEST_PANIC_INFORMATION_TYPE_HYPER_V;
assert(HV_X64_MSR_CRASH_PARAMS >= 5);
- panic_info_hv->arg1 = env->msr_hv_crash_params[0];
- panic_info_hv->arg2 = env->msr_hv_crash_params[1];
- panic_info_hv->arg3 = env->msr_hv_crash_params[2];
- panic_info_hv->arg4 = env->msr_hv_crash_params[3];
- panic_info_hv->arg5 = env->msr_hv_crash_params[4];
+ panic_info->u.hyper_v.arg1 = env->msr_hv_crash_params[0];
+ panic_info->u.hyper_v.arg2 = env->msr_hv_crash_params[1];
+ panic_info->u.hyper_v.arg3 = env->msr_hv_crash_params[2];
+ panic_info->u.hyper_v.arg4 = env->msr_hv_crash_params[3];
+ panic_info->u.hyper_v.arg5 = env->msr_hv_crash_params[4];
}
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(GuestPanicInformation *info)
}
if (info) {
- if (info->type == GUEST_PANIC_INFORMATION_KIND_HYPER_V) {
+ if (info->type == 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);
}
--
2.9.3
next prev parent reply other threads:[~2017-02-27 12:46 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-27 12:45 [Qemu-devel] [PULL v2 00/17] KVM and cpu-exec patches for 2.9 soft freeze Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 01/17] cpu-exec: unify icount_decr and tcg_exit_req Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 02/17] replay: check icount in cpu exec loop Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 03/17] cpu-exec: remove unnecessary check of cpu->exit_request Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 04/17] update-linux-headers: update for 4.11 Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 05/17] update Linux headers to 4.11 Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 06/17] cpus: remove ugly cast on sigbus_handler Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 07/17] KVM: x86: cleanup SIGBUS handlers Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 08/17] cpus: reorganize signal handling code Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 09/17] KVM: remove kvm_arch_on_sigbus Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 10/17] KVM: do not use sigtimedwait to catch SIGBUS Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 11/17] KVM: move SIG_IPI handling to kvm-all.c Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 12/17] kvm: use atomic_read/atomic_set to access cpu->exit_request Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 13/17] KVM: use KVM_CAP_IMMEDIATE_EXIT Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 14/17] vmxcap: port to Python 3 Paolo Bonzini
2017-02-27 12:45 ` [Qemu-devel] [PATCH 15/17] vmxcap: update for September 2016 SDM Paolo Bonzini
2017-02-27 12:45 ` Paolo Bonzini [this message]
2017-02-27 12:45 ` [Qemu-devel] [PATCH 17/17] qmp-events: fix GUEST_PANICKED description formatting Paolo Bonzini
2017-02-27 14:03 ` [Qemu-devel] [PULL v2 00/17] KVM and cpu-exec patches for 2.9 soft freeze no-reply
2017-02-27 14:37 ` Peter Maydell
2017-02-27 15:02 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170227124551.8673-17-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=anton.nefedov@virtuozzo.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).