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

Re: [MirageOS-devel] Timestamp representation and CLOCK





On Thu, Jul 9, 2015 at 3:26 PM, Anil Madhavapeddy <anil@xxxxxxxxxx> wrote:

> On 9 Jul 2015, at 14:47, Daniel BÃnzli <daniel.buenzli@xxxxxxxxxxxx> wrote:
>
>
> module type CLOCK = sig
>
>Â val now_s : unit -> int64 * int
>Â (** [now_s ()] is [(s, ns)] the operating system's POSIX timestamp
>Â Â Â for the current time understood as the number of seconds [s] +
>Â Â Â 1e-9 * [ns] from the epoch 1970-01-01 00:00:00 UTC. [ns] ranges
>Â Â Â from [0] to [999_999_999]. *)
>
>Â val current_tz_offset_s : unit -> int
>Â (** [current_tz_offset_s ()] is the operating system's current local
>Â Â Â time zone offset to UTC in seconds. *)
> end
>
>
> Would people agree on such an API and change for the next major release of mirage ? If so, I'd be willing to actually delve into the various repos to make that happen.

I think such an API would work (aside from the efficiency queries that
David Sheets raised). The lack of `float` in the type is a huge win for
embedding this as a kernel module or other constrained environment.

I'm just wondering whether `current_tz_offset_s` needs to be potentially
blocking or not. Dave, is the timezone read from Xenstore at all via the
Xen tools at the moment, or is it set independently per VM (with just the
wallclock time shared)?

I don't think Xen shares any timezone information with VMs -- the VMs (and dom0) can be in any timezones they like. Considering that VMs can be migrated across timezones while they're running, it's probably easier for the VM admin to choose one timezone (the timezone of the admin?) rather than the timezone of the current hardware.

Cheers,
Dave
Â

-anil


_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel



--
Dave Scott
_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.