[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/17] qapi: flatten GuestPanicInformation union
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 16/17] qapi: flatten GuestPanicInformation union |
Date: |
Mon, 27 Feb 2017 13:45:50 +0100 |
From: Anton Nefedov <address@hidden>
Signed-off-by: Anton Nefedov <address@hidden>
Signed-off-by: Denis V. Lunev <address@hidden>
CC: Paolo Bonzini <address@hidden>
CC: Eric Blake <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
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
- [Qemu-devel] [PATCH 08/17] cpus: reorganize signal handling code, (continued)
- [Qemu-devel] [PATCH 08/17] cpus: reorganize signal handling code, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 09/17] KVM: remove kvm_arch_on_sigbus, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 10/17] KVM: do not use sigtimedwait to catch SIGBUS, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 12/17] kvm: use atomic_read/atomic_set to access cpu->exit_request, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 11/17] KVM: move SIG_IPI handling to kvm-all.c, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 13/17] KVM: use KVM_CAP_IMMEDIATE_EXIT, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 15/17] vmxcap: update for September 2016 SDM, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 14/17] vmxcap: port to Python 3, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 05/17] update Linux headers to 4.11, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 17/17] qmp-events: fix GUEST_PANICKED description formatting, Paolo Bonzini, 2017/02/27
- [Qemu-devel] [PATCH 16/17] qapi: flatten GuestPanicInformation union,
Paolo Bonzini <=
- Re: [Qemu-devel] [PULL v2 00/17] KVM and cpu-exec patches for 2.9 soft freeze, no-reply, 2017/02/27
- Re: [Qemu-devel] [PULL v2 00/17] KVM and cpu-exec patches for 2.9 soft freeze, Peter Maydell, 2017/02/27