Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 597175

Summary: Stop/continue Windows guest caused large timedrift
Product: Red Hat Enterprise Linux 6 Reporter: Amos Kong <akong>
Component: qemu-kvmAssignee: Gleb Natapov <gleb>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: ailan, amit.shah, gyue, knoel, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 707939 (view as bug list) Environment:
Last Closed: 2010-06-20 06:24:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 580953, 707939    

Description Amos Kong 2010-05-28 10:10:50 UTC
Description of problem:
'stop' and 'continue' Windowns guest caused a large timedrift, it's easy to be reproduced. I waited 30 seconds, but guest only passed less than 2 seconds.

result:
orig_time = 9:24:16.25
new_time = 9:24:17.53

Version-Release number of selected component (if applicable):
host kernel: 2.6.32-25.el6.x86_64
# rpm -qa |grep qemu
qemu-img-0.12.1.2-2.62.el6.x86_64
qemu-kvm-0.12.1.2-2.62.el6.x86_64
qemu-kvm-debuginfo-0.12.1.2-2.62.el6.x86_64
gpxe-roms-qemu-0.9.7-6.3.el6.noarch
qemu-kvm-tools-0.12.1.2-2.62.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. boot up a windows guest
2. get the original time of guest ($orig_time)
guest)#echo %TIME%
3. stop guest by monitor command
#qemu)stop
4. wait for 30 seconds
5. make guest continue running
#qemu)cont
6. get the new time of guest ($new_time)
guest)#echo %TIME%
  
Actual results:
time drifted

Expected results:
no timedrift

Additional info:

command line:
qemu-kvm -name 'vm1' -monitor tcp:0:6002,server,nowait -drive file=/root/autotest/client/tests/kvm/images/winXP-32.qcow2,if=ide,cache=none,boot=on -net nic,vlan=0,model=e1000,macaddr=02:8D:A6:DE:1f:02 -net tap,vlan=0,ifname=e1000_0_6002,script=/root/autotest/client/tests/kvm/scripts/qemu-ifup-switch,downscript=no -m 512 -smp 1 -drive file=/root/autotest/client/tests/kvm/isos/windows/winutils.iso,index=2,media=cdrom -soundhw ac97 -redir tcp:5000::22 -vnc :1 -usbdevice tablet -rtc-td-hack -no-hpet -cpu qemu64,+sse2 -no-kvm-pit-reinjection -rtc-td-hack -serial unix:/tmp/serial-20100528-170730-C64p,server,nowait

Comment 2 Dor Laor 2010-05-31 14:05:55 UTC
I just tried it and it did work for me.
Once you 'cont' time runs pretty fast until it catch up.

Note that it is a weird check, not sure it worth testing

Comment 3 RHEL Program Management 2010-06-07 15:54:38 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 Gleb Natapov 2010-06-17 10:12:22 UTC
Works for me too. It takes time for clock to catch up so verifying time to fast after continue may lead to incorrect result.

Adjust steps to include "sleep 30" after continue and before verifying guest time and retest.

Comment 5 Amos Kong 2010-06-18 05:12:50 UTC
After added the step of sleep 30s before verifying guest time, the drift time is too short(about 0.22s), it can be ignore.

Comment 6 Gleb Natapov 2010-06-20 06:24:47 UTC
According to comment #5 closing the BZ.

Comment 7 Amos Kong 2010-12-02 08:13:59 UTC
Hi gleb, 

Test with the following steps, timedrift exists, it's about 60 seconds.

1. boot up a win2003.64 guest
2. get the original time of guest ($orig_time)
guest)#echo %TIME%
3. stop guest by monitor command
#qemu)stop
4. wait for 60 seconds
5. make guest continue running
#qemu)cont
6. wait for 30 seconds
7. get the new time of guest ($new_time)
guest)#echo %TIME%

guest uses acpi_pm clock source (as http://cleo.tlv.redhat.com/qumrawiki/KVM/TimeKeeping)

qemu-kvm -name 'vm1' -monitor unix:'/tmp/monitor-humanmonitor1-20101202-154320-E2b8',server,nowait -serial unix:'/tmp/serial-20101202-154320-E2b8',server,nowait -drive file='/home/devel/autotest-devel/client/tests/kvm/images/win2003-64-virtio.qcow2',index=0,if=virtio,media=disk,cache=none,boot=on,format=qcow2 -net nic,vlan=0,model=virtio,macaddr='9a:72:41:20:79:f5' -net tap,vlan=0,ifname='t0-154320-E2b8',script='/home/devel/autotest-devel/client/tests/kvm/scripts/qemu-ifup-switch',downscript='no' -m 2048 -smp 2,cores=1,threads=1,sockets=2 -drive file='/home/devel/autotest-devel/client/tests/kvm/isos/windows/winutils.iso',media=cdrom,index=1 -cpu qemu64,+sse2 -soundhw ac97 -redir tcp:5000::10023 -vnc :0 -spice port=8000,disable-ticketing -qxl 1 -rtc-td-hack -M rhel5.5.0 -usbdevice tablet


# uname -a
Linux t173 2.6.18-231.el5 #1 SMP Mon Nov 8 18:36:02 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@t173 kvm]# rpm -qa |grep kvm
kvm-debuginfo-83-215.el5
etherboot-zroms-kvm-5.4.4-13.el5
kmod-kvm-83-215.el5
kvm-83-215.el5
etherboot-roms-kvm-5.4.4-13.el5
kmod-kvm-debug-83-215.el5
kvm-qemu-img-83-215.el5
kvm-tools-83-215.el5