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

Re: [Xen-devel] backport requests for 4.x-testing



On Wed, Apr 4, 2012 at 12:58 AM, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> wrote:
> Teck Choon Giam writes ("Re: [Xen-devel] backport requests for 4.x-testing"):
>> On Tue, Apr 3, 2012 at 11:08 PM, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> 
>> wrote:
>> > I'm not really convinced that these are appropriate for backporting to
>> > a supposedly stable tree.
>>
>> What about the changeset 25131:6f81f4d79fde?  It 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.  You'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 <giamteckchoon@xxxxxxxxx>

---
 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 = 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 = (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 = l;

+    b_info->rtc_timeoffset = !xlu_cfg_get_long(config,
"rtc_timeoffset", &l) ? l : 0;
+
+    b_info->localtime = !xlu_cfg_get_long(config, "localtime", &l) ? l : 0;
+    if (b_info->localtime) {
+        time_t t;
+        struct tm *tm;
+
+        t = time(NULL);
+        tm = localtime(&t);
+
+        b_info->rtc_timeoffset += tm->tm_gmtoff;
+    }
+
     if (!xlu_cfg_get_long (config, "videoram", &l))
         b_info->video_memkb = l * 1024;



>
> Thanks,
> Ian.

Thanks.

Kindest regards,
Giam Teck Choon

_______________________________________________
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®.