RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1103245 - libvirt reset rtc interrupt backlog after guest-set-time
Summary: libvirt reset rtc interrupt backlog after guest-set-time
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1049038
TreeView+ depends on / blocked
 
Reported: 2014-05-30 14:18 UTC by Marcelo Tosatti
Modified: 2015-03-05 07:36 UTC (History)
7 users (show)

Fixed In Version: libvirt-1.2.8-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 07:36:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Marcelo Tosatti 2014-05-30 14:18:04 UTC
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 12:52:22 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2014-August/msg00576.html

Comment 3 Michal Privoznik 2014-08-20 12:33:47 UTC
Moving to POST:

commit b606bbb416e264466a3f5af62a13163e432d0f49
Author:     Michal Privoznik <mprivozn>
AuthorDate: Wed Aug 13 14:28:24 2014 +0200
Commit:     Michal Privoznik <mprivozn>
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>


v1.2.7-184-gb606bbb

Comment 5 zhenfeng wang 2014-10-13 10:00:23 UTC
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 07:36:57 UTC
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.