libvirt/src/conf
Osier Yang e31b5cf393 qemu: Report the offset from host UTC for RTC_CHANGE event
https://bugzilla.redhat.com/show_bug.cgi?id=964177

Though both libvirt and QEMU's document say RTC_CHANGE returns
the offset from the host UTC, qemu actually returns the offset
from the specified date instead when specific date is provided
(-rtc base=$date).

It's not safe for qemu to fix it in code, it worked like that
for 3 years, changing it now may break other QEMU use cases.
What qemu tries to do is to fix the document:

http://lists.gnu.org/archive/html/qemu-devel/2013-05/msg04782.html

And in libvirt side, instead of replying on the value from qemu,
this converts the offset returned from qemu to the offset from
host UTC, by:

  /*
   * a: the offset from qemu RTC_CHANGE event
   * b: The specified date (-rtc base=$date)
   * c: the host date when libvirt gets the RTC_CHANGE event
   * offset: What libvirt will report
   */

  offset = a + (b - c);

The specified date (-rtc base=$date) is recorded in clock's def as
an internal only member (may be useful to exposed outside?).

Internal only XML tag "basetime" is introduced to not lose the
guest's basetime after libvirt restarting/reloading:

<clock offset='variable' adjustment='304' basis='utc' basetime='1370423588'/>
2013-06-07 14:45:08 +08:00
..
capabilities.c Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/* 2013-05-22 18:53:59 +02:00
capabilities.h virCaps: get rid of defaultConsoleTargetType callback 2013-04-04 22:42:39 +02:00
cpu_conf.c Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/* 2013-05-22 18:53:59 +02:00
cpu_conf.h Rename xml.{c,h} to virxml.{c,h} 2012-12-21 11:19:50 +00:00
device_conf.c virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
device_conf.h Rename util.{c,h} to virutil.{c,h} 2012-12-21 11:19:49 +00:00
domain_audit.c src/conf: Remove the whitespace before ';' 2013-05-21 23:41:44 +08:00
domain_audit.h Include pid namespace inode in LXC audit messages 2013-03-07 19:43:53 +00:00
domain_conf.c qemu: Report the offset from host UTC for RTC_CHANGE event 2013-06-07 14:45:08 +08:00
domain_conf.h qemu: Report the offset from host UTC for RTC_CHANGE event 2013-06-07 14:45:08 +08:00
domain_event.c Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/* 2013-05-22 18:53:59 +02:00
domain_event.h Add support for SUSPEND_DISK event 2012-10-15 12:09:10 +02:00
domain_nwfilter.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
domain_nwfilter.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
interface_conf.c syntax: prefer space after semicolon in for loop 2013-05-28 07:56:07 -06:00
interface_conf.h Fix the syntax-check failure 2013-05-22 13:14:31 +08:00
netdev_bandwidth_conf.c virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
netdev_bandwidth_conf.h Rename xml.{c,h} to virxml.{c,h} 2012-12-21 11:19:50 +00:00
netdev_vlan_conf.c netdev_vlan_conf: Resolve memory leak found by Valgrind. 2013-02-07 14:08:14 -05:00
netdev_vlan_conf.h Rename xml.{c,h} to virxml.{c,h} 2012-12-21 11:19:50 +00:00
netdev_vport_profile_conf.c virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
netdev_vport_profile_conf.h Rename xml.{c,h} to virxml.{c,h} 2012-12-21 11:19:50 +00:00
network_conf.c Remove redundant two-state integers 2013-06-06 17:22:53 +02:00
network_conf.h Support for static routes on a virtual bridge 2013-05-13 16:14:40 -04:00
node_device_conf.c Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/* 2013-05-22 18:53:59 +02:00
node_device_conf.h Rename 'DeviceMonitor' to 'NodeDeviceDriver' 2013-04-24 10:59:53 +01:00
nwfilter_conf.c Replace two-state local integers with bool 2013-06-06 17:22:53 +02:00
nwfilter_conf.h virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
nwfilter_ipaddrmap.c Rename virterror.c virterror_internal.h to virerror.{c,h} 2012-12-21 11:19:50 +00:00
nwfilter_ipaddrmap.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
nwfilter_params.c virNWFilterHashTablePut: Free the correct variable 2013-05-23 15:58:41 +02:00
nwfilter_params.h Rename buf.{c,h} to virbuffer.{c,h} 2012-12-21 11:17:12 +00:00
secret_conf.c virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
secret_conf.h cleanup: Change datatype of secret->private to boolean 2013-04-11 11:54:37 +08:00
snapshot_conf.c Adapt to VIR_STRDUP and VIR_STRNDUP in src/conf/* 2013-05-22 18:53:59 +02:00
snapshot_conf.h maint: Rename xmlconf to xmlopt and virDomainXMLConfig to virDomainXMLOption 2013-04-04 22:18:56 +02:00
storage_conf.c Remove redundant two-state integers 2013-06-06 17:22:53 +02:00
storage_conf.h storage_conf: Improve the coding style in storage_conf.h 2013-05-20 20:01:23 +08:00
storage_encryption_conf.c virutil: Move string related functions to virstring.c 2013-05-02 16:56:55 +02:00
storage_encryption_conf.h Rename util.{c,h} to virutil.{c,h} 2012-12-21 11:19:49 +00:00
virchrdev.c conf: add missing OOM errors 2013-05-23 18:56:36 +02:00
virchrdev.h conf: Add unix socket support to virChrdevOpen 2013-01-04 18:07:11 -07:00