Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1103245 - libvirt reset rtc interrupt backlog after guest-set-time
libvirt reset rtc interrupt backlog after guest-set-time
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
: Upstream
Depends On:
Blocks: 1049038
  Show dependency treegraph
 
Reported: 2014-05-30 10:18 EDT by Marcelo Tosatti
Modified: 2015-03-05 02:36 EST (History)
7 users (show)

See Also:
Fixed In Version: libvirt-1.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:36:57 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 07:10:54 EST

  None (edit)
Description Marcelo Tosatti 2014-05-30 10:18:04 EDT
libvirt should execute QMP's rtc_reset_reinjection command after 
executing guest-set-time guest agent command.

This is necessary to avoid the problem described in the rtc_reset_reinjection 
patchset:

http://www.mail-archive.com/qemu-devel@nongnu.org/msg236435.html
Comment 2 Michal Privoznik 2014-08-13 08:52:22 EDT
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2014-August/msg00576.html
Comment 3 Michal Privoznik 2014-08-20 08:33:47 EDT
Moving to POST:

commit b606bbb416e264466a3f5af62a13163e432d0f49
Author:     Michal Privoznik <mprivozn@redhat.com>
AuthorDate: Wed Aug 13 14:28:24 2014 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Wed Aug 20 14:20:05 2014 +0200

    qemu: Issue rtc-reset-reinjection command after guest-set-time
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1103245
    
    An advice appeared there on the qemu-devel list [1]. When a domain is
    suspended and then resumed guest kernel is not aware of this. So we've
    introduced virDomainSetTime API that resets the time within guest
    using qemu-ga. On the other hand, qemu itself is trying to make RTC
    beat faster to catch the difference. But if we don't tell qemu that
    guest's time was reset via the other method, both mechanisms are
    applied resulting in again wrong guest time. In order to avoid summing
    both corrections we need to tell qemu that it should not use the RTC
    injection if the guest time is set via guest agent.
    
    1: http://www.mail-archive.com/qemu-devel@nongnu.org/msg236435.html
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>


v1.2.7-184-gb606bbb
Comment 5 zhenfeng wang 2014-10-13 06:00:23 EDT
Try to set guest time with qemu-ga with libvirt-1.2.7-2, didn't see any event or logs about rtc_reset_reinjection in libvirt log, even set the log_level =1 in /etc/libvirt/libvirtd.log, so this bug reproduced. And after update the libvirt to the latest one libvirt-1.2.8-5.el7, i could catch the log that libvirt execute QMP's rtc_reset_reinjection command after executing guest-set-time guest agent command. so this bug can be markd verified. the following was the verify steps

pkginfo
libvirt-1.2.8-5.el7.x86_64

steps
1.Prepare a guest with qemu-ga installed
2.Setting logs for libvirt
#cat /etc/libvirt/libvirtd.log
log_level = 1
log_outputs="1:file:/var/log/libvirt/libvirtd.log"
#service libvirtd restart

3.Set the time to the guest with the qemu-ga
#virsh domtime rhel6 --time 12345

4.check the logs, could see the log that libvirt have executed QMP's rtc_reset_reinjection command after excuing guest-set-time guest agent command
#cat /var/log/libvirt/libvirtd.log
--
2014-10-13 08:01:33.259+0000: 10545: debug : qemuAgentCommand:1104 : Send command '{"execute":"guest-set-time","arguments":{"time":90121345000000000}}' for write, seconds = -2
--
--
2014-10-13 07:46:16.575+0000: 6314: debug : virJSONValueToString:1303 : result={"execute":"rtc-reset-reinjection","id":"libvirt-10"}

2014-10-13 07:46:16.575+0000: 6314: debug : qemuMonitorJSONCommandWithFd:286 : Send command '{"execute":"rtc-reset-reinjection","id":"libvirt-10"}' for write with FD -1
2014-10-13 07:46:16.575+0000: 6314: debug : qemuMonitorSend:976 : QEMU_MONITOR_SEND_MSG: mon=0x7f6f280079e0 msg={"execute":"rtc-reset-reinjection","id":"libvirt-10"}^M
 fd=-1
2014-10-13 07:46:16.575+0000: 6310: debug : qemuMonitorIOWrite:507 : QEMU_MONITOR_IO_WRITE: mon=0x7f6f280079e0 buf={"execute":"rtc-reset-reinjection","id":"libvirt-10"}^M
 len=55 ret=55 errno=11
Comment 7 errata-xmlrpc 2015-03-05 02:36:57 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html

Note You need to log in before you can comment on or make changes to this bug.