[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libxl: support for "rtc_timeoffset" and "localtime"
# HG changeset patch # User Lin Ming <mlin@xxxxxxxxxxxxx> # Date 1333384359 -3600 # Node ID 6f81f4d79fde3fe95a67545267567cd825169ce8 # Parent 86f9fd67152ba4c5bb3870f9b95ae304809eab86 libxl: support for "rtc_timeoffset" and "localtime" Implement "rtc_timeoffset" and "localtime" options compatible as xm. rtc_timeoffset is the offset between host time and guest time. localtime means to specify whether the emulted RTC appears as UTC or is offset by the host. Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Signed-off-by: Lin Ming <mlin@xxxxxxxxxxxxx> Committed-by: Ian Jackson <ian.jackson.citrix.com> --- diff -r 86f9fd67152b -r 6f81f4d79fde docs/man/xl.cfg.pod.5 --- a/docs/man/xl.cfg.pod.5 Mon Apr 02 17:22:31 2012 +0100 +++ b/docs/man/xl.cfg.pod.5 Mon Apr 02 17:32:39 2012 +0100 @@ -558,6 +558,14 @@ frequency changes. Please see F<docs/misc/tscmode.txt> for more information on this option. +=item B<localtime=BOOLEAN> + +Set the real time clock to local time or to UTC. 0 by default, i.e. set to UTC. + +=item B<rtc_timeoffset=SECONDS> + +Set the real time clock offset in seconds. 0 by default. + =head3 Support for Paravirtualisation of HVM Guests The following options allow Paravirtualised features (such as devices) diff -r 86f9fd67152b -r 6f81f4d79fde tools/libxl/libxl_create.c --- a/tools/libxl/libxl_create.c Mon Apr 02 17:22:31 2012 +0100 +++ b/tools/libxl/libxl_create.c Mon Apr 02 17:32:39 2012 +0100 @@ -124,6 +124,17 @@ int libxl__domain_build_info_setdefault( if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT) b_info->target_memkb = b_info->max_memkb; + libxl_defbool_setdefault(&b_info->localtime, false); + if (libxl_defbool_val(b_info->localtime)) { + time_t t; + struct tm *tm; + + t = time(NULL); + tm = localtime(&t); + + b_info->rtc_timeoffset += tm->tm_gmtoff; + } + libxl_defbool_setdefault(&b_info->disable_migrate, false); switch (b_info->type) { diff -r 86f9fd67152b -r 6f81f4d79fde tools/libxl/libxl_dom.c --- a/tools/libxl/libxl_dom.c Mon Apr 02 17:22:31 2012 +0100 +++ b/tools/libxl/libxl_dom.c Mon Apr 02 17:32:39 2012 +0100 @@ -91,6 +91,9 @@ int libxl__build_pre(libxl__gc *gc, uint if (libxl_defbool_val(info->disable_migrate)) xc_domain_disable_migrate(ctx->xch, domid); + if (info->rtc_timeoffset) + xc_domain_set_time_offset(ctx->xch, domid, info->rtc_timeoffset); + if (info->type == LIBXL_DOMAIN_TYPE_HVM) { unsigned long shadow; shadow = (info->shadow_memkb + 1023) / 1024; diff -r 86f9fd67152b -r 6f81f4d79fde tools/libxl/libxl_types.idl --- a/tools/libxl/libxl_types.idl Mon Apr 02 17:22:31 2012 +0100 +++ b/tools/libxl/libxl_types.idl Mon Apr 02 17:32:39 2012 +0100 @@ -238,6 +238,8 @@ libxl_domain_build_info = Struct("domain ("target_memkb", MemKB), ("video_memkb", MemKB), ("shadow_memkb", MemKB), + ("rtc_timeoffset", uint32), + ("localtime", libxl_defbool), ("disable_migrate", libxl_defbool), ("cpuid", libxl_cpuid_policy_list), diff -r 86f9fd67152b -r 6f81f4d79fde tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Mon Apr 02 17:22:31 2012 +0100 +++ b/tools/libxl/xl_cmdimpl.c Mon Apr 02 17:32:39 2012 +0100 @@ -697,6 +697,11 @@ static void parse_config_data(const char } } + if (!xlu_cfg_get_long(config, "rtc_timeoffset", &l, 0)) + b_info->rtc_timeoffset = l; + + xlu_cfg_get_defbool(config, "localtime", &b_info->localtime, 0); + if (!xlu_cfg_get_long (config, "videoram", &l, 0)) b_info->video_memkb = l * 1024; _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |