aboutsummaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-03-03 12:07:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-03-03 12:07:47 +0000
commit3180aadb1f00fa0f0b47bccbcae5b1d47dc5ff74 (patch)
tree28002356eccc9fea652bac43151129ed34ca792d /vl.c
parent5efde22aa781d37df58f0060430f459491dcfd62 (diff)
parent21618b3e55ad2c6fede0bffcaea466091811ce59 (diff)
downloadqemu-3180aadb1f00fa0f0b47bccbcae5b1d47dc5ff74.zip
qemu-3180aadb1f00fa0f0b47bccbcae5b1d47dc5ff74.tar.gz
qemu-3180aadb1f00fa0f0b47bccbcae5b1d47dc5ff74.tar.bz2
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
- more config options - bootdevice, iscsi, virtio-scsi fixes - build system patches for MinGW and config-devices.mak - qemu_mutex_lock_iothread deadlock fixes - another tiny patch from the record/replay series # gpg: Signature made Mon Mar 2 09:59:14 2015 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: cpus: be more paranoid in avoiding deadlocks cpus: fix deadlock and segfault in qemu_mutex_lock_iothread virtio-scsi: Allocate op blocker reason before blocking Makefile.target: binary depends on config-devices Makefile: don't silence mak file test with V=1 Makefile: fix up parallel building under MSYS+MinGW iscsi: Handle write protected case in reopen Give ivshmem its own config option Create specific config option for "platform-bus" Add specific config options for PCI-E bridges bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd' timer: replace time() with QEMU_CLOCK_HOST virtio-scsi-dataplane: Call blk_set_aio_context within BQL block: Forbid bdrv_set_aio_context outside BQL scsi: give device a parent before setting properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/vl.c b/vl.c
index 09693f5..5d13d2f 100644
--- a/vl.c
+++ b/vl.c
@@ -707,13 +707,17 @@ void vm_start(void)
/***********************************************************/
/* real time host monotonic timer */
+static time_t qemu_time(void)
+{
+ return qemu_clock_get_ms(QEMU_CLOCK_HOST) / 1000;
+}
+
/***********************************************************/
/* host time/date access */
void qemu_get_timedate(struct tm *tm, int offset)
{
- time_t ti;
+ time_t ti = qemu_time();
- time(&ti);
ti += offset;
if (rtc_date_offset == -1) {
if (rtc_utc)
@@ -741,7 +745,7 @@ int qemu_timedate_diff(struct tm *tm)
else
seconds = mktimegm(tm) + rtc_date_offset;
- return seconds - time(NULL);
+ return seconds - qemu_time();
}
static void configure_rtc_date_offset(const char *startdate, int legacy)
@@ -779,7 +783,7 @@ static void configure_rtc_date_offset(const char *startdate, int legacy)
"'2006-06-17T16:01:21' or '2006-06-17'\n");
exit(1);
}
- rtc_date_offset = time(NULL) - rtc_start_date;
+ rtc_date_offset = qemu_time() - rtc_start_date;
}
}