diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2015-01-26 11:50:29 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2015-01-26 11:50:29 +0000 |
| commit | 0c28d0d07fbcd7aa44d231241d444d00882256e2 (patch) | |
| tree | 3809f083ca1a33cb570304067d3f512fa624297d /qemu-timer.c | |
| parent | d109f80af3ad5c64c8c30e7ab21f2e342b5e9a8d (diff) | |
| parent | fc116efad0aadb2f8a49d51240bddbfe21b631a0 (diff) | |
| download | focaccia-qemu-0c28d0d07fbcd7aa44d231241d444d00882256e2.tar.gz focaccia-qemu-0c28d0d07fbcd7aa44d231241d444d00882256e2.zip | |
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
- Many fixes from the floor as usual - New "edu" device (v1->v2: fix 32-bit compilation) - Disabling HLE and RTM on Haswell & Broadwell - kvm_stat updates - Added --enable-modules to Travis, in preparation for switching the default # gpg: Signature made Mon 26 Jan 2015 11:44:40 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 sufficiently trusted signatures! # gpg: It is not certain 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: kvm_stat: Add RESET support for perf event ioctl target-i386: Disable HLE and RTM on Haswell & Broadwell sparse: Fix build with sparse on .S files exec: fix madvise of NULL pointer .travis.yml: Add "--enable-modules" apic: do not dereference pointer before it is checked for NULL kvm_stat: Print errno when syscall to perf_event_open() fails kvm_stat: Update exit reasons to the latest defintion kvm_stat: Add aarch64 support hw: misc, add educational driver vmstate: accept QEMUTimer in VMSTATE_TIMER*, add VMSTATE_TIMER_PTR* qemu-timer: introduce timer_deinit qemu-timer: add timer_init and timer_init_ns/us/ms target-i386: make xmm_regs 512-bit wide target-i386: use vmstate_offset_sub_array for AVX registers tests/multiboot: Add test for modules multiboot: Fix offset of bootloader name tests/multiboot: Update reference output pc: fix KVM features in pc-1.3 and earlier machine types Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-timer.c')
| -rw-r--r-- | qemu-timer.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/qemu-timer.c b/qemu-timer.c index 98d9d1bc0b..464396f7d0 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -342,6 +342,12 @@ void timer_init_tl(QEMUTimer *ts, ts->expire_time = -1; } +void timer_deinit(QEMUTimer *ts) +{ + assert(ts->expire_time == -1); + ts->timer_list = NULL; +} + void timer_free(QEMUTimer *ts) { g_free(ts); @@ -398,9 +404,11 @@ void timer_del(QEMUTimer *ts) { QEMUTimerList *timer_list = ts->timer_list; - qemu_mutex_lock(&timer_list->active_timers_lock); - timer_del_locked(timer_list, ts); - qemu_mutex_unlock(&timer_list->active_timers_lock); + if (timer_list) { + qemu_mutex_lock(&timer_list->active_timers_lock); + timer_del_locked(timer_list, ts); + qemu_mutex_unlock(&timer_list->active_timers_lock); + } } /* modify the current timer so that it will be fired when current_time |