From ad7f9e0a4a0b002120f060f8d77928f6fd27c304 Mon Sep 17 00:00:00 2001 From: Michal Novotny Date: Mon, 12 Mar 2012 18:10:13 +0100 Subject: [PATCH 2/3] Revert "qemu-timer: Introduce clock reset notifier" RH-Reverts: 449a6a98df99d79a1cf43813da937e9d8992bbd9 RH-Reverts-patchwork-id: 37478 Bugzilla-related: 734426 Signed-off-by: Michal Novotny --- qemu-timer.h | 6 ------ vl.c | 29 +---------------------------- 2 files changed, 1 insertions(+), 34 deletions(-) diff --git a/qemu-timer.h b/qemu-timer.h index 5e5942e..04062b3 100644 --- a/qemu-timer.h +++ b/qemu-timer.h @@ -1,8 +1,6 @@ #ifndef QEMU_TIMER_H #define QEMU_TIMER_H -#include "notify.h" - /* timers */ typedef struct QEMUClock QEMUClock; @@ -28,10 +26,6 @@ extern QEMUClock *host_clock; int64_t qemu_get_clock(QEMUClock *clock); -void qemu_register_clock_reset_notifier(QEMUClock *clock, Notifier *notifier); -void qemu_unregister_clock_reset_notifier(QEMUClock *clock, - Notifier *notifier); - QEMUTimer *qemu_new_timer(QEMUClock *clock, QEMUTimerCB *cb, void *opaque); void qemu_free_timer(QEMUTimer *ts); void qemu_del_timer(QEMUTimer *ts); diff --git a/vl.c b/vl.c index ed7ec85..ff5ea9b 100644 --- a/vl.c +++ b/vl.c @@ -972,9 +972,6 @@ void cpu_disable_ticks(void) struct QEMUClock { int type; /* XXX: add frequency */ - - NotifierList reset_notifiers; - int64_t last; }; struct QEMUTimer { @@ -1208,14 +1205,8 @@ static QEMUTimer *active_timers[QEMU_NUM_CLOCKS]; static QEMUClock *qemu_new_clock(int type) { QEMUClock *clock; - clock = qemu_mallocz(sizeof(QEMUClock)); clock->type = type; - notifier_list_init(&clock->reset_notifiers); - /* required to detect & report backward jumps */ - if (type == QEMU_CLOCK_HOST) { - clock->last = get_clock_realtime(); - } return clock; } @@ -1326,8 +1317,6 @@ static void qemu_run_timers(QEMUTimer **ptimer_head, int64_t current_time) int64_t qemu_get_clock(QEMUClock *clock) { - int64_t now, last; - switch(clock->type) { case QEMU_CLOCK_REALTIME: return get_clock() / 1000000; @@ -1339,26 +1328,10 @@ int64_t qemu_get_clock(QEMUClock *clock) return cpu_get_clock(); } case QEMU_CLOCK_HOST: - now = get_clock_realtime(); - last = clock->last; - clock->last = now; - if (now < last) { - notifier_list_notify(&clock->reset_notifiers, &now); - } - return now; + return get_clock_realtime(); } } -void qemu_register_clock_reset_notifier(QEMUClock *clock, Notifier *notifier) -{ - notifier_list_add(&clock->reset_notifiers, notifier); -} - -void qemu_unregister_clock_reset_notifier(QEMUClock *clock, Notifier *notifier) -{ - notifier_list_remove(&clock->reset_notifiers, notifier); -} - static void init_clocks(void) { init_get_clock(); -- 1.7.7.6