All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0
@ 2015-06-11  8:44 Eric Auger
  2015-06-11 13:00 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Auger @ 2015-06-11  8:44 UTC (permalink / raw)
  To: eric.auger, eric.auger, qemu-devel, alex.williamson,
	peter.maydell, arei.gonglei

g_malloc0_n() is introduced since glib-2.24 while QEMU currently
requires glib-2.22. This may cause a link error on some distributions.

Signed-off-by: Eric Auger <eric.auger@linaro.org>

---

v1 -> v2:
- replace g_malloc0 by g_new0
---
 hw/vfio/platform.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 35266a8..9382bb7 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev)
         return ret;
     }
 
-    vdev->regions = g_malloc0_n(vbasedev->num_regions,
-                                sizeof(VFIORegion *));
+    vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions);
 
     for (i = 0; i < vbasedev->num_regions; i++) {
         struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0
  2015-06-11  8:44 [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0 Eric Auger
@ 2015-06-11 13:00 ` Peter Maydell
  2015-06-11 13:16   ` Gonglei
  2015-06-11 13:21   ` Alex Williamson
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2015-06-11 13:00 UTC (permalink / raw)
  To: Eric Auger
  Cc: Alex Williamson, Gonglei (Arei),
	eric.auger, QEMU Developers, Markus Armbruster

On 11 June 2015 at 09:44, Eric Auger <eric.auger@linaro.org> wrote:
> g_malloc0_n() is introduced since glib-2.24 while QEMU currently
> requires glib-2.22. This may cause a link error on some distributions.
>
> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>
> ---
>
> v1 -> v2:
> - replace g_malloc0 by g_new0
> ---
>  hw/vfio/platform.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> index 35266a8..9382bb7 100644
> --- a/hw/vfio/platform.c
> +++ b/hw/vfio/platform.c
> @@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev)
>          return ret;
>      }
>
> -    vdev->regions = g_malloc0_n(vbasedev->num_regions,
> -                                sizeof(VFIORegion *));
> +    vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions);
>
>      for (i = 0; i < vbasedev->num_regions; i++) {
>          struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
> --
> 1.8.3.2

This looks like the right fix to me -- if somebody would like to
give it a reviewed-by tag I can apply it to master as a buildfix...

thanks
-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0
  2015-06-11 13:00 ` Peter Maydell
@ 2015-06-11 13:16   ` Gonglei
  2015-06-11 13:21   ` Alex Williamson
  1 sibling, 0 replies; 5+ messages in thread
From: Gonglei @ 2015-06-11 13:16 UTC (permalink / raw)
  To: Peter Maydell, Eric Auger
  Cc: Alex Williamson, eric.auger, QEMU Developers, Markus Armbruster

On 2015/6/11 21:00, Peter Maydell wrote:
> On 11 June 2015 at 09:44, Eric Auger <eric.auger@linaro.org> wrote:
>> g_malloc0_n() is introduced since glib-2.24 while QEMU currently
>> requires glib-2.22. This may cause a link error on some distributions.
>>
>> Signed-off-by: Eric Auger <eric.auger@linaro.org>
>>
>> ---
>>
>> v1 -> v2:
>> - replace g_malloc0 by g_new0
>> ---
>>  hw/vfio/platform.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
>> index 35266a8..9382bb7 100644
>> --- a/hw/vfio/platform.c
>> +++ b/hw/vfio/platform.c
>> @@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev)
>>          return ret;
>>      }
>>
>> -    vdev->regions = g_malloc0_n(vbasedev->num_regions,
>> -                                sizeof(VFIORegion *));
>> +    vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions);
>>
>>      for (i = 0; i < vbasedev->num_regions; i++) {
>>          struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
>> --
>> 1.8.3.2
> 
> This looks like the right fix to me -- if somebody would like to
> give it a reviewed-by tag I can apply it to master as a buildfix...
> 

Yes, please.

Reviewed-by: Gonglei <arei.gonglei@huawei.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0
  2015-06-11 13:00 ` Peter Maydell
  2015-06-11 13:16   ` Gonglei
@ 2015-06-11 13:21   ` Alex Williamson
  2015-06-11 13:40     ` Peter Maydell
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Williamson @ 2015-06-11 13:21 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Markus Armbruster, Gonglei (Arei),
	eric.auger, QEMU Developers, Eric Auger

On Thu, 2015-06-11 at 14:00 +0100, Peter Maydell wrote:
> On 11 June 2015 at 09:44, Eric Auger <eric.auger@linaro.org> wrote:
> > g_malloc0_n() is introduced since glib-2.24 while QEMU currently
> > requires glib-2.22. This may cause a link error on some distributions.
> >
> > Signed-off-by: Eric Auger <eric.auger@linaro.org>
> >
> > ---
> >
> > v1 -> v2:
> > - replace g_malloc0 by g_new0
> > ---
> >  hw/vfio/platform.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> > index 35266a8..9382bb7 100644
> > --- a/hw/vfio/platform.c
> > +++ b/hw/vfio/platform.c
> > @@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev)
> >          return ret;
> >      }
> >
> > -    vdev->regions = g_malloc0_n(vbasedev->num_regions,
> > -                                sizeof(VFIORegion *));
> > +    vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions);
> >
> >      for (i = 0; i < vbasedev->num_regions; i++) {
> >          struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
> > --
> > 1.8.3.2
> 
> This looks like the right fix to me -- if somebody would like to
> give it a reviewed-by tag I can apply it to master as a buildfix...

Thanks Peter

Acked-by: Alex Williamson <alex.williamson@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0
  2015-06-11 13:21   ` Alex Williamson
@ 2015-06-11 13:40     ` Peter Maydell
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2015-06-11 13:40 UTC (permalink / raw)
  To: Alex Williamson
  Cc: Markus Armbruster, Gonglei (Arei),
	eric.auger, QEMU Developers, Eric Auger

On 11 June 2015 at 14:21, Alex Williamson <alex.williamson@redhat.com> wrote:
> On Thu, 2015-06-11 at 14:00 +0100, Peter Maydell wrote:
>> On 11 June 2015 at 09:44, Eric Auger <eric.auger@linaro.org> wrote:
>> > g_malloc0_n() is introduced since glib-2.24 while QEMU currently
>> > requires glib-2.22. This may cause a link error on some distributions.
>> >
>> > Signed-off-by: Eric Auger <eric.auger@linaro.org>
>> >
>> > ---
>> >
>> > v1 -> v2:
>> > - replace g_malloc0 by g_new0
>> > ---
>> >  hw/vfio/platform.c | 3 +--
>> >  1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>> > diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
>> > index 35266a8..9382bb7 100644
>> > --- a/hw/vfio/platform.c
>> > +++ b/hw/vfio/platform.c
>> > @@ -346,8 +346,7 @@ static int vfio_populate_device(VFIODevice *vbasedev)
>> >          return ret;
>> >      }
>> >
>> > -    vdev->regions = g_malloc0_n(vbasedev->num_regions,
>> > -                                sizeof(VFIORegion *));
>> > +    vdev->regions = g_new0(VFIORegion *, vbasedev->num_regions);
>> >
>> >      for (i = 0; i < vbasedev->num_regions; i++) {
>> >          struct vfio_region_info reg_info = { .argsz = sizeof(reg_info) };
>> > --
>> > 1.8.3.2
>>
>> This looks like the right fix to me -- if somebody would like to
>> give it a reviewed-by tag I can apply it to master as a buildfix...
>
> Thanks Peter
>
> Acked-by: Alex Williamson <alex.williamson@redhat.com>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-11 13:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11  8:44 [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0 Eric Auger
2015-06-11 13:00 ` Peter Maydell
2015-06-11 13:16   ` Gonglei
2015-06-11 13:21   ` Alex Williamson
2015-06-11 13:40     ` Peter Maydell

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.