[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 19 of 26 V3] libxl: switch generation id control to libxl_defbool
# HG changeset patch # User Ian Campbell <ian.campbell@xxxxxxxxxx> # Date 1330000277 0 # Node ID 7d012628126b838fcd19a9b65d141410d15705c8 # Parent 141ed25af0d954e270e3bca9f482efb4070abf0d 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 141ed25af0d9 -r 7d012628126b tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Thu Feb 23 12:31:17 2012 +0000 +++ b/tools/libxl/libxl_create.c Thu Feb 23 12:31:17 2012 +0000 @@ -88,7 +88,6 @@ void libxl_domain_build_info_init(libxl_ case LIBXL_DOMAIN_TYPE_HVM: b_info->u.hvm.firmware = NULL; 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; @@ -150,6 +149,7 @@ int libxl__domain_build_info_setdefault( 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 141ed25af0d9 -r 7d012628126b tools/libxl/libxl_dom.c --- a/tools/libxl/libxl_dom.c Thu Feb 23 12:31:17 2012 +0000 +++ b/tools/libxl/libxl_dom.c Thu Feb 23 12:31:17 2012 +0000 @@ -406,7 +406,7 @@ int libxl__domain_restore_common(libxl__ 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 141ed25af0d9 -r 7d012628126b tools/libxl/libxl_types.idl --- a/tools/libxl/libxl_types.idl Thu Feb 23 12:31:17 2012 +0000 +++ b/tools/libxl/libxl_types.idl Thu Feb 23 12:31:17 2012 +0000 @@ -260,7 +260,7 @@ libxl_domain_build_info = Struct("domain ("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 141ed25af0d9 -r 7d012628126b tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Thu Feb 23 12:31:17 2012 +0000 +++ b/tools/libxl/xl_cmdimpl.c Thu Feb 23 12:31:17 2012 +0000 @@ -1352,7 +1352,7 @@ struct domain_create { 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) @@ -1603,8 +1603,8 @@ static int create_domain(struct domain_c } 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); @@ -2879,7 +2879,7 @@ static void migrate_receive(int debug, i 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) { @@ -3004,6 +3004,7 @@ int main_restore(int argc, char **argv) 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) @@ -3389,6 +3390,7 @@ int main_create(int argc, char **argv) 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 141ed25af0d9 -r 7d012628126b tools/libxl/xl_sxp.c --- a/tools/libxl/xl_sxp.c Thu Feb 23 12:31:17 2012 +0000 +++ b/tools/libxl/xl_sxp.c Thu Feb 23 12:31:17 2012 +0000 @@ -108,8 +108,8 @@ void printf_info_sexp(int domid, libxl_d 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-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |