Trouble building VM to VM module

I am unable to build the module for guest to guest access. I was able to build the client application. I’m not sure what I’m missing based on reading

I get this error on make:

gcc test.c -Wall -Werror -g -Og -o test	
test.c:12:19: fatal error: kvmfr.h: No such file or directory
compilation terminated.
Makefile:13: recipe for target 'test' failed
make: *** [test] Error 1

If I copy the KVMFR.h file from common to kvmfr.h and attempt to build (as close to an idea as I had) I get this:

gcc test.c -Wall -Werror -g -Og -o test
In file included from test.c:12:0:
kvmfr.h:48:3: error: unknown type name ‘bool’
bool visible; // cursor visible
^
test.c: In function ‘main’:
test.c:23:39: error: ‘KVMFR_DMABUF_GETSIZE’ undeclared (first use in this function)
unsigned long size = ioctl(fd, KVMFR_DMABUF_GETSIZE , 0);
^
test.c:23:39: note: each undeclared identifier is reported only once for each function it appears in
test.c:26:10: error: variable ‘create’ has initializer but incomplete type
struct kvmfr_dmabuf_create create =
^
test.c:28:5: error: unknown field ‘flags’ specified in initializer
.flags = KVMFR_DMABUF_FLAG_CLOEXEC,
^
test.c:28:15: error: ‘KVMFR_DMABUF_FLAG_CLOEXEC’ undeclared (first use in this function)
.flags = KVMFR_DMABUF_FLAG_CLOEXEC,
^
test.c:28:15: error: excess elements in struct initializer [-Werror]
test.c:28:15: note: (near initialization for ‘create’)
test.c:29:5: error: unknown field ‘offset’ specified in initializer
.offset = 0x0,
^
test.c:29:15: error: excess elements in struct initializer [-Werror]
.offset = 0x0,
^
test.c:29:15: note: (near initialization for ‘create’)
test.c:30:5: error: unknown field ‘size’ specified in initializer
.size = size,
^
test.c:30:15: error: excess elements in struct initializer [-Werror]
.size = size,
^
test.c:30:15: note: (near initialization for ‘create’)
test.c:26:30: error: storage size of ‘create’ isn’t known
struct kvmfr_dmabuf_create create =
^
test.c:32:25: error: ‘KVMFR_DMABUF_CREATE’ undeclared (first use in this function)
int dmaFd = ioctl(fd, KVMFR_DMABUF_CREATE, &create);
^
test.c:26:30: error: unused variable ‘create’ [-Werror=unused-variable]
struct kvmfr_dmabuf_create create =
^
cc1: all warnings being treated as errors
Makefile:13: recipe for target ‘test’ failed
make: *** [test] Error 1

I don’t really think that kvmfr.h file I’m using is correct but there isn’t one in https://github.com/gnif/LookingGlass/tree/master/module

1 Like

I pulled the Beta1 version instead and the code in that I was able to build.

Bleeding edge has some massive changes going in and there may be breakages like this. Thanks for reporting though as I will see about fixing the build.

1 Like