[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/12] host-utils: add ffsl
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/12] host-utils: add ffsl |
Date: |
Wed, 30 Jan 2013 15:03:08 +0000 |
On 30 January 2013 14:05, Peter Maydell <address@hidden> wrote:
> On 16 January 2013 17:31, Paolo Bonzini <address@hidden> wrote:
>> We can provide fast versions based on the other functions defined
>> by host-utils.h. Some care is required on glibc, which provides
>> ffsl already.
>>
>> Signed-off-by: Paolo Bonzini <address@hidden>
>
> Hi. This patch breaks compile on MacOS (and likely other BSDs):
>
> CC qga/commands-posix.o
> In file included from qga/commands-posix.c:22:
> /Users/pm215/src/qemu/include/qemu/host-utils.h:248: error: static
> declaration of ‘ffsl’ follows non-static declaration
>
> (because BSD strings.h provides a system ffsl()).
>
>> +/* glibc does not provide an inline version of ffsl, so always define
>> + * ours. We need to give it a different name, however.
>> + */
>> +#ifdef __GLIBC__
>> +#define ffsl qemu_ffsl
>> +#endif
>
> Overriding a system function like this seems a bit brittle --
> can't we either (a) always use the system version or (b)
> always use a QEMU implementation?
>
> Failing that, you probably need a configure test to check for
> system ffsl().
Also, we already have a roll-your-own ffsl, it's bitops_ffsl()
in bitops.h. Can we improve and use that implementation instead
of having a second one?
-- PMM
- [Qemu-devel] [PATCH v2 00/12] Drive mirroring performance improvements, Paolo Bonzini, 2013/01/16
- [Qemu-devel] [PATCH v2 01/12] host-utils: add ffsl, Paolo Bonzini, 2013/01/16
- [Qemu-devel] [PATCH v2 03/12] block: implement dirty bitmap using HBitmap, Paolo Bonzini, 2013/01/16
- [Qemu-devel] [PATCH v2 02/12] add hierarchical bitmap data type and test cases, Paolo Bonzini, 2013/01/16
- [Qemu-devel] [PATCH v2 04/12] block: make round_to_clusters public, Paolo Bonzini, 2013/01/16
- [Qemu-devel] [PATCH v2 05/12] mirror: perform COW if the cluster size is bigger than the granularity, Paolo Bonzini, 2013/01/16