Skip to contentSkip to conversation

kvm-userspace compile problem

DISCUSSION Hans de Bruin 2 participants 4 messages Feb 12, 2009 – Feb 14, 2009 KVM

lore
Share & tools
lore
#0 lore raw

<newbie>

distro: slamd64
kernel: today's git
kvm-userspace: today's git

/usr/src/linux-2.6/.config:
CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
CONFIG_X86=y
...
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
# CONFIG_KVM_INTEL is not set
CONFIG_KVM_AMD=y
# CONFIG_KVM_TRACE is not set
CONFIG_VIRTIO=y
CONFIG_VIRTIO_RING=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y

e$ ./configure --prefix=/usr --with-patched-kernel

Install prefix    /usr
BIOS directory    /usr/share/qemu
binary directory  /usr/bin
Manual directory  /usr/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /home/hns/kvm-userspace/qemu
C compiler        gcc
Host C compiler   gcc
ARCH_CFLAGS       -m64
make              make
install           install
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu
gprof enabled     no
sparse enabled    no
profiler          no
static build      no
-Werror enabled   no
SDL support       yes
SDL static link   no
curses support    yes
mingw32 support   no
Audio drivers     oss

Extra audio cards ac97 es1370 sb16
Mixer emulation no
VNC TLS support yes
TLS CFLAGS
TLS LIBS -lgnutls

