xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] xl: add option to leave domain paused after migration
@ 2016-07-19  8:58 Roger Pau Monne
  2016-07-19  9:00 ` Wei Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Roger Pau Monne @ 2016-07-19  8:58 UTC (permalink / raw)
  To: xen-devel; +Cc: wei.liu2, Ian.Jackson, Roger Pau Monne

This is useful for debugging domains that crash on resume from migration.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Ian.Jackson@eu.citrix.com
Cc: wei.liu2@citrix.com
---
Changes since v1:
 - Document the newly added option in the xl man page.
---
 docs/man/xl.pod.1         |  4 ++++
 tools/libxl/xl_cmdimpl.c  | 29 +++++++++++++++++++----------
 tools/libxl/xl_cmdtable.c |  3 ++-
 3 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
index f4dc32c..f3a2bcb 100644
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -443,6 +443,10 @@ Send <config> instead of config file from creation.
 
 Print huge (!) amount of debug during the migration process.
 
+=item B<-p>
+
+Leave the domain on the receive side paused after migration.
+
 =back
 
 =item B<remus> [I<OPTIONS>] I<domain-id> I<host>
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index d8530f0..fd80442 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -4742,7 +4742,7 @@ static void migrate_domain(uint32_t domid, const char *rune, int debug,
     exit(EXIT_FAILURE);
 }
 
-static void migrate_receive(int debug, int daemonize, int monitor,
+static void migrate_receive(int debug, int daemonize, int monitor, int pause,
                             int send_fd, int recv_fd,
                             libxl_checkpointed_stream checkpointed,
                             char *colo_proxy_script)
@@ -4850,8 +4850,10 @@ static void migrate_receive(int debug, int daemonize, int monitor,
         if (rc) goto perhaps_destroy_notify_rc;
     }
 
-    rc = libxl_domain_unpause(ctx, domid);
-    if (rc) goto perhaps_destroy_notify_rc;
+    if (!pause) {
+        rc = libxl_domain_unpause(ctx, domid);
+        if (rc) goto perhaps_destroy_notify_rc;
+    }
 
     fprintf(stderr, "migration target: Domain started successsfully.\n");
     rc = 0;
@@ -4965,7 +4967,7 @@ int main_restore(int argc, char **argv)
 
 int main_migrate_receive(int argc, char **argv)
 {
-    int debug = 0, daemonize = 1, monitor = 1;
+    int debug = 0, daemonize = 1, monitor = 1, pause = 0;
     libxl_checkpointed_stream checkpointed = LIBXL_CHECKPOINTED_STREAM_NONE;
     int opt;
     char *script = NULL;
@@ -4976,7 +4978,7 @@ int main_migrate_receive(int argc, char **argv)
         COMMON_LONG_OPTS
     };
 
-    SWITCH_FOREACH_OPT(opt, "Fedr", opts, "migrate-receive", 0) {
+    SWITCH_FOREACH_OPT(opt, "Fedrp", opts, "migrate-receive", 0) {
     case 'F':
         daemonize = 0;
         break;
@@ -4996,13 +4998,16 @@ int main_migrate_receive(int argc, char **argv)
     case 0x200:
         script = optarg;
         break;
+    case 'p':
+        pause = 1;
+        break;
     }
 
     if (argc-optind != 0) {
         help("migrate-receive");
         return EXIT_FAILURE;
     }
-    migrate_receive(debug, daemonize, monitor,
+    migrate_receive(debug, daemonize, monitor, pause,
                     STDOUT_FILENO, STDIN_FILENO,
                     checkpointed, script);
 
@@ -5048,14 +5053,14 @@ int main_migrate(int argc, char **argv)
     const char *ssh_command = "ssh";
     char *rune = NULL;
     char *host;
-    int opt, daemonize = 1, monitor = 1, debug = 0;
+    int opt, daemonize = 1, monitor = 1, debug = 0, pause = 0;
     static struct option opts[] = {
         {"debug", 0, 0, 0x100},
         {"live", 0, 0, 0x200},
         COMMON_LONG_OPTS
     };
 
-    SWITCH_FOREACH_OPT(opt, "FC:s:e", opts, "migrate", 2) {
+    SWITCH_FOREACH_OPT(opt, "FC:s:ep", opts, "migrate", 2) {
     case 'C':
         config_filename = optarg;
         break;
@@ -5069,6 +5074,9 @@ int main_migrate(int argc, char **argv)
         daemonize = 0;
         monitor = 0;
         break;
+    case 'p':
+        pause = 1;
+        break;
     case 0x100: /* --debug */
         debug = 1;
         break;
@@ -5096,12 +5104,13 @@ int main_migrate(int argc, char **argv)
         } else {
             verbose_len = (minmsglevel_default - minmsglevel) + 2;
         }
-        xasprintf(&rune, "exec %s %s xl%s%.*s migrate-receive%s%s",
+        xasprintf(&rune, "exec %s %s xl%s%.*s migrate-receive%s%s%s",
                   ssh_command, host,
                   pass_tty_arg ? " -t" : "",
                   verbose_len, verbose_buf,
                   daemonize ? "" : " -e",
-                  debug ? " -d" : "");
+                  debug ? " -d" : "",
+                  pause ? " -p" : "");
     }
 
     migrate_domain(domid, rune, debug, config_filename);
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index bf69ffb..85c1e0f 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -164,7 +164,8 @@ struct cmd_spec cmd_table[] = {
       "                migrate-receive [-d -e]\n"
       "-e              Do not wait in the background (on <host>) for the death\n"
       "                of the domain.\n"
-      "--debug         Print huge (!) amount of debug during the migration process."
+      "--debug         Print huge (!) amount of debug during the migration process.\n"
+      "-p              Do not unpause domain after migrating it."
     },
     { "restore",
       &main_restore, 0, 1,
-- 
2.7.4 (Apple Git-66)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xl: add option to leave domain paused after migration
  2016-07-19  8:58 [PATCH v2] xl: add option to leave domain paused after migration Roger Pau Monne
@ 2016-07-19  9:00 ` Wei Liu
  2016-07-19 13:15 ` Wei Liu
  2016-07-19 20:43 ` Boris Ostrovsky
  2 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2016-07-19  9:00 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel, Ian.Jackson, wei.liu2

On Tue, Jul 19, 2016 at 10:58:15AM +0200, Roger Pau Monne wrote:
> This is useful for debugging domains that crash on resume from migration.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xl: add option to leave domain paused after migration
  2016-07-19  8:58 [PATCH v2] xl: add option to leave domain paused after migration Roger Pau Monne
  2016-07-19  9:00 ` Wei Liu
@ 2016-07-19 13:15 ` Wei Liu
  2016-07-19 15:50   ` Roger Pau Monne
  2016-07-19 20:43 ` Boris Ostrovsky
  2 siblings, 1 reply; 6+ messages in thread
From: Wei Liu @ 2016-07-19 13:15 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel, Ian.Jackson, wei.liu2

On Tue, Jul 19, 2016 at 10:58:15AM +0200, Roger Pau Monne wrote:
> This is useful for debugging domains that crash on resume from migration.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Ian.Jackson@eu.citrix.com
> Cc: wei.liu2@citrix.com
> ---
> Changes since v1:
>  - Document the newly added option in the xl man page.
> ---
>  docs/man/xl.pod.1         |  4 ++++
>  tools/libxl/xl_cmdimpl.c  | 29 +++++++++++++++++++----------
>  tools/libxl/xl_cmdtable.c |  3 ++-
>  3 files changed, 25 insertions(+), 11 deletions(-)
> 
> diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
> index f4dc32c..f3a2bcb 100644
> --- a/docs/man/xl.pod.1
> +++ b/docs/man/xl.pod.1

Actually you should patch xl.pod.1.in.

No need to resend. I've fixed it up for you.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xl: add option to leave domain paused after migration
  2016-07-19 13:15 ` Wei Liu
@ 2016-07-19 15:50   ` Roger Pau Monne
  2016-07-19 15:51     ` Wei Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Roger Pau Monne @ 2016-07-19 15:50 UTC (permalink / raw)
  To: Wei Liu; +Cc: xen-devel, Ian.Jackson

On Tue, Jul 19, 2016 at 02:15:28PM +0100, Wei Liu wrote:
> On Tue, Jul 19, 2016 at 10:58:15AM +0200, Roger Pau Monne wrote:
> > This is useful for debugging domains that crash on resume from migration.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Cc: Ian.Jackson@eu.citrix.com
> > Cc: wei.liu2@citrix.com
> > ---
> > Changes since v1:
> >  - Document the newly added option in the xl man page.
> > ---
> >  docs/man/xl.pod.1         |  4 ++++
> >  tools/libxl/xl_cmdimpl.c  | 29 +++++++++++++++++++----------
> >  tools/libxl/xl_cmdtable.c |  3 ++-
> >  3 files changed, 25 insertions(+), 11 deletions(-)
> > 
> > diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
> > index f4dc32c..f3a2bcb 100644
> > --- a/docs/man/xl.pod.1
> > +++ b/docs/man/xl.pod.1
> 
> Actually you should patch xl.pod.1.in.
> 
> No need to resend. I've fixed it up for you.

Oh, I don't remember there being a ".in" version of the man page in the 
past, sorry. Thanks for fixing it up.

Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xl: add option to leave domain paused after migration
  2016-07-19 15:50   ` Roger Pau Monne
