From: "Denis V. Lunev" <den@openvz.org>
To: qemu-devel@nongnu.org
Cc: den@openvz.org, Anton Nefedov <anton.nefedov@virtuozzo.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Eric Blake <eblake@redhat.com>
Subject: [Qemu-devel] [PATCH 1/3] i386/cpu: release GuestPanicInformation memory
Date: Mon, 20 Feb 2017 21:21:53 +0300 [thread overview]
Message-ID: <1487614915-18710-2-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1487614915-18710-1-git-send-email-den@openvz.org>
From: Anton Nefedov <anton.nefedov@virtuozzo.com>
Do not make some foreign function do it.
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>
---
kvm-all.c | 5 ++++-
vl.c | 22 +++++++++-------------
2 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 0c94637..ac07902 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1909,6 +1909,7 @@ int kvm_cpu_exec(CPUState *cpu)
do {
MemTxAttrs attrs;
+ GuestPanicInformation *crash_info;
if (cpu->kvm_vcpu_dirty) {
kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE);
@@ -2001,9 +2002,11 @@ int kvm_cpu_exec(CPUState *cpu)
break;
case KVM_SYSTEM_EVENT_CRASH:
kvm_cpu_synchronize_state(cpu);
+ crash_info = cpu_get_crash_info(cpu);
qemu_mutex_lock_iothread();
- qemu_system_guest_panicked(cpu_get_crash_info(cpu));
+ qemu_system_guest_panicked(crash_info);
qemu_mutex_unlock_iothread();
+ qapi_free_GuestPanicInformation(crash_info);
ret = 0;
break;
default:
diff --git a/vl.c b/vl.c
index 27d9829..81382b6 100644
--- a/vl.c
+++ b/vl.c
@@ -1682,6 +1682,15 @@ void qemu_system_reset(bool report)
void qemu_system_guest_panicked(GuestPanicInformation *info)
{
qemu_log_mask(LOG_GUEST_ERROR, "Guest crashed\n");
+ if (info && info->type == GUEST_PANIC_INFORMATION_KIND_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);
+ }
if (current_cpu) {
current_cpu->crash_occurred = true;
@@ -1694,19 +1703,6 @@ void qemu_system_guest_panicked(GuestPanicInformation *info)
!!info, info, &error_abort);
qemu_system_shutdown_request();
}
-
- if (info) {
- if (info->type == GUEST_PANIC_INFORMATION_KIND_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);
- }
- qapi_free_GuestPanicInformation(info);
- }
}
void qemu_system_reset_request(void)
--
2.7.4
next prev parent reply other threads:[~2017-02-20 18:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-20 18:21 [Qemu-devel] [PATCH for 2.9 0/3] guest panic information follow-up Denis V. Lunev
2017-02-20 18:21 ` Denis V. Lunev [this message]
2017-02-20 19:42 ` [Qemu-devel] [PATCH 1/3] i386/cpu: release GuestPanicInformation memory Eric Blake
2017-02-20 18:21 ` [Qemu-devel] [PATCH 2/3] qapi: flatten GuestPanicInformation union Denis V. Lunev
2017-02-20 19:48 ` Eric Blake
2017-02-20 19:58 ` Denis V. Lunev
2017-02-21 8:15 ` Evgeny Yakovlev
2017-02-20 18:21 ` [Qemu-devel] [PATCH 3/3] qmp-events: fix GUEST_PANICKED description formatting Denis V. Lunev
2017-02-20 19:49 ` Eric Blake
2017-02-21 10:41 ` [Qemu-devel] [PATCH for 2.9 0/3] guest panic information follow-up Paolo Bonzini
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=1487614915-18710-2-git-send-email-den@openvz.org \
--to=den@openvz.org \
--cc=anton.nefedov@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.