qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Yang <weiyang@linux.vnet.ibm.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] This patch is used to move some struct definition, like QEMUTimer, QEMUClock, from .c to .h.
Date: Mon, 6 Feb 2012 09:43:42 +0800	[thread overview]
Message-ID: <20120206014341.GA4892@richard> (raw)
In-Reply-To: <CAAu8pHtoDNPZ1=HuCN7ZJgfdWJkGBwAoOJUJ8WSo6M-nSfFLnQ@mail.gmail.com>

On Sat, Feb 04, 2012 at 10:22:09AM +0000, Blue Swirl wrote:
>On Tue, Jan 31, 2012 at 06:56, Wei Yang <weiyang@linux.vnet.ibm.com> wrote:
>> Tested on i386 platform.
>>
>> Signed-off-by: Wei Yang<weiyang@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.
>
Thanks, I got the idea :-)
>> ---
>>  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
>>
>>

-- 
Richard Yang
Help you, Help me

      reply	other threads:[~2012-02-06  1:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31  6:56 [Qemu-devel] [PATCH] This patch is used to move some struct definition, like QEMUTimer, QEMUClock, from .c to .h Wei Yang
2012-02-04 10:22 ` Blue Swirl
2012-02-06  1:43   ` Richard Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120206014341.GA4892@richard \
    --to=weiyang@linux.vnet.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).