[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/53] build-sys: simplify AF_VSOCK check
From: |
Paolo Bonzini |
Subject: |
[PULL 38/53] build-sys: simplify AF_VSOCK check |
Date: |
Tue, 19 Apr 2022 07:50:54 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
meson.build | 23 ++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)
diff --git a/meson.build b/meson.build
index d92b633c5d..5a207ed0fb 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
--
2.35.1
- [PULL 23/53] include: move qemu_pipe() to osdep.h, (continued)
- [PULL 23/53] include: move qemu_pipe() to osdep.h, Paolo Bonzini, 2022/04/19
- [PULL 06/53] meson: use chardev_ss dependencies, Paolo Bonzini, 2022/04/19
- [PULL 07/53] meson: add util dependency for oslib-posix on freebsd, Paolo Bonzini, 2022/04/19
- [PULL 16/53] Replace qemu_real_host_page variables with inlined functions, Paolo Bonzini, 2022/04/19
- [PULL 14/53] include/qapi: add g_autoptr support for qobject types, Paolo Bonzini, 2022/04/19
- [PULL 19/53] util: rename qemu-error.c to match its header name, Paolo Bonzini, 2022/04/19
- [PULL 21/53] include: move TFR to osdep.h, Paolo Bonzini, 2022/04/19
- [PULL 24/53] include: move coroutine IO functions to coroutine.h, Paolo Bonzini, 2022/04/19
- [PULL 27/53] include: move cpu_exec* declarations to cpu-common.h, Paolo Bonzini, 2022/04/19
- [PULL 37/53] build-sys: drop ntddscsi.h check, Paolo Bonzini, 2022/04/19
- [PULL 38/53] build-sys: simplify AF_VSOCK check,
Paolo Bonzini <=
- [PULL 41/53] thread-posix: use monotonic clock for QemuCond and QemuSemaphore, Paolo Bonzini, 2022/04/19
- [PULL 40/53] thread-posix: remove the posix semaphore support, Paolo Bonzini, 2022/04/19
- [PULL 44/53] hyperv: SControl is optional to enable SynIc, Paolo Bonzini, 2022/04/19
- [PULL 52/53] target/i386: do not access beyond the low 128 bits of SSE registers, Paolo Bonzini, 2022/04/19
- [PULL 30/53] include: move qemu_get_vm_name() to sysemu.h, Paolo Bonzini, 2022/04/19
- [PULL 05/53] oslib: drop qemu_gettimeofday(), Paolo Bonzini, 2022/04/19
- [PULL 03/53] qga: replace qemu_gettimeofday() with g_get_real_time(), Paolo Bonzini, 2022/04/19
- [PULL 04/53] Replace qemu_gettimeofday() with g_get_real_time(), Paolo Bonzini, 2022/04/19
- [PULL 13/53] osdep: poison {HOST,TARGET}_WORDS_BIGENDIAN, Paolo Bonzini, 2022/04/19
- [PULL 09/53] meson: remove test-qdev-global-props dependency on testqapi, Paolo Bonzini, 2022/04/19