On Tue, Jan 31, 2012 at 06:56, Wei Yang <weiy...@linux.vnet.ibm.com> wrote: > Tested on i386 platform. > > Signed-off-by: Wei Yang<weiy...@linux.vnet.ibm.com>
Nack. Definitions should reside in files where they are used, only in header files when they are used by multiple sources. > --- > qemu-timer.c | 40 ---------------------------------------- > qemu-timer.h | 41 +++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 41 insertions(+), 40 deletions(-) > > diff --git a/qemu-timer.c b/qemu-timer.c > index cd026c6..2b5cc48 100644 > --- a/qemu-timer.c > +++ b/qemu-timer.c > @@ -46,46 +46,6 @@ > > #include "qemu-timer.h" > > -/***********************************************************/ > -/* timers */ > - > -#define QEMU_CLOCK_REALTIME 0 > -#define QEMU_CLOCK_VIRTUAL 1 > -#define QEMU_CLOCK_HOST 2 > - > -struct QEMUClock { > - int type; > - int enabled; > - > - QEMUTimer *active_timers; > - > - NotifierList reset_notifiers; > - int64_t last; > -}; > - > -struct QEMUTimer { > - QEMUClock *clock; > - int64_t expire_time; /* in nanoseconds */ > - int scale; > - QEMUTimerCB *cb; > - void *opaque; > - struct QEMUTimer *next; > -}; > - > -struct qemu_alarm_timer { > - char const *name; > - int (*start)(struct qemu_alarm_timer *t); > - void (*stop)(struct qemu_alarm_timer *t); > - void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns); > -#if defined(__linux__) > - int fd; > - timer_t timer; > -#elif defined(_WIN32) > - HANDLE timer; > -#endif > - char expired; > - char pending; > -}; > > static struct qemu_alarm_timer *alarm_timer; > > diff --git a/qemu-timer.h b/qemu-timer.h > index 67ca72e..5bf2fc7 100644 > --- a/qemu-timer.h > +++ b/qemu-timer.h > @@ -20,6 +20,47 @@ > typedef struct QEMUClock QEMUClock; > typedef void QEMUTimerCB(void *opaque); > > +/***********************************************************/ > +/* timers */ > + > +#define QEMU_CLOCK_REALTIME 0 > +#define QEMU_CLOCK_VIRTUAL 1 > +#define QEMU_CLOCK_HOST 2 > + > +struct QEMUClock { > + int type; > + int enabled; > + > + QEMUTimer *active_timers; > + > + NotifierList reset_notifiers; > + int64_t last; > +}; > + > +struct QEMUTimer { > + QEMUClock *clock; > + int64_t expire_time; /* in nanoseconds */ > + int scale; > + QEMUTimerCB *cb; > + void *opaque; > + struct QEMUTimer *next; > +}; > + > +struct qemu_alarm_timer { > + char const *name; > + int (*start)(struct qemu_alarm_timer *t); > + void (*stop)(struct qemu_alarm_timer *t); > + void (*rearm)(struct qemu_alarm_timer *t, int64_t nearest_delta_ns); > +#if defined(__linux__) > + int fd; > + timer_t timer; > +#elif defined(_WIN32) > + HANDLE timer; > +#endif > + char expired; > + char pending; > +}; > + > /* The real time clock should be used only for stuff which does not > change the virtual machine state, as it is run even if the virtual > machine is stopped. The real time clock has a frequency of 1000 > -- > 1.7.4.1 > >