aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-31 19:00:16 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-03-31 19:00:16 +0000
commit8a7ddc38a60648257dc0645ab4a05b33d6040063 (patch)
tree07f940c19bd51e3d6a7724f7141ef53d535a007f /monitor.c
parentb0a21b5334fb31042d555bfb66de864291c53140 (diff)
new timer API - new API to save/restore the virtual machine state
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@690 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c53
1 files changed, 52 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index 3d5db97016..8c016a8ac8 100644
--- a/monitor.c
+++ b/monitor.c
@@ -281,6 +281,50 @@ static void do_log(int argc, const char **argv)
cpu_set_log(mask);
}
+static void do_savevm(int argc, const char **argv)
+{
+ if (argc != 2) {
+ help_cmd(argv[0]);
+ return;
+ }
+ if (qemu_savevm(argv[1]) < 0)
+ term_printf("I/O error when saving VM to '%s'\n", argv[1]);
+}
+
+static void do_loadvm(int argc, const char **argv)
+{
+ if (argc != 2) {
+ help_cmd(argv[0]);
+ return;
+ }
+ if (qemu_loadvm(argv[1]) < 0)
+ term_printf("I/O error when loading VM from '%s'\n", argv[1]);
+}
+
+static void do_stop(int argc, const char **argv)
+{
+ vm_stop(EXCP_INTERRUPT);
+}
+
+static void do_cont(int argc, const char **argv)
+{
+ vm_start();
+}
+
+static void do_gdbserver(int argc, const char **argv)
+{
+ int port;
+
+ port = DEFAULT_GDBSTUB_PORT;
+ if (argc >= 2)
+ port = atoi(argv[1]);
+ if (gdbserver_start(port) < 0) {
+ qemu_printf("Could not open gdbserver socket on port %d\n", port);
+ } else {
+ qemu_printf("Waiting gdb connection on port %d\n", port);
+ }
+}
+
static term_cmd_t term_cmds[] = {
{ "help|?", do_help,
"[cmd]", "show the help" },
@@ -298,6 +342,13 @@ static term_cmd_t term_cmds[] = {
"filename", "save screen into PPM image 'filename'" },
{ "log", do_log,
"item1[,...]", "activate logging of the specified items to '/tmp/qemu.log'" },
+ { "savevm", do_savevm,
+ "filename", "save the whole virtual machine state to 'filename'" },
+ { "loadvm", do_loadvm,
+ "filename", "restore the whole virtual machine state from 'filename'" },
+ { "stop", do_stop, "", "stop emulation", },
+ { "c|cont", do_cont, "", "resume emulation", },
+ { "gdbserver", do_gdbserver, "[port]", "start gdbserver session (default port=1234)", },
{ NULL, NULL, },
};
@@ -601,5 +652,5 @@ void monitor_init(void)
QEMU_VERSION);
term_show_prompt();
}
- add_fd_read_handler(0, term_can_read, term_read, NULL);
+ qemu_add_fd_read_handler(0, term_can_read, term_read, NULL);
}