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

[Xen-changelog] [xen-unstable] libxl: switch generation id control to libxl_defbool.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1330604775 0
# Node ID d78d760a678d39fe2c34b4b0331d3ebe7bb6aefb
# Parent  53ea53663b48ea752905ab7b9addd2dd043852cc
libxl: switch generation id control to libxl_defbool.

This allows it to be set via the _init/_setdefault methods.

Also switch the sense of the variable in the libxl API, since once you add
defbool to the mix the double negatives become even more confusing.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
---


diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c        Thu Mar 01 12:26:15 2012 +0000
@@ -89,7 +89,6 @@
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        b_info->u.hvm.no_incr_generationid = 0;
 
         b_info->u.hvm.stdvga = 0;
         b_info->u.hvm.vnc.enable = 1;
@@ -151,6 +150,7 @@
         libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
         libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
         libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.incr_generationid,  false);
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c   Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dom.c   Thu Mar 01 12:26:15 2012 +0000
@@ -406,7 +406,7 @@
         hvm = 1;
         superpages = 1;
         pae = libxl_defbool_val(info->u.hvm.pae);
-        no_incr_generationid = info->u.hvm.no_incr_generationid;
+        no_incr_generationid = 
!libxl_defbool_val(info->u.hvm.incr_generationid);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Thu Mar 01 12:26:15 2012 +0000
@@ -267,7 +267,7 @@
                                        ("vpt_align",        libxl_defbool),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
-                                       ("no_incr_generationid", bool),
+                                       ("incr_generationid",libxl_defbool),
                                        ("nographic",        bool),
                                        ("stdvga",           bool),
                                        ("vnc",              libxl_vnc_info),
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Thu Mar 01 12:26:15 2012 +0000
@@ -1357,7 +1357,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
-    int no_incr_generationid;
+    int incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info)
@@ -1608,8 +1608,8 @@
     }
 
     if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
-        d_config.b_info.u.hvm.no_incr_generationid =
-            dom_info->no_incr_generationid;
+        libxl_defbool_set(&d_config.b_info.u.hvm.incr_generationid,
+                          dom_info->incr_generationid);
 
     if (debug || dom_info->dryrun)
         printf_info(default_output_format, -1, &d_config);
@@ -2884,7 +2884,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
-    dom_info.no_incr_generationid = 1;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
@@ -3009,6 +3009,7 @@
     dom_info.restore_file = checkpoint_file;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3394,6 +3395,7 @@
     dom_info.extra_config = extra_config;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c      Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_sxp.c      Thu Mar 01 12:26:15 2012 +0000
@@ -108,8 +108,8 @@
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
         printf("\t\t\t(nestedhvm %s)\n",
                libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
-        printf("\t\t\t(no_incr_generationid %d)\n",
-                    b_info->u.hvm.no_incr_generationid);
+        printf("\t\t\t(no_incr_generationid %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
 
         printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
         printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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