log2() is heavy when ffs() can do the same thing. But ffs()
requires gnulib support for mingw.
This patch solves this linker error on Fedora 14.
/usr/bin/ld: libvirt_lxc-domain_conf.o: undefined reference to symbol 'log2@@GLIBC_2.2.5'
/usr/bin/ld: note: 'log2@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
/lib64/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
* .gnulib: Update to latest, for ffs.
* bootstrap.conf (gnulib_modules): Import ffs.
* src/conf/domain_conf.c (virDomainDefParseXML): Use ffs instead
of log2.
Reported by Dave Allan.
-Subproject commit 56005a21e8f9f434212a19dcb628c6d3b179fd08
+Subproject commit a918da4d61d28be61a12605c9d35e2cf3966d866
crypto/md5
dirname-lgpl
fcntl-h
+ffs
fnmatch
func
getaddrinfo
#include <fcntl.h>
#include <dirent.h>
#include <sys/time.h>
-#include <math.h>
+#include <strings.h>
#include "virterror_internal.h"
#include "datatypes.h"
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected domain type %s, expecting %s"),
virDomainVirtTypeToString(def->virtType),
- virDomainVirtTypeToString(log2(expectedVirtTypes)));
+ virDomainVirtTypeToString(ffs(expectedVirtTypes) - 1));
} else {
virBuffer buffer = VIR_BUFFER_INITIALIZER;
char *string;