[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 3/8] vfio: Generalize region support
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PULL 3/8] vfio: Generalize region support |
Date: |
Thu, 10 Mar 2016 13:46:06 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
On 03/10/2016 09:34 AM, Alex Williamson wrote:
>>> + trace_vfio_msix_fixup(vdev->vbasedev.name,
>>> + vdev->msix->table_bar,
>>> region->mmaps[0].offset,
>>> + region->mmaps[0].offset +
>>> region->mmaps[0].size);
>> Sorry this does not compile for me on arm 32b:
>>
>> ./trace/generated-tracers.h:16113:23: error: format ‘%lx’ expects
>> argument of type ‘long unsigned int’, but argument 8 has type ‘off_t’
>> [-Werror=format=] , name, bar, offset, size);
>>
>> -> vfio_msix_fixup(const char *name, int bar, off_t start, off_t end) "
>> (%s) MSI-X region %d mmap fixup [0x%"PRIx64" - 0x%"PRIx64"]" ?
>
> vfio_msix_disable(const char *name) " (%s)"
> -vfio_msix_fixup(const char *name, int bar, off_t offset, size_t size) " (%s)
> MSI-X region %d mmap fixup [0x%lx - 0x%lx]"
> +vfio_msix_fixup(const char *name, int bar, off_t start, off_t end) " (%s)
> MSI-X region %d mmap fixup [0x%"PRIx64" - 0x%"PRIx64"]"
off_t and PRIx64 are not necessarily compatible types (on a 64-bit
platform, one could be 'long' while the other is 'long long'). And even
though we set compiler flags to get 64-bit off_t on 32-bit platforms,
your code is not portable to people that don't set those flags and are
stuck with 32-bit off_t.
It may be better to declare start and end as [u]int64_t, rather than off_t.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PULL 4/8] vfio/pci: Convert all MemoryRegion to dynamic alloc and consistent functions, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 5/8] vfio/pci: Fixup PCI option ROMs, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 6/8] vfio/pci: Split out VGA setup, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 7/8] vfio/pci: replace fixed string limit by g_strdup_printf, Alex Williamson, 2016/03/09
[Qemu-devel] [PULL 8/8] MAINTAINERS: Add entry for the include/hw/vfio/ folder, Alex Williamson, 2016/03/09
Re: [Qemu-devel] [PULL 0/8] VFIO updates 2016-03-09, Peter Maydell, 2016/03/10