From mboxrd@z Thu Jan 1 00:00:00 1970 From: Teck Choon Giam Subject: Re: backport requests for 4.x-testing Date: Wed, 4 Apr 2012 03:50:49 +0800 Message-ID: References: <4F55F15F02000078000769AC@nat28.tlf.novell.com> <4F55EF2D.7010302@citrix.com> <20120324172757.GA29504@phenom.dumpdata.com> <20347.4694.131348.751694@mariner.uk.xensource.com> <20347.11328.121224.686159@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20347.11328.121224.686159@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Andrew Cooper , "keir.xen@gmail.com" , "xen-devel@lists.xen.org" , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Wed, Apr 4, 2012 at 12:58 AM, Ian Jackson wr= ote: > Teck Choon Giam writes ("Re: [Xen-devel] backport requests for 4.x-testin= g"): >> On Tue, Apr 3, 2012 at 11:08 PM, Ian Jackson = wrote: >> > I'm not really convinced that these are appropriate for backporting to >> > a supposedly stable tree. >> >> What about the changeset 25131:6f81f4d79fde? =A0It won't be able to >> apply cleanly in xen-4.1-testing though and I can provide the backport >> version for review if you give an OK? > > I would be happy to consider a backport of 25131, yes. =A0You'll have to > do some work as 4.1 doesn't have libxl_defbool_*. Not just libxl_defbool_* but also couple others :p Anyway, here is my backport which I have tested and worked as described in http://lists.xen.org/archives/html/xen-devel/2012-03/msg01452.= html For your review and comments please. 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. xen-unstable changeset: 25131:6f81f4d79fde Signed-off-by: Giam Teck Choon --- tools/libxl/libxl.idl | 2 ++ tools/libxl/libxl_dom.c | 3 +++ tools/libxl/xl_cmdimpl.c | 13 +++++++++++++ 3 files changed, 18 insertions(+), 0 deletions(-) diff --git a/tools/libxl/libxl.idl b/tools/libxl/libxl.idl index 377417a..3193506 100644 --- a/tools/libxl/libxl.idl +++ b/tools/libxl/libxl.idl @@ -94,6 +94,8 @@ libxl_domain_build_info =3D Struct("domain_build_info",[ ("target_memkb", uint32), ("video_memkb", uint32), ("shadow_memkb", uint32), + ("rtc_timeoffset", uint32), + ("localtime", bool), ("disable_migrate", bool), ("kernel", libxl_file_reference), ("cpuid", libxl_cpuid_policy_list), diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index c702cf7..7ab78db 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -76,6 +76,9 @@ int libxl__build_pre(libxl_ctx *ctx, uint32_t domid, if ( 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->hvm) { unsigned long shadow; shadow =3D (info->shadow_memkb + 1023) / 1024; diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 2dbced7..74545a5 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -737,6 +737,19 @@ static void parse_config_data(const char *configfile_filename_report, if (!xlu_cfg_get_long(config, "tsc_mode", &l)) b_info->tsc_mode =3D l; + b_info->rtc_timeoffset =3D !xlu_cfg_get_long(config, "rtc_timeoffset", &l) ? l : 0; + + b_info->localtime =3D !xlu_cfg_get_long(config, "localtime", &l) ? l := 0; + if (b_info->localtime) { + time_t t; + struct tm *tm; + + t =3D time(NULL); + tm =3D localtime(&t); + + b_info->rtc_timeoffset +=3D tm->tm_gmtoff; + } + if (!xlu_cfg_get_long (config, "videoram", &l)) b_info->video_memkb =3D l * 1024; > > Thanks, > Ian. Thanks. Kindest regards, Giam Teck Choon