[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v3] libxl: pass debug flag down to libxl_domain_suspend


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Olaf Hering <olaf@xxxxxxxxx>
  • Date: Tue, 05 Feb 2013 15:20:56 +0100
  • Delivery-date: Tue, 05 Feb 2013 14:21:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1360073994 -3600
# Node ID e2b8970eb702b5151a81c9c5fbbf2e2da7836fd6
# Parent  9ce7648327cdbcd7a24052d6f0e85378627988db
libxl: pass debug flag down to libxl_domain_suspend

libxl_domain_suspend is already prepared to handle LIBXL_SUSPEND_DEBUG,
and xl migrate handles the -d switch as well. Pass this flag down to
libxl_domain_suspend, so that finally xc_domain_save can dump huge
amount of debug data to stdout.
Update xl.1 and help text output.

v3:
 - require 3 -d options to really enable it

v2:
 - fix xl.1 option, really use -d instead of -e

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r 9ce7648327cd -r e2b8970eb702 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1
+++ b/docs/man/xl.pod.1
@@ -387,6 +387,11 @@ domain. See the corresponding option of 
 
 Send <config> instead of config file from creation.
 
+=item B<-d>
+
+Print huge (!) amount of debug during the migration process.
+This option has to be specfied three times to really enable it.
+
 =back
 
 =item B<remus> [I<OPTIONS>] I<domain-id> I<host>
diff -r 9ce7648327cd -r e2b8970eb702 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3331,7 +3331,7 @@ static void migrate_do_preamble(int send
 
 }
 
-static void migrate_domain(uint32_t domid, const char *rune,
+static void migrate_domain(uint32_t domid, const char *rune, int debug,
                            const char *override_config_file)
 {
     pid_t child = -1;
@@ -3340,7 +3340,7 @@ static void migrate_domain(uint32_t domi
     char *away_domname;
     char rc_buf;
     uint8_t *config_data;
-    int config_len;
+    int config_len, flags = LIBXL_SUSPEND_LIVE;
 
     save_domain_core_begin(domid, override_config_file,
                            &config_data, &config_len);
@@ -3358,7 +3358,9 @@ static void migrate_domain(uint32_t domi
 
     xtl_stdiostream_adjust_flags(logger, XTL_STDIOSTREAM_HIDE_PROGRESS, 0);
 
-    rc = libxl_domain_suspend(ctx, domid, send_fd, LIBXL_SUSPEND_LIVE, NULL);
+    if (debug)
+        flags |= LIBXL_SUSPEND_DEBUG;
+    rc = libxl_domain_suspend(ctx, domid, send_fd, flags, NULL);
     if (rc) {
         fprintf(stderr, "migration sender: libxl_domain_suspend failed"
                 " (rc=%d)\n", rc);
@@ -3767,7 +3769,7 @@ int main_migrate(int argc, char **argv)
         monitor = 0;
         break;
     case 'd':
-        debug = 1;
+        debug++;
         break;
     }
 
@@ -3784,7 +3786,7 @@ int main_migrate(int argc, char **argv)
             return 1;
     }
 
-    migrate_domain(domid, rune, config_filename);
+    migrate_domain(domid, rune, debug >= 3, config_filename);
     return 0;
 }
 
diff -r 9ce7648327cd -r e2b8970eb702 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -153,7 +153,8 @@ struct cmd_spec cmd_table[] = {
       "                to sh. If empty, run <host> instead of ssh <host> xl\n"
       "                migrate-receive [-d -e]\n"
       "-e              Do not wait in the background (on <host>) for the 
death\n"
-      "                of the domain."
+      "                of the domain.\n"
+      "-d -d -d        Print huge (!) amount of debug during the migration 
process."
     },
     { "dump-core",
       &main_dump_core, 0, 1,

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.