kqemu support     no
kvm support       no - (#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
CPU emulation     yes
brlapi support    no
Documentation     yes
NPTL support      yes
vde support       no
AIO support       yes
Install blobs     yes
KVM support       no - (#error Missing KVM capability KVM_CAP_DESTROY_MEMORY_REGION_WORKS)
fdt support       no

$cat config.mak:
ARCH=x86_64
PROCESSOR=x86_64
PREFIX=/usr
KERNELDIR=/lib/modules/2.6.29-rc4/build
KERNELSOURCEDIR=
LIBKVM_KERNELDIR=/home/hns/kvm-userspace/kernel
WANT_MODULE=
CROSS_COMPILE=
CC=gcc
LD=ld
OBJCOPY=objcopy
AR=ar
DEPMOD_VERSION=

$ find /usr -name libkvm.h
/usr/include/libkvm.h (from kvm-78-x86_64_slamd64-1.tgz?
removing it did not help)

I switched to git because the kvm-83 tarball gave some other problems

</newbie>

#1 lore raw
Quoted 26 lines

e$ ./configure --prefix=/usr --with-patched-kernel

Install prefix    /usr
BIOS directory    /usr/share/qemu
binary directory  /usr/bin
Manual directory  /usr/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /home/hns/kvm-userspace/qemu
C compiler        gcc
Host C compiler   gcc
ARCH_CFLAGS       -m64
make              make
install           install
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu
gprof enabled     no
sparse enabled    no
profiler          no
static build      no
-Werror enabled   no
SDL support       yes
SDL static link   no
curses support    yes
mingw32 support   no
Audio drivers     oss
Quoted 8 lines

Extra audio cards ac97 es1370 sb16
Mixer emulation no
VNC TLS support yes
TLS CFLAGS
TLS LIBS -lgnutls
kqemu support no
kvm support no - (#error Missing KVM capability
KVM_CAP_DESTROY_MEMORY_REGION_WORKS)

try passing --kerneldir=<path_to_kvm_git>

Signature · 5 lines
Glauber  Costa.
"Free as in Freedom"
http://glommer.net

"The less confident you are, the more serious you have to act."
#2 lore raw
Quoted 34 lines · Glauber Costa
Quoted 25 lines

e$ ./configure --prefix=/usr --with-patched-kernel

Install prefix    /usr
BIOS directory    /usr/share/qemu
binary directory  /usr/bin
Manual directory  /usr/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /home/hns/kvm-userspace/qemu
C compiler        gcc
Host C compiler   gcc
ARCH_CFLAGS       -m64
make              make
install           install
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu
gprof enabled     no
sparse enabled    no
profiler          no
static build      no
-Werror enabled   no
SDL support       yes
SDL static link   no
curses support    yes
mingw32 support   no
Audio drivers     oss
Quoted 8 lines

Extra audio cards ac97 es1370 sb16
Mixer emulation no
VNC TLS support yes
TLS CFLAGS
TLS LIBS -lgnutls
kqemu support no
kvm support no - (#error Missing KVM capability
KVM_CAP_DESTROY_MEMORY_REGION_WORKS)

Quoted 1 line

try passing --kerneldir=<path_to_kvm_git>

That did not help, but after I changed this:

~/kvm-userspace$ diff configure.old configure
95,96c95,96
< #set kenel directory
< libkvm_kerneldir=$(readlink -f kernel)
---

Quoted 2 lines

#set kernel directory
libkvm_kerneldir=$(readlink -f $kerneldir)

the error was gone. configure used kvm.h in /usr/include/linux/ (distro suplied 2.6.27 headers) instead of the git version.

My troubles aren't totaly gone however:

make -C libkvm
make[1]: Entering directory `/home/hns/kvm-userspace/libkvm' gcc -m64 -D__x86_64__ -MMD -MF ./.libkvm.d -g -fomit-frame-pointer -Wall
-fno-stack-protector -
I /usr/src/linux-2.6/include -c -o libkvm.o libkvm.c
In file included from /usr/include/bits/fcntl.h:24,

                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:

/usr/include/sys/types.h:46: error: conflicting types for 'loff_t' /usr/src/linux-2.6/include/linux/types.h:57: error: previous declaration of 'loff_t' was here /usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/src/linux-2.6/include/linux/types.h:19: error: previous declaration of 'dev_t' was here In file included from /usr/include/sys/types.h:133,

                 from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:
/usr/include/time.h:105: error: conflicting types for 'timer_t'
/usr/src/linux-2.6/include/linux/types.h:28: error: previous declaration of 'timer_t' was here
In file included from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:

/usr/include/sys/types.h:198: error: conflicting types for 'int64_t' /usr/src/linux-2.6/include/linux/types.h:125: error: previous declaration of 'int64_t' was here /usr/include/sys/types.h:204: error: conflicting types for 'u_int64_t' /usr/src/linux-2.6/include/linux/types.h:124: error: previous declaration of 'u_int64_t' was here In file included from /usr/include/sys/types.h:220,

                 from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:
/usr/include/sys/select.h:78: error: conflicting types for 'fd_set'
/usr/src/linux-2.6/include/linux/types.h:18: error: previous declaration of 'fd_set' was here
In file included from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:
/usr/include/sys/types.h:235: error: conflicting types for 'blkcnt_t'
/usr/src/linux-2.6/include/linux/types.h:146: error: previous declaration of 'blkcnt_t' was here
In file included from /usr/include/inttypes.h:28,
                 from libkvm.c:37:

/usr/include/stdint.h:56: error: conflicting types for 'uint64_t' /usr/src/linux-2.6/include/linux/types.h:123: error: previous declaration of 'uint64_t' was here make[1]: *** [libkvm.o] Error 1
make[1]: Leaving directory `/home/hns/kvm-userspace/libkvm'
make: *** [libkvm] Error 2

Signature · 1 line
Hans
#3 lore raw
Quoted 89 lines · Hans de Bruin
Quoted 34 lines · Glauber Costa
Quoted 25 lines

e$ ./configure --prefix=/usr --with-patched-kernel

Install prefix    /usr
BIOS directory    /usr/share/qemu
binary directory  /usr/bin
Manual directory  /usr/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /home/hns/kvm-userspace/qemu
C compiler        gcc
Host C compiler   gcc
ARCH_CFLAGS       -m64
make              make
install           install
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu
gprof enabled     no
sparse enabled    no
profiler          no
static build      no
-Werror enabled   no
SDL support       yes
SDL static link   no
curses support    yes
mingw32 support   no
Audio drivers     oss
Quoted 8 lines

Extra audio cards ac97 es1370 sb16
Mixer emulation no
VNC TLS support yes
TLS CFLAGS
TLS LIBS -lgnutls
kqemu support no
kvm support no - (#error Missing KVM capability
KVM_CAP_DESTROY_MEMORY_REGION_WORKS)

Quoted 1 line

try passing --kerneldir=<path_to_kvm_git>

That did not help, but after I changed this:

~/kvm-userspace$ diff configure.old configure
95,96c95,96
< #set kenel directory
< libkvm_kerneldir=$(readlink -f kernel)
---

Quoted 2 lines

#set kernel directory
libkvm_kerneldir=$(readlink -f $kerneldir)

the error was gone. configure used kvm.h in /usr/include/linux/ (distro suplied 2.6.27 headers) instead of the git version.

My troubles aren't totaly gone however:

make -C libkvm
make[1]: Entering directory `/home/hns/kvm-userspace/libkvm' gcc -m64 -D__x86_64__ -MMD -MF ./.libkvm.d -g -fomit-frame-pointer -Wall
-fno-stack-protector -
I /usr/src/linux-2.6/include -c -o libkvm.o libkvm.c
In file included from /usr/include/bits/fcntl.h:24,

                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:

/usr/include/sys/types.h:46: error: conflicting types for 'loff_t' /usr/src/linux-2.6/include/linux/types.h:57: error: previous declaration of 'loff_t' was here /usr/include/sys/types.h:62: error: conflicting types for 'dev_t' /usr/src/linux-2.6/include/linux/types.h:19: error: previous declaration of 'dev_t' was here In file included from /usr/include/sys/types.h:133,

                 from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:
/usr/include/time.h:105: error: conflicting types for 'timer_t'
/usr/src/linux-2.6/include/linux/types.h:28: error: previous declaration of 'timer_t' was here
In file included from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:

/usr/include/sys/types.h:198: error: conflicting types for 'int64_t' /usr/src/linux-2.6/include/linux/types.h:125: error: previous declaration of 'int64_t' was here /usr/include/sys/types.h:204: error: conflicting types for 'u_int64_t' /usr/src/linux-2.6/include/linux/types.h:124: error: previous declaration of 'u_int64_t' was here In file included from /usr/include/sys/types.h:220,

                 from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:
/usr/include/sys/select.h:78: error: conflicting types for 'fd_set'
/usr/src/linux-2.6/include/linux/types.h:18: error: previous declaration of 'fd_set' was here
In file included from /usr/include/bits/fcntl.h:24,
                 from /usr/include/fcntl.h:34,
                 from libkvm.c:30:
/usr/include/sys/types.h:235: error: conflicting types for 'blkcnt_t'
/usr/src/linux-2.6/include/linux/types.h:146: error: previous declaration of 'blkcnt_t' was here
In file included from /usr/include/inttypes.h:28,
                 from libkvm.c:37:
Quoted 5 lines

/usr/include/stdint.h:56: error: conflicting types for 'uint64_t' /usr/src/linux-2.6/include/linux/types.h:123: error: previous declaration of 'uint64_t' was here make[1]: *** [libkvm.o] Error 1
make[1]: Leaving directory `/home/hns/kvm-userspace/libkvm'
make: *** [libkvm] Error 2

I copied all the kvm kernel headers from 29-rc4 to /usr/include/linux, git-reset kvm-userspace (undone my .configure changes) and the build completed successfully.

Signature · 1 line
Hans