All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <srostedt@redhat.com>
To: Keir Fraser <keir@xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Have xen dom0 still handle time of 1970
Date: Wed, 17 Jan 2007 11:30:56 -0500	[thread overview]
Message-ID: <45AE4F40.6060205@redhat.com> (raw)
In-Reply-To: <C1D3FC41.7C28%keir@xensource.com>

Keir Fraser wrote:
> On 17/1/07 15:50, "Steven Rostedt" <srostedt@redhat.com> wrote:
> 
>> Here's what you get without the patch:
>>
>> # date -u 010100011970
>> Thu Jan  1 00:01:00 UTC 1970
>> # date
>> Mon Feb 22 16:42:30 EST 2010
>>
>> Here's what you get with the patch:
>>
>> # date -u 010100011970
>> Thu Jan  1 00:01:00 UTC 1970
>> # date
>> Wed Dec 31 19:01:01 EST 1969
> 
> The Xen interface is defined relative to UTC, not local time zone, so
> negative numbers shuld not be involved if you are setting a time value after
> the epoch (which you are). Perhaps our assumption that xtime is a UTC
> variable is broken? If that's the case, is there a way to translate between
> local time zone and UTC inside the kernel? If not we have a bit of a problem
> since it really makes sense for Xen to work in UTC and let each guest apply
> its own time-zone transformation.
> 

It doesn't matter about the TZ. If I do this on a machine that has been 
running xen for more than a day, it will still fail with setting date to

date -u 010123001970

Which is not effected by the TZ (the result is after EPOCH).

The problem is that the calculation uses the uptime and compares that 
with the given time past EPOCH (using UTC).  So if that time is less 
than uptime, it will fail the time conversion.

Have a box with Xen running more than a day? (I currently don't), and if 
you do, try the above date command. You'll see what I'm talking about.

The example is bad, but I didn't have a machine to show that has been 
running a Xen kernel for more than an hour or two.

-- Steve

  reply	other threads:[~2007-01-17 16:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-17 15:50 [PATCH] Have xen dom0 still handle time of 1970 Steven Rostedt
2007-01-17 16:16 ` Keir Fraser
2007-01-17 16:30   ` Steven Rostedt [this message]
2007-01-17 17:26     ` Keir Fraser
2007-01-17 17:36       ` Rik van Riel
2007-01-17 17:44         ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45AE4F40.6060205@redhat.com \
    --to=srostedt@redhat.com \
    --cc=keir@xensource.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.