aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUri Lublin <uril@qumranet.com>2006-11-23 15:23:41 +0000
committerUri Lublin <uril@qumranet.com>2006-11-23 15:23:41 +0000
commit5d1271dd97eabc41615e9800755b18693a0bb6ae (patch)
tree859fbd8597c6675150a608db2cbdb9ab5524bc22
parentkvm: svm module author and license (diff)
downloadqemu-kvm-5d1271dd97eabc41615e9800755b18693a0bb6ae.tar.gz
qemu-kvm-5d1271dd97eabc41615e9800755b18693a0bb6ae.tar.bz2
qemu-kvm-5d1271dd97eabc41615e9800755b18693a0bb6ae.zip
qemu: monitor: add 'migration' command
All subcommands but 'help' are not implemented yet.
-rw-r--r--migration.c12
-rw-r--r--migration.h14
-rw-r--r--monitor.c37
3 files changed, 62 insertions, 1 deletions
diff --git a/migration.c b/migration.c
new file mode 100644
index 000000000..9e4c6c8ee
--- /dev/null
+++ b/migration.c
@@ -0,0 +1,12 @@
+#include "migration.h"
+
+#define TO_BE_IMPLEMENTED term_printf("%s: TO_BE_IMPLEMENTED\n", __FUNCTION__)
+
+void do_migration_listen(char *arg1, char *arg2){ TO_BE_IMPLEMENTED; }
+void do_migration_connect(char *arg1, char *arg2){ TO_BE_IMPLEMENTED; }
+void do_migration_getfd(int fd) { TO_BE_IMPLEMENTED; }
+void do_migration_start(char *deadoralive) { TO_BE_IMPLEMENTED; }
+void do_migration_cancel(void){ TO_BE_IMPLEMENTED; }
+void do_migration_status(void){ TO_BE_IMPLEMENTED; }
+void do_migration_set(char *fmt, ...){ TO_BE_IMPLEMENTED; }
+void do_migration_show(void){ TO_BE_IMPLEMENTED; }
diff --git a/migration.h b/migration.h
new file mode 100644
index 000000000..c93662d0a
--- /dev/null
+++ b/migration.h
@@ -0,0 +1,14 @@
+#ifndef QEMU_MIGRATION_H
+#define QEMU_MIGRATION_H
+
+/* migration commands */
+void do_migration_listen(char *arg1, char *arg2);
+void do_migration_connect(char *arg1, char *arg2);
+void do_migration_getfd(int fd);
+void do_migration_start(char *deadoralive);
+void do_migration_cancel(void);
+void do_migration_status(void);
+void do_migration_set(char *fmt, ...);
+void do_migration_show(void);
+
+#endif /* QEMU_MIGRATION_H */
diff --git a/monitor.c b/monitor.c
index 138e93f71..7911217c2 100644
--- a/monitor.c
+++ b/monitor.c
@@ -24,7 +24,7 @@
#include "vl.h"
#include "disas.h"
#include <dirent.h>
-
+#include "migration.h"
//#define DEBUG
//#define DEBUG_COMPLETION
@@ -59,11 +59,15 @@ static CharDriverState *monitor_hd;
static term_cmd_t term_cmds[];
static term_cmd_t info_cmds[];
+static term_cmd_t migration_cmds[];
static char term_outbuf[1024];
static int term_outbuf_index;
static void monitor_start_input(void);
+static void monitor_handle_command(const term_cmd_t *cmds,
+ const char *cmdline);
+
CPUState *mon_cpu = NULL;
@@ -1153,6 +1157,16 @@ static void do_stop_capture (int n)
}
}
+static void do_migration(const char *subcmdline)
+{
+ monitor_handle_command(migration_cmds, subcmdline);
+}
+
+static void do_migration_help(char *name)
+{
+ help_cmd1(migration_cmds, "migration ", name);
+}
+
#ifdef HAS_AUDIO
int wav_start_capture (CaptureState *s, const char *path, int freq,
int bits, int nchannels);
@@ -1247,6 +1261,8 @@ static term_cmd_t term_cmds[] = {
"capture index", "stop capture" },
{ "create_snapshot", "ss?s?s?", do_snapshot,
"hda [hdb] [hdc] [hdd]", "create snapshot of one or more images (VMDK format)" },
+ { "migration", "A", do_migration, "subcommand|help",
+ "start/stop/manage migrations"},
{ NULL, NULL, },
};
@@ -1290,6 +1306,25 @@ static term_cmd_t info_cmds[] = {
{ NULL, NULL, },
};
+
+static term_cmd_t migration_cmds[] = {
+ { "listen", "s?s?", do_migration_listen,
+ "[local_host:port [remote_host:port]]", "listen to a port" },
+ { "connect", "s?s?", do_migration_connect,
+ "[local_host:port [remote_host:port]]", "connect to a port"},
+ { "getfd", "i", do_migration_getfd, "fd (socket)",
+ "get established connection"},
+ { "start", "s", do_migration_start, "online|offline" ,
+ "start the migration proccess"},
+ { "cancel", "", do_migration_cancel, "",
+ "cancel an ongoing migration procces"},
+ { "status", "", do_migration_status, "", "get migration status/progress"},
+ { "set", "A", do_migration_set, "params", "set migration parameters"},
+ { "show", "", do_migration_show, "", "show migration parameters"},
+ { "help", "s?", do_migration_help, "[subcommand]", "show help message"},
+ { NULL, NULL, },
+};
+
/*******************************************************************/
static const char *pch;