From: Wen Congyang <wency@cn.fujitsu.com>
To: kvm list <kvm@vger.kernel.org>,
qemu-devel <qemu-devel@nongnu.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Avi Kivity <avi@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Gleb Natapov <gleb@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 6/6 v5] deal with panicked event accoring to '-machine panic_action=action'
Date: Wed, 27 Jun 2012 15:04:50 +0800 [thread overview]
Message-ID: <4FEAB092.4020603@cn.fujitsu.com> (raw)
In-Reply-To: <4FEAAE6E.7070302@cn.fujitsu.com>
The action is the same as -onpanic parameter.
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
qemu-config.c | 4 ++++
qemu-options.hx | 4 +++-
vl.c | 7 +++++++
3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/qemu-config.c b/qemu-config.c
index 5c3296b..805e7c4 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -595,6 +595,10 @@ static QemuOptsList qemu_machine_opts = {
.name = "dt_compatible",
.type = QEMU_OPT_STRING,
.help = "Overrides the \"compatible\" property of the dt root node",
+ }, {
+ .name = "panic_action",
+ .type = QEMU_OPT_STRING,
+ .help = "The action what QEMU will do when the guest is panicked",
},
{ /* End of list */ }
},
diff --git a/qemu-options.hx b/qemu-options.hx
index 4a061bf..083a21d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -33,7 +33,9 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
" property accel=accel1[:accel2[:...]] selects accelerator\n"
" supported accelerators are kvm, xen, tcg (default: tcg)\n"
" kernel_irqchip=on|off controls accelerated irqchip support\n"
- " kvm_shadow_mem=size of KVM shadow MMU\n",
+ " kvm_shadow_mem=size of KVM shadow MMU\n"
+ " panic_action=none|pause|poweroff|reset controls what QEmu\n"
+ " will do when the guest is panicked",
QEMU_ARCH_ALL)
STEXI
@item -machine [type=]@var{name}[,prop=@var{value}[,...]]
diff --git a/vl.c b/vl.c
index 9164d29..7663699 100644
--- a/vl.c
+++ b/vl.c
@@ -2301,6 +2301,7 @@ int main(int argc, char **argv, char **envp)
};
const char *trace_events = NULL;
const char *trace_file = NULL;
+ const char *panic_action = NULL;
atexit(qemu_run_exit_notifiers);
error_set_progname(argv[0]);
@@ -3372,10 +3373,16 @@ int main(int argc, char **argv, char **envp)
kernel_filename = qemu_opt_get(machine_opts, "kernel");
initrd_filename = qemu_opt_get(machine_opts, "initrd");
kernel_cmdline = qemu_opt_get(machine_opts, "append");
+ panic_action = qemu_opt_get(machine_opts, "panic_action");
} else {
kernel_filename = initrd_filename = kernel_cmdline = NULL;
}
+ if (panic_action && select_panicked_action(panic_action) == -1) {
+ fprintf(stderr, "Unknown -panic_action parameter\n");
+ exit(1);
+ }
+
if (!kernel_cmdline) {
kernel_cmdline = "";
}
--
1.7.1
prev parent reply other threads:[~2012-06-27 7:04 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 6:55 [PATCH v5] kvm: notify host when the guest is panicked Wen Congyang
2012-06-27 6:57 ` [PATCH 1/6 v5] start vm after reseting it Wen Congyang
2012-06-27 6:58 ` [PATCH 2/6 v5] update linux headers Wen Congyang
2012-06-27 7:00 ` [PATCH 3/6 v5] add a new runstate: RUN_STATE_GUEST_PANICKED Wen Congyang
2012-06-27 7:01 ` [PATCH 4/6 v5] add a new qevent: QEVENT_GUEST_PANICKED Wen Congyang
2012-06-27 7:02 ` [PATCH 5/6 v5] deal with guest panicked event accoring to -onpanic parameter Wen Congyang
2012-06-27 14:39 ` Jan Kiszka
2012-06-28 1:15 ` Wen Congyang
2012-06-28 8:26 ` Jan Kiszka
2012-06-28 8:26 ` Jan Kiszka
2012-07-03 6:07 ` Wen Congyang
2012-07-03 6:07 ` [Qemu-devel] " Wen Congyang
2012-07-03 6:36 ` Jan Kiszka
2012-07-03 6:36 ` [Qemu-devel] " Jan Kiszka
2012-07-03 6:36 ` Jan Kiszka
2012-07-03 6:43 ` Wen Congyang
2012-07-03 6:43 ` [Qemu-devel] " Wen Congyang
2012-07-03 6:45 ` Jan Kiszka
2012-07-03 6:45 ` [Qemu-devel] " Jan Kiszka
2012-06-27 14:52 ` Cornelia Huck
2012-06-27 14:57 ` Daniel P. Berrange
2012-06-27 7:04 ` Wen Congyang [this message]
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=4FEAB092.4020603@cn.fujitsu.com \
--to=wency@cn.fujitsu.com \
--cc=avi@redhat.com \
--cc=berrange@redhat.com \
--cc=gleb@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@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 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.