qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for


From: Marcelo Tosatti
Subject: Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for <clock offset='variable' basis='utc'/>
Date: Thu, 29 May 2014 15:51:15 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 23, 2014 at 11:36:56PM +0200, Paolo Bonzini wrote:
> You can get the current time via the qom-get command, and then
> follow the same algorithm as QEMU:
> 
>     time_t seconds;
> 
>     if (rtc_date_offset == -1) {
>         if (rtc_utc) {
>             seconds = mktimegm(tm);
>         } else {
>             struct tm tmp = *tm;
>             tmp.tm_isdst = -1; /* use timezone to figure it out */
>             seconds = mktime(&tmp);
>         }
>     } else {
>         seconds = mktimegm(tm) + rtc_date_offset;
>     }
>     return seconds - time(NULL);
> 
> Unfortunately the QOM path to the RTC device is not stable.  We can
> add a /machine/rtc link, and if the PPC guys implement the link and
> current-time property as well, the same mechanism can work for any
> board.
> 
> Paolo

I like that idea. Questions:

- What guarantees are there that the interface is stable?
(you can argue that "now it is").

- Perhaps add /machine/stable/ path to contain stable
links ?

- How do i go about adding a link to a device again?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]