This repository was archived by the owner on Feb 8, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,11 @@ AC_SUBST(SYSTEMD_SYSTEMUNIT)
7474AM_CONDITIONAL(SYSTEMD, test "x${SYSTEMD_SYSTEMUNIT}" != "xno" )
7575
7676AC_CHECK_FILE ( [ /usr/include/linux/vm_sockets.h] ,
77- [ ] , [ AC_MSG_ERROR ( Cannot find linux/vm_sockets.h ) ] )
77+ [ have_vsock=yes] , [ have_vsock=no] )
78+ if test "x$have_vsock" == "xyes"; then
79+ AC_DEFINE_UNQUOTED ( [ HAVE_VSOCK] , 1 , [ enable vm socket support] )
80+ fi
81+ AM_CONDITIONAL([ HAVE_VSOCK] , [ test "x$have_vsock" == "xyes"] )
7882
7983AC_CONFIG_FILES ( [
8084 Makefile
@@ -91,6 +95,8 @@ AC_MSG_RESULT([
9195 with-vbox: ${with_vbox}
9296 with-aarch64: ${with_aarch64}
9397
98+ vsock-support: ${have_vsock}
99+
94100 compiler: ${CC}
95101 cflags: ${CFLAGS}
96102 suid cflags: ${SUID_CFLAGS}
Original file line number Diff line number Diff line change 11AM_CFLAGS = -Wall -Werror
22bin_PROGRAMS =hyperstart
3- hyperstart_SOURCES =init.c jsmn.c net.c util.c parse.c parson.c container.c exec.c event.c portmapping.c vsock.c
3+ hyperstart_SOURCES =init.c jsmn.c net.c util.c parse.c parson.c container.c exec.c event.c portmapping.c
4+ if HAVE_VSOCK
5+ hyperstart_SOURCES+ =vsock.c
6+ endif
Original file line number Diff line number Diff line change 22#define _VSOCK_H_
33
44#include "event.h"
5+ #include "../config.h"
56
7+ #ifdef HAVE_VSOCK
68int probe_vsock_device (void );
79int hyper_create_vsock_listener (unsigned short port );
810int hyper_vsock_accept (struct hyper_event * he , int efd ,
911 struct hyper_event * ne , struct hyper_event_ops * ops );
12+ #else /*HAVE_VSOCK*/
13+ static int probe_vsock_device (void )
14+ {
15+ return -1 ;
16+ }
17+ static int hyper_create_vsock_listener (unsigned short port )
18+ {
19+ return -1 ;
20+ }
21+ static int hyper_vsock_accept (struct hyper_event * he , int efd ,
22+ struct hyper_event * ne , struct hyper_event_ops * ops )
23+ {
24+ return -1 ;
25+ }
26+
27+ #endif /*HAVE_VSOCK*/
1028
1129#endif
You can’t perform that action at this time.
0 commit comments