From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEjaU-0006Dm-M6 for qemu-devel@nongnu.org; Mon, 02 Apr 2012 11:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEjaP-0006fC-RH for qemu-devel@nongnu.org; Mon, 02 Apr 2012 11:54:34 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:39799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEjaP-0006eo-Mc for qemu-devel@nongnu.org; Mon, 02 Apr 2012 11:54:29 -0400 Received: by obbwd20 with SMTP id wd20so4648210obb.4 for ; Mon, 02 Apr 2012 08:54:27 -0700 (PDT) Message-ID: <4F79CBB0.6080101@codemonkey.ws> Date: Mon, 02 Apr 2012 10:54:24 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1333134332-16481-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1333134332-16481-1-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qtest: use qemu_gettimeofday() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Stefan Weil , qemu-devel@nongnu.org, Paolo Bonzini 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 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);