All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: Stefan Weil <weil@mail.berlios.de>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qtest: use qemu_gettimeofday()
Date: Mon, 02 Apr 2012 10:54:24 -0500	[thread overview]
Message-ID: <4F79CBB0.6080101@codemonkey.ws> (raw)
In-Reply-To: <1333134332-16481-1-git-send-email-aliguori@us.ibm.com>

On 03/30/2012 02:05 PM, Anthony Liguori wrote:
> On linux, qemu_timeval will always be two long ints.  On windows, we use our
> own struct definition.  This should fix win64.
>
> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>

Applied.

Regards,

Anthony Liguori

> ---
>   qtest.c |   14 +++++++-------
>   1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/qtest.c b/qtest.c
> index cd7186c..daeabb7 100644
> --- a/qtest.c
> +++ b/qtest.c
> @@ -31,7 +31,7 @@ static FILE *qtest_log_fp;
>   static CharDriverState *qtest_chr;
>   static GString *inbuf;
>   static int irq_levels[MAX_IRQ];
> -static struct timeval start_time;
> +static qemu_timeval start_time;
>   static bool qtest_opened;
>
>   #define FMT_timeval "%ld.%06ld"
> @@ -132,9 +132,9 @@ static int hex2nib(char ch)
>       }
>   }
>
> -static void qtest_get_time(struct timeval *tv)
> +static void qtest_get_time(qemu_timeval *tv)
>   {
> -    gettimeofday(tv, NULL);
> +    qemu_gettimeofday(tv);
>       tv->tv_sec -= start_time.tv_sec;
>       tv->tv_usec -= start_time.tv_usec;
>       if (tv->tv_usec<  0) {
> @@ -145,7 +145,7 @@ static void qtest_get_time(struct timeval *tv)
>
>   static void qtest_send_prefix(CharDriverState *chr)
>   {
> -    struct timeval tv;
> +    qemu_timeval tv;
>
>       if (!qtest_log_fp || !qtest_opened) {
>           return;
> @@ -195,7 +195,7 @@ static void qtest_process_command(CharDriverState *chr, gchar **words)
>       command = words[0];
>
>       if (qtest_log_fp) {
> -        struct timeval tv;
> +        qemu_timeval tv;
>           int i;
>
>           qtest_get_time(&tv);
> @@ -394,7 +394,7 @@ static void qtest_event(void *opaque, int event)
>           for (i = 0; i<  ARRAY_SIZE(irq_levels); i++) {
>               irq_levels[i] = 0;
>           }
> -        gettimeofday(&start_time, NULL);
> +        qemu_gettimeofday(&start_time);
>           qtest_opened = true;
>           if (qtest_log_fp) {
>               fprintf(qtest_log_fp, "[I " FMT_timeval "] OPENED\n",
> @@ -404,7 +404,7 @@ static void qtest_event(void *opaque, int event)
>       case CHR_EVENT_CLOSED:
>           qtest_opened = false;
>           if (qtest_log_fp) {
> -            struct timeval tv;
> +            qemu_timeval tv;
>               qtest_get_time(&tv);
>               fprintf(qtest_log_fp, "[I +" FMT_timeval "] CLOSED\n",
>                       tv.tv_sec, tv.tv_usec);

      reply	other threads:[~2012-04-02 15:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 19:05 [Qemu-devel] [PATCH] qtest: use qemu_gettimeofday() Anthony Liguori
2012-04-02 15:54 ` Anthony Liguori [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=4F79CBB0.6080101@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.