From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2wKJ-0006QU-Ka for qemu-devel@nongnu.org; Thu, 11 Jun 2015 02:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2wKG-0004cH-En for qemu-devel@nongnu.org; Thu, 11 Jun 2015 02:50:59 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:37968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2wKG-0004bw-8r for qemu-devel@nongnu.org; Thu, 11 Jun 2015 02:50:56 -0400 Received: by wibdq8 with SMTP id dq8so630440wib.1 for ; Wed, 10 Jun 2015 23:50:54 -0700 (PDT) Message-ID: <55792FC0.5030907@linaro.org> Date: Thu, 11 Jun 2015 08:50:40 +0200 From: Eric Auger MIME-Version: 1.0 References: <20150609155320.21713.63776.stgit@gimli.home> <20150609155514.21713.26061.stgit@gimli.home> <5578F0AC.8060805@huawei.com> In-Reply-To: <5578F0AC.8060805@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PULL v2 1/3] hw/vfio/platform: vfio-platform skeleton List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gonglei , Alex Williamson , qemu-devel@nongnu.org Cc: Peter Maydell Gonglei, Thanks for the report and please apologize for the inconvenience. I am going to send a fix reverting to simple g_malloc0 then. Best Regards Eric On 06/11/2015 04:21 AM, Gonglei wrote: > On 2015/6/9 23:55, Alex Williamson wrote: >> +static int vfio_populate_device(VFIODevice *vbasedev) >> +{ >> + int i, ret = -1; >> + VFIOPlatformDevice *vdev = >> + container_of(vbasedev, VFIOPlatformDevice, vbasedev); >> + >> + if (!(vbasedev->flags & VFIO_DEVICE_FLAGS_PLATFORM)) { >> + error_report("vfio: Um, this isn't a platform device"); >> + return ret; >> + } >> + >> + vdev->regions = g_malloc0_n(vbasedev->num_regions, >> + sizeof(VFIORegion *)); > > Failed to build on SUSE11.3: > > /home/qemu/hw/vfio/platform.c: In function ‘vfio_populate_device’: > /home/qemu/hw/vfio/platform.c:349: warning: implicit declaration of function ‘g_malloc0_n’ > /home/qemu/hw/vfio/platform.c:349: warning: nested extern declaration of ‘g_malloc0_n’ > /home/qemu/hw/vfio/platform.c:350: warning: assignment makes pointer from integer without a cast > CC x86_64-softmmu/hw/i386/pc_q35.o > CC x86_64-softmmu/hw/i386/pc_sysfw.o > CC x86_64-softmmu/hw/i386/acpi-build.o > CC x86_64-softmmu/hw/i386/kvm/pci-assign.o > CC x86_64-softmmu/target-i386/translate.o > GEN trace/generated-helpers.c > CC x86_64-softmmu/trace/generated-helpers.o > LINK x86_64-softmmu/qemu-system-x86_64 > hw/vfio/platform.o: In function `vfio_populate_device': > /home/qemu/hw/vfio/platform.c:349: undefined reference to `g_malloc0_n' > collect2: ld returned 1 exit status > make[1]: *** [qemu-system-x86_64] Error 1 > make: *** [subdir-x86_64-softmmu] Error 2 > > That's because g_malloc0_n() introduced since glib-2.24, > but QEMU just require glib-2.22. > > Regards, > -Gonglei >