From: lirans@il.ibm.com
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/3 v3] Enable migration without shared storage from the monitor
Date: Thu, 17 Sep 2009 16:24:05 +0300 [thread overview]
Message-ID: <12531938451504-git-send-email-lirans@il.ibm.com> (raw)
This patch adds the option to activate non-shared storage migration from the
monitor.
The migration command is as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration
(qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d -i tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.
diff --git a/monitor.c b/monitor.c
index 18bcc92..40cdd74 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2582,6 +2582,18 @@ static int default_fmt_size = 4;
#define MAX_ARGS 16
+static int is_valid_option(const char *c, const char *typestr)
+{
+ char option[3];
+
+ option[0] = '-';
+ option[1] = *c;
+ option[2] = '\0';
+
+ typestr = strstr(typestr, option);
+ return (typestr != NULL);
+}
+
static const mon_cmd_t *monitor_parse_command(Monitor *mon,
const char *cmdline,
QDict *qdict)
@@ -2774,8 +2786,9 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
break;
case '-':
{
- int has_option;
- /* option */
+ const char *tmp = p;
+ int has_option, skip_key = 0;
+ /* option */
c = *typestr++;
if (c == '\0')
@@ -2785,15 +2798,24 @@ static const mon_cmd_t *monitor_parse_command(Monitor *mon,
has_option = 0;
if (*p == '-') {
p++;
- if (*p != c) {
- monitor_printf(mon, "%s: unsupported option -%c\n",
+ if(c != *p) {
+ if(!is_valid_option(p, typestr)) {
+
+ monitor_printf(mon, "%s: unsupported option -%c\n",
cmdname, *p);
- goto fail;
+ goto fail;
+ } else {
+ skip_key = 1;
+ }
}
- p++;
- has_option = 1;
+ if(skip_key) {
+ p = tmp;
+ } else {
+ p++;
+ has_option = 1;
+ }
}
- qdict_put(qdict, key, qint_from_int(has_option));
+ qdict_put(qdict, key, qint_from_int(has_option));
}
break;
default:
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 9f91873..44fcad3 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -466,11 +466,13 @@ STEXI
Inject an NMI on the given CPU (x86 only).
ETEXI
- { "migrate", "detach:-d,uri:s", do_migrate,
- "[-d] uri", "migrate to URI (using -d to not wait for completion)" },
+ { "migrate", "detach:-d,blk:-b,inc:-i,uri:s", do_migrate,
+ "[-d] [-b] [-i] uri", "migrate to URI (using -d to not wait for completion)\n\t\t\t -b for migration without shared storage with full copy of disk\n\t\t\t -i for migration without shared storage with incremental copy of disk (base image shared between src and destination)" },
STEXI
@item migrate [-d] @var{uri}
Migrate to @var{uri} (using -d to not wait for completion).
+ -b for migration with full copy of disk
+ -i for migration with incremental copy of disk (base image is shared)
ETEXI
{ "migrate_cancel", "", do_migrate_cancel,
reply other threads:[~2009-09-17 12:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=12531938451504-git-send-email-lirans@il.ibm.com \
--to=lirans@il.ibm.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).