qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
Cc: kvm@vger.kernel.org, qemu-devel@nongnu.org,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Andrey Smetanin" <asmetanin@virtuozzo.com>,
	"Denis V. Lunev" <den@openvz.org>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH 10/12] qemu/kvm: added kvm system event crash handler
Date: Thu,  2 Jul 2015 19:07:53 +0300	[thread overview]
Message-ID: <1435853275-5440-11-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1435853275-5440-1-git-send-email-den@openvz.org>

From: Andrey Smetanin <asmetanin@virtuozzo.com>

KVM kernel can receive guest crash events. Patch code calls appropriate
handler for kernel guest crash event. Guest crash event recognized
by KVM_SYSTEM_EVENT_CRASH type of system event.

Signed-off-by: Andrey Smetanin <asmetanin@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Andreas Färber <afaerber@suse.de>
---
 kvm-all.c                 | 4 ++++
 linux-headers/linux/kvm.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/kvm-all.c b/kvm-all.c
index 53e01d4..7a959b6 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1844,6 +1844,10 @@ int kvm_cpu_exec(CPUState *cpu)
                 qemu_system_reset_request();
                 ret = EXCP_INTERRUPT;
                 break;
+            case KVM_SYSTEM_EVENT_CRASH:
+                qemu_system_guest_panicked();
+                ret = 0;
+                break;
             default:
                 DPRINTF("kvm_arch_handle_exit\n");
                 ret = kvm_arch_handle_exit(cpu, run);
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index fad9e5c..409be37 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -317,6 +317,7 @@ struct kvm_run {
 		struct {
 #define KVM_SYSTEM_EVENT_SHUTDOWN       1
 #define KVM_SYSTEM_EVENT_RESET          2
+#define KVM_SYSTEM_EVENT_CRASH          3
 			__u32 type;
 			__u64 flags;
 		} system_event;
-- 
2.1.4

  parent reply	other threads:[~2015-07-02 16:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02 16:07 [Qemu-devel] [PATCH v5 0/12] HyperV equivalent of pvpanic driver Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 01/12] kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 02/12] kvm: introduce vcpu_debug = kvm_debug + vcpu context Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 03/12] kvm: add hyper-v crash msrs values Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 04/12] kvm/x86: added hyper-v crash msrs into kvm hyperv context Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 05/12] kvm: added KVM_REQ_HV_CRASH value to notify qemu about hyper-v crash Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 06/12] kvm/x86: mark hyper-v crash msrs as partition wide Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 07/12] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers Denis V. Lunev
2015-07-02 16:29   ` Paolo Bonzini
2015-07-02 16:07 ` [Qemu-devel] [PATCH 08/12] kvm/x86: add sending hyper-v crash notification to user space Denis V. Lunev
2015-07-02 16:07 ` [Qemu-devel] [PATCH 09/12] qemu: added qemu_system_guest_panicked() - generic guest panic handler Denis V. Lunev
2015-07-02 16:07 ` Denis V. Lunev [this message]
2015-07-02 16:07 ` [Qemu-devel] [PATCH 11/12] qemu: add crash_occurred flag into CPUState Denis V. Lunev
2015-07-02 16:18   ` Andreas Färber
2015-07-02 16:26     ` Paolo Bonzini
2015-07-02 16:07 ` [Qemu-devel] [PATCH 12/12] qemu/kvm/x86: hyper-v crash msrs set/get'ers and migration Denis V. Lunev
2015-07-02 16:18   ` 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=1435853275-5440-11-git-send-email-den@openvz.org \
    --to=den@openvz.org \
    --cc=afaerber@suse.de \
    --cc=asmetanin@virtuozzo.com \
    --cc=kvm@vger.kernel.org \
    --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 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).