From: Gonglei <arei.gonglei@huawei.com>
To: Peter Maydell <peter.maydell@linaro.org>,
Eric Auger <eric.auger@linaro.org>
Cc: Alex Williamson <alex.williamson@redhat.com>,
eric.auger@st.com, QEMU Developers <qemu-devel@nongnu.org>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] hw/vfio/platform: replace g_malloc0_n by g_new0
Date: Thu, 11 Jun 2015 21:16:10 +0800 [thread overview]
Message-ID: <55798A1A.6070001@huawei.com> (raw)
In-Reply-To: <CAFEAcA-9ndUfch1jRQWSqQty0fBA66wubeEyrZYcKrqkyQfXwg@mail.gmail.com>
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>
next prev parent reply other threads:[~2015-06-11 13:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2015-06-11 13:21 ` Alex Williamson
2015-06-11 13:40 ` Peter Maydell
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=55798A1A.6070001@huawei.com \
--to=arei.gonglei@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=eric.auger@linaro.org \
--cc=eric.auger@st.com \
--cc=peter.maydell@linaro.org \
--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 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.