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 981242 - guest hardware time should be count when guest is paused
Summary: guest hardware time should be count when guest is paused
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Marcelo Tosatti
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-04 10:02 UTC by ShupingCui
Modified: 2013-08-02 15:37 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-02 15:37:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description ShupingCui 2013-07-04 10:02:12 UTC
Description of problem:
guest hardware time cannot be count when guest is paused

Version-Release number of selected component (if applicable):
host:
kernel-2.6.32-392.el6.x86_64
qemu-kvm-0.12.1.2-2.377.el6.x86_64
guest:
kernel-2.6.32-358.14.1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. boot the guest with "-rtc base=utc,clock=vm"
/usr/libexec/qemu-kvm \
    -name 'vm1' \
    -chardev socket,id=serial_id_serial1,path=/tmp/serial-serial1-20130702-093138-pSivbSG8,server,nowait \
    -device isa-serial,chardev=serial_id_serial1 \
    -drive file='/root/staf-kvm-devel/autotest-devel/client/tests/virt/shared/data/images/RHEL-Server-6.4-64-virtio.qcow2',if=none,id=drive-virtio-disk1,media=disk,cache=none,snapshot=off,format=qcow2,aio=native \
    -device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk1 \
    -net none \
    -m 4096 \
    -smp 1,maxcpus=1,cores=1,threads=1,sockets=2 \
    -cpu 'Penryn' \
    -M rhel6.5.0 \
    -vnc :0 \
    -vga cirrus \
    -rtc base=utc,clock=vm,driftfix=slew  \
    -boot order=cdn,once=c,menu=off   \
    -no-kvm-pit-reinjection \
    -enable-kvm \
    -monitor stdio

2. check time in guest
# date
Thu Jul  4 17:49:22 CST 2013
# hwclock
Thu 04 Jul 2013 05:49:23 PM CST  -0.991541 seconds

3. stop guest
4. wait 2 mins, then cont
5. check time in guest
# date
Thu Jul  4 17:51:22 CST 2013
# hwclock
Thu 04 Jul 2013 05:49:24 PM CST  -0.266206 seconds


Actual results:
the system clock be count, the hardware time not count

Expected results:
the hardware time should be count when guest is paused

Additional info:
1. i tried boot the guest with "-rtc base=utc,clock=host,driftfix=slew"
after stop/cont, the guest hardware clock is count when guest is paused

2. host cpuinfo
processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
stepping	: 10
cpu MHz		: 2992.051
cache size	: 6144 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority
bogomips	: 5984.10
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

Comment 1 ShupingCui 2013-07-04 10:05:47 UTC
in guest:
# cat /sys/devices/system/clocksource/clocksource0/current_clocksource
kvm-clock

Comment 3 Marcelo Tosatti 2013-08-01 17:32:04 UTC
(In reply to ShupingCui from comment #1)
> in guest:
> # cat /sys/devices/system/clocksource/clocksource0/current_clocksource
> kvm-clock

Shuping Cui, 

The RTC clock not counting on vmpause is expected behaviour with clock=vm, as
described by QEMU man page:

"
By default the RTC is driven by the host system time. This allows to use the RTC as accurate reference clock inside the guest, specifically if the host time is smoothly following an accurate external reference clock, e.g. via NTP.  If you want to isolate the guest time from the host, you can set clock to "rt" instead.  To even prevent it from progressing during suspension, you can
set it to "vm".
"

Can you please confirm the software is behaving as expected, or point to the problem? Thanks.

Comment 4 ShupingCui 2013-08-02 10:02:50 UTC
(In reply to Marcelo Tosatti from comment #3)
> (In reply to ShupingCui from comment #1)
> > in guest:
> > # cat /sys/devices/system/clocksource/clocksource0/current_clocksource
> > kvm-clock
> 
> Shuping Cui, 
> 
> The RTC clock not counting on vmpause is expected behaviour with clock=vm, as
> described by QEMU man page:
> 
> "
> By default the RTC is driven by the host system time. This allows to use the
> RTC as accurate reference clock inside the guest, specifically if the host
> time is smoothly following an accurate external reference clock, e.g. via
> NTP.  If you want to isolate the guest time from the host, you can set clock
> to "rt" instead.  To even prevent it from progressing during suspension, you
> can
> set it to "vm".
> "
> 
> Can you please confirm the software is behaving as expected, or point to the
> problem? Thanks.

Hi Marcelo,

ok, you're right, the guest RTC clock only count when clock=host, 

thanks for your help.

Best Regards,
Shuping


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