mirror_qemu/include/sysemu
Peter Maydell 5ec008a2bd rtc: Use time_t for passing and returning time offsets
The functions qemu_get_timedate() and qemu_timedate_diff() take
and return a time offset as an integer. Coverity points out that
means that when an RTC device implementation holds an offset
as a time_t, as the m48t59 does, the time_t will get truncated.
(CID 1507157, 1517772).

The functions work with time_t internally, so make them use that type
in their APIs.

Note that this won't help any Y2038 issues where either the device
model itself is keeping the offset in a 32-bit integer, or where the
hardware under emulation has Y2038 or other rollover problems.  If we
missed any cases of the former then hopefully Coverity will warn us
about them since after this patch we'd be truncating a time_t in
assignments from qemu_timedate_diff().)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
2023-08-31 09:45:18 +01:00
..
accel-blocker.h accel: Clean up includes 2023-02-08 07:28:05 +01:00
accel-ops.h gdbstub: move update guest debug to accel ops 2023-03-07 20:44:09 +00:00
arch_init.h hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
balloon.h qapi: Restrict balloon-related commands to machine code 2020-09-29 15:41:35 +02:00
block-backend-common.h block: drain from main loop thread in bdrv_co_yield_to_drain() 2023-05-30 17:32:02 +02:00
block-backend-global-state.h block: add blk_in_drain() API 2023-05-30 17:32:02 +02:00
block-backend-io.h block: add blk_io_plug_call() API 2023-06-01 07:34:03 -04:00
block-backend.h include/sysemu/block-backend: split header into I/O and global state (GS) API 2022-03-04 18:18:25 +01:00
block-ram-registrar.h block: add BlockRAMRegistrar 2022-10-26 14:56:42 -04:00
blockdev.h include/sysemu/blockdev.h: global state API 2022-03-04 18:18:25 +01:00
cpu-throttle.h cpu-throttle: new module, extracted from cpus.c 2020-07-10 18:04:49 -04:00
cpu-timers.h replay: notify vCPU when BH is scheduled 2022-06-06 09:26:53 +02:00
cpus.h exec: Remove unused 'qemu/timer.h' timer 2023-02-27 22:29:01 +01:00
cryptodev-vhost-user.h cryptodev: Fix Lesser GPL version number 2020-10-27 16:48:49 +01:00
cryptodev-vhost.h cryptodev: Fix Lesser GPL version number 2020-10-27 16:48:49 +01:00
cryptodev.h cryptodev: support QoS 2023-03-07 12:38:59 -05:00
device_tree.h device-tree: add re-randomization helper function 2022-10-27 11:34:31 +01:00
dirtylimit.h migration: Extend query-migrate to provide dirty page limit info 2023-07-26 10:55:56 +02:00
dirtyrate.h include: Include headers where needed 2023-01-08 01:54:22 -05:00
dma.h hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult 2022-01-18 12:56:29 +01:00
dump-arch.h dump: Add architecture section and section string table support 2022-10-24 22:30:10 +04:00
dump.h include: Include headers where needed 2023-01-08 01:54:22 -05:00
event-loop-base.h Don't include headers already included by qemu/osdep.h 2023-02-08 07:28:05 +01:00
hax.h accel: Document generic accelerator headers 2023-06-28 13:55:35 +02:00
hostmem.h hostmem: Allow for specifying a ThreadContext for preallocation 2022-10-27 11:01:03 +02:00
hvf.h sysemu/hvf: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint 2023-08-24 11:21:40 -07:00
hvf_int.h accel: Rename HVF 'struct hvf_vcpu_state' -> AccelCPUState 2023-06-28 14:14:22 +02:00
hw_accel.h accel: Introduce AccelOpsClass::cpus_are_resettable() 2022-03-06 13:15:42 +01:00
iothread.h Introduce event-loop-base abstract class 2022-05-09 10:43:23 +01:00
kvm.h sysemu/kvm: Use vaddr for kvm_arch_[insert|remove]_hw_breakpoint 2023-08-24 11:21:35 -07:00
kvm_int.h kvm: Synchronize the backup bitmap in the last stage 2023-05-18 08:53:50 +02:00
kvm_xen.h kvm/i386: Add xen-evtchn-max-pirq property 2023-03-01 09:09:22 +00:00
memory_mapping.h sysemu/memory_mapping: Become target-agnostic 2022-03-06 13:15:42 +01:00
numa.h numa: drop support for '-numa node' (without memory specified) 2020-09-30 19:09:20 +02:00
nvmm.h accel: Document generic accelerator headers 2023-06-28 13:55:35 +02:00
os-posix.h win32: replace closesocket() with close() wrapper 2023-03-13 15:39:31 +04:00
os-win32.h console/win32: allocate shareable display surface 2023-06-27 17:08:56 +02:00
qtest.h softmmu/qtest: Move the target-specific pseries RTAS code out of qtest.c 2023-04-20 11:25:32 +02:00
replay.h replay: Extract core API to 'exec/replay-core.h' 2023-02-27 22:29:01 +01:00
reset.h reset: allow registering handlers that aren't called by snapshot loading 2022-10-27 11:34:31 +01:00
rng-random.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
rng.h qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
rtc.h rtc: Use time_t for passing and returning time offsets 2023-08-31 09:45:18 +01:00
runstate-action.h vl: Add option to avoid stopping VM upon guest panic 2020-12-15 12:51:58 -05:00
runstate.h runstate: drop unused runstate_store() 2023-06-02 01:03:19 +02:00
seccomp.h sandbox: disable -sandbox if CONFIG_SECCOMP undefined 2018-06-01 13:44:15 +02:00
stats.h stats: Move QMP commands from monitor/ to stats/ 2023-02-04 07:56:54 +01:00
sysemu.h pci: Move HMP command from hw/pci/pcie_aer.c to pci-hmp-cmds.c 2022-12-19 16:21:56 +01:00
tcg.h accel: Document generic accelerator headers 2023-06-28 13:55:35 +02:00
tpm.h tpm: Add support for TPM device over I2C bus 2023-04-20 08:17:15 -04:00
tpm_backend.h sysemu: Make TPM structures inaccessible if CONFIG_TPM is not defined 2021-06-15 10:55:12 -04:00
tpm_util.h tpm: Fix Lesser GPL version number 2020-11-15 16:44:18 +01:00
vhost-user-backend.h qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros 2020-09-18 14:12:32 -04:00
watchdog.h watchdog: remove -watchdog option 2022-09-29 11:40:28 +02:00
whpx.h accel: Document generic accelerator headers 2023-06-28 13:55:35 +02:00
xen-mapcache.h include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
xen.h accel: Document generic accelerator headers 2023-06-28 13:55:35 +02:00