aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorLongpeng(Mike) <longpeng2@huawei.com>2017-07-14 14:04:05 -0400
committerDaniel P. Berrange <berrange@redhat.com>2017-07-19 10:11:05 +0100
commitf0d92b56d8831de4b7df43ed3e6404cae5d42ed8 (patch)
tree47820eb4b7e250e74e3f0f92ea405df2db70e6f3 /configure
parent14a5a2aef47e27b6afd1f8855eb41c75b69440dc (diff)
crypto: introduce some common functions for af_alg backend
The AF_ALG socket family is the userspace interface for linux crypto API, this patch adds af_alg family support and some common functions for af_alg backend. It'll be used by afalg-backend crypto latter. Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com> Maintainer: modified to report an error if AF_ALG is requested but cannot be supported Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure37
1 files changed, 37 insertions, 0 deletions
diff --git a/configure b/configure
index e8798cec79..cd0db0b7f3 100755
--- a/configure
+++ b/configure
@@ -375,6 +375,7 @@ libnfs=""
coroutine=""
coroutine_pool=""
debug_stack_usage="no"
+crypto_afalg="no"
seccomp=""
glusterfs=""
glusterfs_xlator_opt="no"
@@ -1124,6 +1125,10 @@ for opt do
;;
--enable-debug-stack-usage) debug_stack_usage="yes"
;;
+ --enable-crypto-afalg) crypto_afalg="yes"
+ ;;
+ --disable-crypto-afalg) crypto_afalg="no"
+ ;;
--disable-docs) docs="no"
;;
--enable-docs) docs="yes"
@@ -1518,6 +1523,7 @@ disabled with --disable-FEATURE, default is enabled if available:
qom-cast-debug cast debugging support
tools build qemu-io, qemu-nbd and qemu-image tools
vxhs Veritas HyperScale vDisk backend support
+ crypto-afalg Linux AF_ALG crypto backend driver
NOTE: The object files are built at the place where configure is launched
EOF
@@ -4834,6 +4840,32 @@ if compile_prog "" "" ; then
have_af_vsock=yes
fi
+##########################################
+# check for usable AF_ALG environment
+hava_afalg=no
+cat > $TMPC << EOF
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+int main(void) {
+ int sock;
+ sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
+ return sock;
+}
+EOF
+if compile_prog "" "" ; then
+ have_afalg=yes
+fi
+if test "$crypto_afalg" = "yes"
+then
+ if test "$have_afalg" != "yes"
+ then
+ error_exit "AF_ALG requested but could not be detected"
+ fi
+fi
+
+
#################################################
# Sparc implicitly links with --relax, which is
# incompatible with -r, so --no-relax should be
@@ -5315,6 +5347,7 @@ echo "seccomp support $seccomp"
echo "coroutine backend $coroutine"
echo "coroutine pool $coroutine_pool"
echo "debug stack usage $debug_stack_usage"
+echo "crypto afalg $crypto_afalg"
echo "GlusterFS support $glusterfs"
echo "gcov $gcov_tool"
echo "gcov enabled $gcov"
@@ -5826,6 +5859,10 @@ if test "$debug_stack_usage" = "yes" ; then
echo "CONFIG_DEBUG_STACK_USAGE=y" >> $config_host_mak
fi
+if test "$crypto_afalg" = "yes" ; then
+ echo "CONFIG_AF_ALG=y" >> $config_host_mak
+fi
+
if test "$open_by_handle_at" = "yes" ; then
echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak
fi