* [Qemu-devel] [PATCH 3/3] Enable migration without shared storage from the monitor
@ 2009-09-07 9:21 lirans
0 siblings, 0 replies; 3+ messages in thread
From: lirans @ 2009-09-07 9:21 UTC (permalink / raw)
To: qemu-devel
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 blk tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d blk inc tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.
diff --git a/monitor.c b/monitor.c
index 8d5165c..c8a6228 100644
--- a/monitor.c
+++ b/monitor.c
@@ -37,6 +37,7 @@
#include "readline.h"
#include "console.h"
#include "block.h"
+#include "block-migration.h"
#include "audio/audio.h"
#include "disas.h"
#include "balloon.h"
@@ -2507,6 +2508,24 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline)
goto add_str;
}
}
+
+ if (*typestr == '!') {
+ char flag[4];
+ char * cmd_flag;
+ typestr++;
+ memcpy(flag, typestr, 3);
+ typestr += 3;
+ flag[4] = '\0';
+
+ cmd_flag = strstr(p, flag);
+ if (cmd_flag != p) {
+ /* no optional string: NULL argument */
+ str = NULL;
+ goto add_str;
+ }
+
+ }
+
ret = get_str(buf, sizeof(buf), &p);
if (ret < 0) {
switch(c) {
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index dea0704..e466774 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -463,8 +463,8 @@ STEXI
Inject an NMI on the given CPU (x86 only).
ETEXI
- { "migrate", "-ds", do_migrate,
- "[-d] uri", "migrate to URI (using -d to not wait for completion)" },
+ { "migrate", "-ds!blks!incs", do_migrate,
+ "[-d] [blk] [inc] uri", "migrate to URI (using -d - to not wait \n\t\tfor completion,\n\t\t [blk] - for migration without shared storage,\n\t\t [inc] - for incremental migration if base image is identical)" },
STEXI
@item migrate [-d] @var{uri}
Migrate to @var{uri} (using -d to not wait for completion).
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 3/3] Enable migration without shared storage from the monitor
@ 2009-09-10 10:23 lirans
2009-09-10 11:29 ` Pierre Riteau
0 siblings, 1 reply; 3+ messages in thread
From: lirans @ 2009-09-10 10:23 UTC (permalink / raw)
To: qemu-devel
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 blk tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d blk inc tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.
diff --git a/monitor.c b/monitor.c
index 8d5165c..c8a6228 100644
--- a/monitor.c
+++ b/monitor.c
@@ -37,6 +37,7 @@
#include "readline.h"
#include "console.h"
#include "block.h"
+#include "block-migration.h"
#include "audio/audio.h"
#include "disas.h"
#include "balloon.h"
@@ -2507,6 +2508,24 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline)
goto add_str;
}
}
+
+ if (*typestr == '!') {
+ char flag[4];
+ char * cmd_flag;
+ typestr++;
+ memcpy(flag, typestr, 3);
+ typestr += 3;
+ flag[4] = '\0';
+
+ cmd_flag = strstr(p, flag);
+ if (cmd_flag != p) {
+ /* no optional string: NULL argument */
+ str = NULL;
+ goto add_str;
+ }
+
+ }
+
ret = get_str(buf, sizeof(buf), &p);
if (ret < 0) {
switch(c) {
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index dea0704..e466774 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -463,8 +463,8 @@ STEXI
Inject an NMI on the given CPU (x86 only).
ETEXI
- { "migrate", "-ds", do_migrate,
- "[-d] uri", "migrate to URI (using -d to not wait for completion)" },
+ { "migrate", "-ds!blks!incs", do_migrate,
+ "[-d] [blk] [inc] uri", "migrate to URI (using -d - to not wait \n\t\tfor completion,\n\t\t [blk] - for migration without shared storage,\n\t\t [inc] - for incremental migration if base image is identical)" },
STEXI
@item migrate [-d] @var{uri}
Migrate to @var{uri} (using -d to not wait for completion).
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] Enable migration without shared storage from the monitor
2009-09-10 10:23 lirans
@ 2009-09-10 11:29 ` Pierre Riteau
0 siblings, 0 replies; 3+ messages in thread
From: Pierre Riteau @ 2009-09-10 11:29 UTC (permalink / raw)
To: lirans; +Cc: qemu-devel
On 10 sept. 2009, at 12:23, lirans@il.ibm.com wrote:
> 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 blk tcp:0:4444 # for live migration with complete
> storage copy
> (qemu) migrate -d blk inc tcp:0:4444 # for live migration with
> incremental storage copy, storage is cow based.
>
> diff --git a/monitor.c b/monitor.c
> index 8d5165c..c8a6228 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -37,6 +37,7 @@
> #include "readline.h"
> #include "console.h"
> #include "block.h"
> +#include "block-migration.h"
> #include "audio/audio.h"
> #include "disas.h"
> #include "balloon.h"
> @@ -2507,6 +2508,24 @@ static void monitor_handle_command(Monitor
> *mon, const char *cmdline)
> goto add_str;
> }
> }
> +
> + if (*typestr == '!') {
> + char flag[4];
> + char * cmd_flag;
> + typestr++;
> + memcpy(flag, typestr, 3);
> + typestr += 3;
> + flag[4] = '\0';
You still have a buffer overflow here.
--
Pierre Riteau -- http://perso.univ-rennes1.fr/pierre.riteau/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-09-10 11:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-07 9:21 [Qemu-devel] [PATCH 3/3] Enable migration without shared storage from the monitor lirans
-- strict thread matches above, loose matches on Subject: below --
2009-09-10 10:23 lirans
2009-09-10 11:29 ` Pierre Riteau
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).