提交 e8ed97a6 编写于 作者: A Anton Nefedov 提交者: Paolo Bonzini

qapi: flatten GuestPanicInformation union

Signed-off-by: NAnton Nefedov <anton.nefedov@virtuozzo.com>
Signed-off-by: NDenis 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: NPaolo Bonzini <pbonzini@redhat.com>
上级 025533f6
...@@ -5914,6 +5914,16 @@ ...@@ -5914,6 +5914,16 @@
{ 'enum': 'GuestPanicAction', { 'enum': 'GuestPanicAction',
'data': [ 'pause', 'poweroff' ] } 'data': [ 'pause', 'poweroff' ] }
##
# @GuestPanicInformationType:
#
# An enumeration of the guest panic information types
#
# Since: 2.9
##
{ 'enum': 'GuestPanicInformationType',
'data': [ 'hyper-v'] }
## ##
# @GuestPanicInformation: # @GuestPanicInformation:
# #
...@@ -5922,6 +5932,8 @@ ...@@ -5922,6 +5932,8 @@
# Since: 2.9 # Since: 2.9
## ##
{'union': 'GuestPanicInformation', {'union': 'GuestPanicInformation',
'base': {'type': 'GuestPanicInformationType'},
'discriminator': 'type',
'data': { 'hyper-v': 'GuestPanicInformationHyperV' } } 'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
## ##
......
...@@ -3778,19 +3778,16 @@ static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs) ...@@ -3778,19 +3778,16 @@ static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs)
GuestPanicInformation *panic_info = NULL; GuestPanicInformation *panic_info = NULL;
if (env->features[FEAT_HYPERV_EDX] & HV_X64_GUEST_CRASH_MSR_AVAILABLE) { 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 = g_malloc0(sizeof(GuestPanicInformation));
panic_info->type = GUEST_PANIC_INFORMATION_KIND_HYPER_V; panic_info->type = GUEST_PANIC_INFORMATION_TYPE_HYPER_V;
panic_info->u.hyper_v.data = panic_info_hv;
assert(HV_X64_MSR_CRASH_PARAMS >= 5); assert(HV_X64_MSR_CRASH_PARAMS >= 5);
panic_info_hv->arg1 = env->msr_hv_crash_params[0]; panic_info->u.hyper_v.arg1 = env->msr_hv_crash_params[0];
panic_info_hv->arg2 = env->msr_hv_crash_params[1]; panic_info->u.hyper_v.arg2 = env->msr_hv_crash_params[1];
panic_info_hv->arg3 = env->msr_hv_crash_params[2]; panic_info->u.hyper_v.arg3 = env->msr_hv_crash_params[2];
panic_info_hv->arg4 = env->msr_hv_crash_params[3]; panic_info->u.hyper_v.arg4 = env->msr_hv_crash_params[3];
panic_info_hv->arg5 = env->msr_hv_crash_params[4]; panic_info->u.hyper_v.arg5 = env->msr_hv_crash_params[4];
} }
return panic_info; return panic_info;
......
...@@ -1717,14 +1717,14 @@ void qemu_system_guest_panicked(GuestPanicInformation *info) ...@@ -1717,14 +1717,14 @@ void qemu_system_guest_panicked(GuestPanicInformation *info)
} }
if (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 qemu_log_mask(LOG_GUEST_ERROR, "HV crash parameters: (%#"PRIx64
" %#"PRIx64" %#"PRIx64" %#"PRIx64" %#"PRIx64")\n", " %#"PRIx64" %#"PRIx64" %#"PRIx64" %#"PRIx64")\n",
info->u.hyper_v.data->arg1, info->u.hyper_v.arg1,
info->u.hyper_v.data->arg2, info->u.hyper_v.arg2,
info->u.hyper_v.data->arg3, info->u.hyper_v.arg3,
info->u.hyper_v.data->arg4, info->u.hyper_v.arg4,
info->u.hyper_v.data->arg5); info->u.hyper_v.arg5);
} }
qapi_free_GuestPanicInformation(info); qapi_free_GuestPanicInformation(info);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册