Bug 1211938 - libvirt requires rtc-reset-reinjection command in qemu
Summary: libvirt requires rtc-reset-reinjection command in qemu
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.2
Hardware: ppc64
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andrea Bolognani
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1213235
TreeView+ depends on / blocked
 
Reported: 2015-04-15 08:57 UTC by Gu Nini
Modified: 2015-11-19 06:28 UTC (History)
15 users (show)

Fixed In Version: libvirt-1.2.16-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1213235 (view as bug list)
Environment:
Last Closed: 2015-11-19 06:28:35 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2202 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2015-11-19 08:17:58 UTC

Description Gu Nini 2015-04-15 08:57:17 UTC
Description of problem:
The virsh cmd 'virsh domtime DomName --now/sync' could not be executed for there is no 'rtc-reset-reinjection' command in qemu

Version-Release number of selected component (if applicable):
Host kernel: 3.10.0-234.el7.ppc64
Qemu-kvm: qemu-kvm-rhev-2.2.0-8.el7.ppc64
Guest kernel: 2.6.32-548.el6.ppc64/3.10.0-229.el7.ppc64
Guest agent: 0.12.1.2-2.465.el6.ppc64/2.1.0-4.el7.ppc64
Libvirt: libvirt-1.2.13-1.el7.ppc64

How reproducible:
100%

Steps to Reproduce:
1. Start a guest with virio serial guest agent in virsh
2. After the guest starts up, install guest agent and start it inside the guest
3. Try to issue following command in virsh:

# virsh domtime spaprqcow-6.7 --now/sync
error: Operation not supported: cannot set time: qemu doesn't support rtc-reset-reinjection command

Actual results:
It's a failure for no 'rtc-reset-reinjection' command in qemu.

Expected results:
There is 'rtc-reset-reinjection' command in qemu, and it's a success to execute 'virsh domtime DomName --now/sync'

Additional info:
There already is a bz 1191226 on qemu-kvm of rhel7.1.

Comment 2 David Gibson 2015-04-20 06:22:04 UTC
This is nothing to do with the guest agent.

The "rtc reinjection" that this command clears is something x86 specific that we have no need for on Power or anything else.

It's not immediately clear whether the correct fix is to implement this in qemu as a no-op for Power, or to change libvirt not to attempt this on non-x86.

Jirka, Andrea, thoughts?

Comment 3 David Gibson 2015-04-20 06:23:29 UTC
Correction, it has something to do with the guest agent in that this qmp command is called after changing the time via the guest agent.  However the implementation is not in the guest agent in any way.

Comment 4 Jiri Denemark 2015-04-20 09:25:26 UTC
To me this looks like a libvirt bug. If rtc-reset-reinjection does not make any sense for Power (likely because it just uses a different timer), we should not require it. I don't know much about timers but from the name of this command it looks like calling it may not even make sense for x86_64 depending on configured timers...

Comment 5 David Gibson 2015-04-20 23:51:45 UTC
Yes, Power uses a different timer.  Its "RTC" is actually a paravirt firmware interface rather than a real discrete device (although it's treated as a device in qemu).

Of course that's really a property of -machine pseries, not of target-ppc64.  a PReP machine could have an MC146818 clock, although AFAICT the reset-reinjection stuff within the mc146818 driver is all #ifdef TARGET_I386 anyway.

Anyway, moving this bug to libvirt.

Comment 6 Andrea Bolognani 2015-05-28 09:44:35 UTC
This issue has been addressed by

commit ceab3979deca133cadf91150983b0153510de308
Author: Andrea Bolognani <abologna@redhat.com>
Date:   Tue May 26 18:13:40 2015 +0200

    qemu: Limit rtc-reset-reinjection requirement to x86 only.
    
    The QMP command, like the interrupt reinjection logic it's connected
    to, is only implemented in QEMU when TARGET_I386 is defined, so
    checking for its availability on any other architecture is pointless.
    
    On the other hand, when we're on x86, we shouldn still make sure that
    rtc-reset-reinjection is available and refuse to set the time
    otherwise.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1211938

v1.2.16-rc1-5-gceab397

which has been merged upstream and will be in libvirt 1.2.16.

Comment 8 Dan Zheng 2015-07-28 03:27:17 UTC
Test on below packages:
libvirt-1.2.17-2.el7.ppc64le
kernel-3.10.0-292.el7.ppc64le
qemu-kvm-rhev-2.3.0-9.el7.ppc64le

*******************************************************
Test 1: --now and --pretty test
Pass 
1.1 Start guest and set time within the guest
[root@localhost ~]# date --set "2015-07-29  16:21:42"
Wed Jul 29 16:21:42 EDT 2015
[root@localhost ~]# date
Wed Jul 29 16:21:44 EDT 2015


1.2 In the host, set the host time to the guest.
# date
Mon Jul 27 20:58:28 EDT 2015
# virsh domtime dzhengvm2 --now

# echo $?
0

1.3 Check time within the guest, success.
[root@localhost ~]# date -u
Tue Jul 28 03:20:27 UTC 2015

1.4 Check in host via domtime.
# virsh domtime dzhengvm2
Time: 1438053715
# virsh domtime dzhengvm2 --pretty
Time: 2015-07-28 03:22:27

*******************************************************
Test 2: --sync test
Pass.
2.1 Set time within the guest
[root@localhost ~]# date --set "2015-07-29  16:21:42"
Wed Jul 29 16:21:42 EDT 2015

2.2 Run --sync in the host
# virsh domtime dzhengvm2 --sync

# date
Mon Jul 27 21:06:02 EDT 2015

2.3 Then check within the guest.
# date
Mon Jul 27 21:06:15 EDT 2015

*******************************************************
Test 3: --time test
Pass

3.1 Get time within the guest
[root@localhost ~]# date
Mon Jul 27 21:05:03 EDT 2015

3.2 Get/set time of the guest via domtime
# virsh domtime dzhengvm2 
Time: 1438045546

# virsh domtime dzhengvm2 --time 1438046000


3.3 Check time within the guest
# date
Mon Jul 27 21:13:24 EDT 2015

3.4 Check time of the guest via domtime
# virsh domtime dzhengvm2 
Time: 1438046014

Comment 9 Dan Zheng 2015-07-28 07:31:17 UTC
About tests are done with below packages:
libvirt-1.2.17-2.el7.ppc64le
kernel-3.10.0-292.el7.ppc64le
qemu-kvm-rhev-2.3.0-9.el7.ppc64le
Guest kernel: kernel-3.10.0-253.ael7b.ppc64le
Guest agent: qemu-guest-agent-2.3.0-2.el7.ppc64le
Guest OS:    Red Hat Enterprise Linux Server release 7.2 Beta (Maipo)

Comment 11 errata-xmlrpc 2015-11-19 06:28:35 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/RHBA-2015-2202.html


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