@ 2016-07-19 15:51     ` Wei Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Liu @ 2016-07-19 15:51 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel, Wei Liu, Ian.Jackson

On Tue, Jul 19, 2016 at 05:50:32PM +0200, Roger Pau Monne wrote:
> On Tue, Jul 19, 2016 at 02:15:28PM +0100, Wei Liu wrote:
> > On Tue, Jul 19, 2016 at 10:58:15AM +0200, Roger Pau Monne wrote:
> > > This is useful for debugging domains that crash on resume from migration.
> > > 
> > > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > > ---
> > > Cc: Ian.Jackson@eu.citrix.com
> > > Cc: wei.liu2@citrix.com
> > > ---
> > > Changes since v1:
> > >  - Document the newly added option in the xl man page.
> > > ---
> > >  docs/man/xl.pod.1         |  4 ++++
> > >  tools/libxl/xl_cmdimpl.c  | 29 +++++++++++++++++++----------
> > >  tools/libxl/xl_cmdtable.c |  3 ++-
> > >  3 files changed, 25 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/docs/man/xl.pod.1 b/docs/man/xl.pod.1
> > > index f4dc32c..f3a2bcb 100644
> > > --- a/docs/man/xl.pod.1
> > > +++ b/docs/man/xl.pod.1
> > 
> > Actually you should patch xl.pod.1.in.
> > 
> > No need to resend. I've fixed it up for you.
> 
> Oh, I don't remember there being a ".in" version of the man page in the 
> past, sorry. Thanks for fixing it up.
> 

It was introduced recently by me. I wouldn't be surprised if people
aren't aware of its existence.

Wei.

> Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] xl: add option to leave domain paused after migration
  2016-07-19  8:58 [PATCH v2] xl: add option to leave domain paused after migration Roger Pau Monne
  2016-07-19  9:00 ` Wei Liu
  2016-07-19 13:15 ` Wei Liu
@ 2016-07-19 20:43 ` Boris Ostrovsky
  2 siblings, 0 replies; 6+ messages in thread
From: Boris Ostrovsky @ 2016-07-19 20:43 UTC (permalink / raw)
  To: Roger Pau Monne, xen-devel; +Cc: Ian.Jackson, wei.liu2

On 07/19/2016 04:58 AM, Roger Pau Monne wrote:
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index d8530f0..fd80442 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -4742,7 +4742,7 @@ static void migrate_domain(uint32_t domid, const char *rune, int debug,
>      exit(EXIT_FAILURE);
>  }
>  
> -static void migrate_receive(int debug, int daemonize, int monitor,
> +static void migrate_receive(int debug, int daemonize, int monitor, int pause,

This causes a name shadowing error on an old compiler:

cc1: warnings being treated as errors
xl_cmdimpl.c: In function ‘migrate_receive’:
xl_cmdimpl.c:4781: error: declaration of ‘pause’ shadows a global
declaration
/usr/include/unistd.h:466: error: shadowed declaration is here
xl_cmdimpl.c: In function ‘main_migrate_receive’:
xl_cmdimpl.c:5008: error: declaration of ‘pause’ shadows a global
declaration
/usr/include/unistd.h:466: error: shadowed declaration is here
xl_cmdimpl.c: In function ‘main_migrate’:
xl_cmdimpl.c:5094: error: declaration of ‘pause’ shadows a global
declaration
/usr/include/unistd.h:466: error: shadowed declaration is here
make: *** [xl_cmdimpl.o] Error 1

FC-64 <build@build-mk2:~/xtt-x86_64/bootstrap/xen/tools/libxl> gcc
--version | head -1
gcc (GCC) 4.4.4 20100503 (Red Hat 4.4.4-2)
FC-64 <build@build-mk2:~/xtt-x86_64/bootstrap/xen/tools/libxl> grep
pause /usr/include/unistd.h
extern int pause (void);
FC-64 <build@build-mk2:~/xtt-x86_64/bootstrap/xen/tools/libxl>



-boris


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-19 20:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19  8:58 [PATCH v2] xl: add option to leave domain paused after migration Roger Pau Monne
2016-07-19  9:00 ` Wei Liu
2016-07-19 13:15 ` Wei Liu
2016-07-19 15:50   ` Roger Pau Monne
2016-07-19 15:51     ` Wei Liu
2016-07-19 20:43 ` Boris Ostrovsky

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).