[libvirt] PATCH: Fix numa build failure on 32-bit f9

The automated build on Fedora 9, i386 is currently failing with cc1: warnings being treated as errors nodeinfo.c: In function 'virCapsInitNUMA': nodeinfo.c:212: error: passing argument 2 of 'numa_node_to_cpus' from incompatible pointer type make[3]: *** [libvirt_driver_la-nodeinfo.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... The following patch addresses it: Index: src/nodeinfo.c =================================================================== RCS file: /data/cvs/libvirt/src/nodeinfo.c,v retrieving revision 1.15 diff -u -p -u -r1.15 nodeinfo.c --- src/nodeinfo.c 21 Dec 2008 18:55:09 -0000 1.15 +++ src/nodeinfo.c 5 Jan 2009 12:22:04 -0000 @@ -194,7 +194,7 @@ int virCapsInitNUMA(virCapsPtr caps) { int n; - uint64_t *mask = NULL; + unsigned long *mask = NULL; int *cpus = NULL; int ret = -1; int max_n_cpus = NUMA_MAX_N_CPUS; Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

"Daniel P. Berrange" <berrange@redhat.com> wrote:
The automated build on Fedora 9, i386 is currently failing with
cc1: warnings being treated as errors nodeinfo.c: In function 'virCapsInitNUMA': nodeinfo.c:212: error: passing argument 2 of 'numa_node_to_cpus' from incompatible pointer type make[3]: *** [libvirt_driver_la-nodeinfo.lo] Error 1 make[3]: *** Waiting for unfinished jobs....
The following patch addresses it:
ACK. That looks right, since it has to match arg2 of this: static inline int numa_node_to_cpus_compat(int node, unsigned long *buffer, int buffer_len) At first glance, I had doubts about using the sometimes-narrower type, but all uses are scaled by "sizeof *mask", so if it weren't for that prototype, any unsigned type would do.

On Mon, Jan 05, 2009 at 01:48:21PM +0100, Jim Meyering wrote:
"Daniel P. Berrange" <berrange@redhat.com> wrote:
The automated build on Fedora 9, i386 is currently failing with
cc1: warnings being treated as errors nodeinfo.c: In function 'virCapsInitNUMA': nodeinfo.c:212: error: passing argument 2 of 'numa_node_to_cpus' from incompatible pointer type make[3]: *** [libvirt_driver_la-nodeinfo.lo] Error 1 make[3]: *** Waiting for unfinished jobs....
The following patch addresses it:
ACK. That looks right, since it has to match arg2 of this:
static inline int numa_node_to_cpus_compat(int node, unsigned long *buffer, int buffer_len)
At first glance, I had doubts about using the sometimes-narrower type, but all uses are scaled by "sizeof *mask", so if it weren't for that prototype, any unsigned type would do.
Yes, I double checked the allocation calculations again and all look to be correct, so I've committed this. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Jim Meyering