Patchwork buildbot failure in qemu on default_mingw32

login
register
mail settings
Submitter Zhang, Yang Z
Date Sept. 11, 2012, 7:05 a.m.
Message ID <A9667DDFB95DB7438FA9D7D576C3D87E2517A1@SHSMSX101.ccr.corp.intel.com>
Download mbox | patch
Permalink /patch/183034/
State New
Headers show

Comments

Zhang, Yang Z - Sept. 11, 2012, 7:05 a.m.
how about the following patch:


Best regards,
Yang


> -----Original Message-----

> From: Stefan Weil [mailto:sw@weilnetz.de]

> Sent: Tuesday, September 11, 2012 1:14 PM

> To: Zhang, Yang Z

> Cc: Paolo Bonzini; qemu-devel@nongnu.org

> Subject: Re: [Qemu-devel] buildbot failure in qemu on default_mingw32

> 

> MinGW has no gmtime_r() which was added here:

> 

> commit 41a9b8b24d59acec462b0d8e0d2a7ffce6031d55

> Author: Yang Zhang <yang.z.zhang@intel.com>

> Date:   Thu Aug 2 18:04:10 2012 +0200

> 

>      RTC: Add divider reset support

> 

>      The first update cycle begins one-half seconds after divider

>      reset is removed.  This feature is useful for testing.

> 

>      Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>

>      Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

>      Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

> 

> - sw

> 

> 

> Am 11.09.2012 01:54, schrieb qemu@buildbot.b1-systems.de:

> > The Buildbot has detected a new failure on builder default_mingw32 while

> building qemu.

> > Full details are available at:

> >   http://buildbot.b1-systems.de/qemu/builders/default_mingw32/builds/372

> >

> > Buildbot URL: http://buildbot.b1-systems.de/qemu/

> >

> > Buildslave for this Build: kraxel_rhel61

> >

> > Build Reason: The Nightly scheduler named 'nightly_default' triggered this build

> > Build Source Stamp: [branch master] HEAD

> > Blamelist:

> >

> > BUILD FAILED: failed compile

> >

> > sincerely,

> >   -The Buildbot

> >
Paolo Bonzini - Sept. 11, 2012, 7:07 a.m.
Il 11/09/2012 09:05, Zhang, Yang Z ha scritto:
> how about the following patch:
> 
> diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
> index d63554f..30bbbe6 100644
> --- a/hw/mc146818rtc.c
> +++ b/hw/mc146818rtc.c
> @@ -556,14 +556,14 @@ static void rtc_set_cmos(RTCState *s, const struct tm *tm)
> 
>  static void rtc_update_time(RTCState *s)
>  {
> -    struct tm ret;
> +    struct tm *ret;
>      time_t guest_sec;
>      int64_t guest_nsec;
> 
>      guest_nsec = get_guest_rtc_ns(s);
>      guest_sec = guest_nsec / NSEC_PER_SEC;
> -    gmtime_r(&guest_sec, &ret);
> -    rtc_set_cmos(s, &ret);
> +    ret = gmtime(&guest_sec);
> +    rtc_set_cmos(s, ret);
>  }

No, let's add a portability wrapper for gmtime_r instead.

Paolo
Zhang, Yang Z - Sept. 11, 2012, 7:15 a.m.
Paolo Bonzini wrote on 2012-09-11:
> Il 11/09/2012 09:05, Zhang, Yang Z ha scritto:

>> how about the following patch:

>> 

>> diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index d63554f..30bbbe6

>> 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -556,14 +556,14

>> @@ static void rtc_set_cmos(RTCState *s, const struct tm *tm)

>> 

>>  static void rtc_update_time(RTCState *s)

>>  {

>> -    struct tm ret;

>> +    struct tm *ret;

>>      time_t guest_sec;

>>      int64_t guest_nsec;

>>      

>>      guest_nsec = get_guest_rtc_ns(s);

>>      guest_sec = guest_nsec / NSEC_PER_SEC;

>> -    gmtime_r(&guest_sec, &ret);

>> -    rtc_set_cmos(s, &ret);

>> +    ret = gmtime(&guest_sec);

>> +    rtc_set_cmos(s, ret);

>>  }

> 

> No, let's add a portability wrapper for gmtime_r instead.


Right, this is a better way to solve it.

Best regards,
Yang

Patch

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c

index d63554f..30bbbe6 100644

--- a/hw/mc146818rtc.c

+++ b/hw/mc146818rtc.c

@@ -556,14 +556,14 @@  static void rtc_set_cmos(RTCState *s, const struct tm *tm)


 static void rtc_update_time(RTCState *s)
 {
-    struct tm ret;

+    struct tm *ret;

     time_t guest_sec;
     int64_t guest_nsec;

     guest_nsec = get_guest_rtc_ns(s);
     guest_sec = guest_nsec / NSEC_PER_SEC;
-    gmtime_r(&guest_sec, &ret);

-    rtc_set_cmos(s, &ret);

+    ret = gmtime(&guest_sec);

+    rtc_set_cmos(s, ret);

 }

 static int update_in_progress(RTCState *s)