]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr_rtc.c
pseries: Move rtc_offset into RTC device's state structure
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 6 Feb 2015 03:55:52 +0000 (14:55 +1100)
committerAlexander Graf <agraf@suse.de>
Mon, 9 Mar 2015 13:59:58 +0000 (14:59 +0100)
commit880ae7de5958a765699386777de0f3841d635e1d
tree243ff22a3874a8293659146ad1acad9d65411e03
parent28df36a13a3b0b792d9df64f8db8a392df5e0b35
pseries: Move rtc_offset into RTC device's state structure

The initial creation of the PAPR RTC qdev class left a wart - the rtc's
offset was left in the sPAPREnvironment structure, accessed via a global.

This patch moves it into the RTC device's own state structure, were it
belongs.  This requires a small change to the migration stream format.  In
order to handle incoming streams from older versions, we also need to
retain the rtc_offset field in the sPAPREnvironment structure, so that it
can be loaded into via the vmsd, then pushed into the RTC device.

Since we're changing the migration format, this also takes the opportunity
to:

  * Change the rtc offset from a value in seconds to a value in
    nanoseconds, allowing nanosecond offsets between host and guest
    rtc time, if desired.

  * Remove both the already unused "next_irq" field and now unused
    "rtc_offset" field from the new version of the spapr migration
    stream

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr.c
hw/ppc/spapr_rtc.c
include/hw/ppc/spapr.h