aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-04-01 15:50:05 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-06 14:31:55 +0200
commit9d734b85ed8d89bb9ab8c456b4df23dedf8dbf76 (patch)
tree3ea874e82996ac71e2e620e0db31e3bcc0aeb648
parent3015321dc49a1e702a7fcc242ed7233d46d27209 (diff)
downloadqemu-9d734b85ed8d89bb9ab8c456b4df23dedf8dbf76.zip
qemu-9d734b85ed8d89bb9ab8c456b4df23dedf8dbf76.tar.gz
qemu-9d734b85ed8d89bb9ab8c456b4df23dedf8dbf76.tar.bz2
build-sys: simplify AF_VSOCK check
The current test checks more than AF_VSOCK availability, and doesn't need to be that long. Since its introduction in Linux in 2013, AF_VSOCK came with linux/vm_sockets.h for sockaddr_vm, let's check that. We could even go back to the initial configure-less approach proposed by Stefan Hajnoczi, since Michael Roth added the configure-time check back then to satisfy glibc in Ubuntu 14. See: https://lists.gnu.org/archive/html/qemu-devel/2016-10/msg08208.html Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220401115005.2204000-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--meson.build23
1 files changed, 4 insertions, 19 deletions
diff --git a/meson.build b/meson.build
index d92b633..5a207ed 100644
--- a/meson.build
+++ b/meson.build
@@ -1988,25 +1988,10 @@ have_afalg = get_option('crypto_afalg') \
'''), error_message: 'AF_ALG requested but could not be detected').allowed()
config_host_data.set('CONFIG_AF_ALG', have_afalg)
-config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + '''
- #include <errno.h>
- #include <sys/types.h>
- #include <sys/socket.h>
- #if !defined(AF_VSOCK)
- # error missing AF_VSOCK flag
- #endif
- #include <linux/vm_sockets.h>
- int main(void) {
- int sock, ret;
- struct sockaddr_vm svm;
- socklen_t len = sizeof(svm);
- sock = socket(AF_VSOCK, SOCK_STREAM, 0);
- ret = getpeername(sock, (struct sockaddr *)&svm, &len);
- if ((ret == -1) && (errno == ENOTCONN)) {
- return 0;
- }
- return -1;
- }'''))
+config_host_data.set('CONFIG_AF_VSOCK', cc.has_header_symbol(
+ 'linux/vm_sockets.h', 'AF_VSOCK',
+ prefix: '#include <sys/socket.h>',
+))
have_vss = false
have_vss_sdk = false # old xp/2003 SDK