Hello Dan Kenigsberg, Peter V. Saveliev, Martin Polednik,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: vdsm: fix RTC offset ......................................................................
vdsm: fix RTC offset
Upon RTC update (hwclock --systohc) on the guest side, libvirt sends the event with RTC offset from the qemu start -rtc value in seconds. The received offset should not replace the previous value, but should be added to it. Since the time update event is relative to the qemu start time, we should store the initial value and use it for the calculation.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=956741 Change-Id: I27c70a53f64fb05607e93bffbac25fdee7d1cd2a Signed-off-by: Peter V. Saveliev peet@redhat.com Reviewed-on: http://gerrit.ovirt.org/14750 Tested-by: Martin Polednik mpoledni@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/vm.py 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/24196/1
diff --git a/vdsm/vm.py b/vdsm/vm.py index bf64195..caec964 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -1914,6 +1914,7 @@ self.id = self.conf['vmId'] self._volPrepareLock = threading.Lock() self._initTimePauseCode = None + self._initTimeRTC = long(self.conf.get('timeOffset', 0)) self.guestAgent = None self._guestEvent = 'Powering up' self._guestEventTime = 0 @@ -2413,9 +2414,10 @@ timer.start()
def _rtcUpdate(self, timeOffset): - self.log.debug('new rtc offset %s', timeOffset) + newTimeOffset = str(self._initTimeRTC + long(timeOffset)) + self.log.debug('new rtc offset %s', newTimeOffset) with self._confLock: - self.conf['timeOffset'] = timeOffset + self.conf['timeOffset'] = newTimeOffset
def extendDrivesIfNeeded(self): extend = []
Martin Polednik has posted comments on this change.
Change subject: vdsm: fix RTC offset ......................................................................
Patch Set 1: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: vdsm: fix RTC offset ......................................................................
Patch Set 1: Code-Review+2
Note that we were asked to backport this to ovirt-3.3, too.
Martin Polednik has posted comments on this change.
Change subject: vdsm: fix RTC offset ......................................................................
Patch Set 1: Verified+1
Behaves same as master.
Francesco Romani has posted comments on this change.
Change subject: vdsm: fix RTC offset ......................................................................
Patch Set 1:
Thanks Martin for the verification! I was installing things to give it a try but you were faster!
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vdsm: fix RTC offset ......................................................................
vdsm: fix RTC offset
Upon RTC update (hwclock --systohc) on the guest side, libvirt sends the event with RTC offset from the qemu start -rtc value in seconds. The received offset should not replace the previous value, but should be added to it. Since the time update event is relative to the qemu start time, we should store the initial value and use it for the calculation.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=956741 Change-Id: I27c70a53f64fb05607e93bffbac25fdee7d1cd2a Signed-off-by: Peter V. Saveliev peet@redhat.com Reviewed-on: http://gerrit.ovirt.org/14750 Tested-by: Martin Polednik mpoledni@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/24196 Reviewed-by: Martin Polednik mpoledni@redhat.com --- M vdsm/vm.py 1 file changed, 4 insertions(+), 2 deletions(-)
Approvals: Dan Kenigsberg: Looks good to me, approved Martin Polednik: Verified; Looks good to me, but someone else must approve
vdsm-patches@lists.fedorahosted.org