Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-29 Thread Marcelo Tosatti
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

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Laine Stump
On 05/23/2014 06:50 AM, Marcelo Tosatti wrote: On Thu, May 22, 2014 at 01:33:14PM -0600, Eric Blake wrote: [Adding qemu] On 05/22/2014 05:07 AM, Laine Stump wrote: commit e31b5cf393857 attempted to fix libvirt's VIR_DOMAIN_EVENT_ID_RTC_CHANGE, which is documentated to always

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Laine Stump
On 05/23/2014 12:17 PM, Laine Stump wrote: *However*, this discussion forced me to investigate some of the basic assumptions that I'd been making when coming in to fix this bug. In particular, my assumption was that the value of adjustment that was set in the status would be preserved across a

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Luiz Capitulino
On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the guest triggers an RTC update, so qemu sends an event, but the event is lost. Then libvirtd starts again, and doesn't realize the event is lost. Yes, but that case is also true for any other QMP

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Markus Armbruster
Luiz Capitulino lcapitul...@redhat.com writes: On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the guest triggers an RTC update, so qemu sends an event, but the event is lost. Then libvirtd starts again, and doesn't realize the event is lost. Yes,

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Marcelo Tosatti
On Fri, May 23, 2014 at 03:35:19PM +0200, Markus Armbruster wrote: Luiz Capitulino lcapitul...@redhat.com writes: On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the guest triggers an RTC update, so qemu sends an event, but the event is lost. Then

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Luiz Capitulino
On Fri, 23 May 2014 10:48:18 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: On Fri, May 23, 2014 at 03:35:19PM +0200, Markus Armbruster wrote: Luiz Capitulino lcapitul...@redhat.com writes: On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Marcelo Tosatti
On Fri, May 23, 2014 at 10:48:18AM -0300, Marcelo Tosatti wrote: On Fri, May 23, 2014 at 03:35:19PM +0200, Markus Armbruster wrote: Luiz Capitulino lcapitul...@redhat.com writes: On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the guest

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Daniel P. Berrange
On Fri, May 23, 2014 at 10:48:18AM -0300, Marcelo Tosatti wrote: On Fri, May 23, 2014 at 03:35:19PM +0200, Markus Armbruster wrote: Luiz Capitulino lcapitul...@redhat.com writes: On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the guest

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Eric Blake
On 05/23/2014 07:48 AM, Marcelo Tosatti wrote: This also seems pretty harmful wrt losing events: /* Global, one-time initializer to configure the rate limiting * and initialize state */ static void monitor_protocol_event_init(void) { /* Limit RTC BALLOON events to 1 per second */

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Eric Blake
On 05/23/2014 04:19 AM, Laine Stump wrote: On 05/23/2014 12:17 PM, Laine Stump wrote: *However*, this discussion forced me to investigate some of the basic assumptions that I'd been making when coming in to fix this bug. In particular, my assumption was that the value of adjustment that was

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Marcelo Tosatti
On Fri, May 23, 2014 at 08:54:54AM -0600, Eric Blake wrote: On 05/23/2014 04:19 AM, Laine Stump wrote: On 05/23/2014 12:17 PM, Laine Stump wrote: *However*, this discussion forced me to investigate some of the basic assumptions that I'd been making when coming in to fix this bug. In

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Eric Blake
On 05/23/2014 08:54 AM, Eric Blake wrote: For this to work, a persistent guest definition needs to record the offset that was in use at the time the guest powered off, and the next time qemu is started, pass _that_ offset as the command-line offset against UTC. In libvirt's case, we

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Laine Stump
On 05/23/2014 05:54 PM, Eric Blake wrote: On 05/23/2014 04:19 AM, Laine Stump wrote: On 05/23/2014 12:17 PM, Laine Stump wrote: *However*, this discussion forced me to investigate some of the basic assumptions that I'd been making when coming in to fix this bug. In particular, my assumption

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-23 Thread Paolo Bonzini
Il 23/05/2014 15:35, Markus Armbruster ha scritto: Luiz Capitulino lcapitul...@redhat.com writes: On Fri, 23 May 2014 00:50:38 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: Then the guest triggers an RTC update, so qemu sends an event, but the event is lost. Then libvirtd starts again,

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-22 Thread Eric Blake
[Adding qemu] On 05/22/2014 05:07 AM, Laine Stump wrote: commit e31b5cf393857 attempted to fix libvirt's VIR_DOMAIN_EVENT_ID_RTC_CHANGE, which is documentated to always s/documentated/documented/ provide the new offset of the domain's real time clock from UTC. The problem was that, in the

Re: [Qemu-devel] [libvirt] [PATCHv2 3/4] qemu: fix RTC_CHANGE event for clock offset='variable' basis='utc'/

2014-05-22 Thread Marcelo Tosatti
On Thu, May 22, 2014 at 01:33:14PM -0600, Eric Blake wrote: [Adding qemu] On 05/22/2014 05:07 AM, Laine Stump wrote: commit e31b5cf393857 attempted to fix libvirt's VIR_DOMAIN_EVENT_ID_RTC_CHANGE, which is documentated to always s/documentated/documented/ provide the new offset of