[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/33] build-sys: add HAVE_IPPROTO_MPTCP
From: |
Paolo Bonzini |
Subject: |
[PULL 32/33] build-sys: add HAVE_IPPROTO_MPTCP |
Date: |
Tue, 28 Sep 2021 14:51:15 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The QAPI schema shouldn't rely on C system headers #define, but on
configure-time project #define, so we can express the build condition in
a C-independent way.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210907121943.3498701-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
io/dns-resolver.c | 2 +-
meson.build | 2 ++
qapi/sockets.json | 2 +-
util/qemu-sockets.c | 6 +++---
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/io/dns-resolver.c b/io/dns-resolver.c
index a5946a93bf..53b0e8407a 100644
--- a/io/dns-resolver.c
+++ b/io/dns-resolver.c
@@ -122,7 +122,7 @@ static int qio_dns_resolver_lookup_sync_inet(QIODNSResolver
*resolver,
.ipv4 = iaddr->ipv4,
.has_ipv6 = iaddr->has_ipv6,
.ipv6 = iaddr->ipv6,
-#ifdef IPPROTO_MPTCP
+#ifdef HAVE_IPPROTO_MPTCP
.has_mptcp = iaddr->has_mptcp,
.mptcp = iaddr->mptcp,
#endif
diff --git a/meson.build b/meson.build
index 978e8329f7..7f0fafff4a 100644
--- a/meson.build
+++ b/meson.build
@@ -1374,6 +1374,8 @@ config_host_data.set('HAVE_OPTRESET',
cc.has_header_symbol('getopt.h', 'optreset'))
config_host_data.set('HAVE_UTMPX',
cc.has_header_symbol('utmpx.h', 'struct utmpx'))
+config_host_data.set('HAVE_IPPROTO_MPTCP',
+ cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP'))
# has_member
config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID',
diff --git a/qapi/sockets.json b/qapi/sockets.json
index ef4b16d6f2..5773d9fcc4 100644
--- a/qapi/sockets.json
+++ b/qapi/sockets.json
@@ -69,7 +69,7 @@
'*ipv4': 'bool',
'*ipv6': 'bool',
'*keep-alive': 'bool',
- '*mptcp': { 'type': 'bool', 'if': 'IPPROTO_MPTCP' } } }
+ '*mptcp': { 'type': 'bool', 'if': 'HAVE_IPPROTO_MPTCP' } } }
##
# @UnixSocketAddress:
diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c
index 72216ef980..0585e7a629 100644
--- a/util/qemu-sockets.c
+++ b/util/qemu-sockets.c
@@ -278,7 +278,7 @@ static int inet_listen_saddr(InetSocketAddress *saddr,
/* create socket + bind/listen */
for (e = res; e != NULL; e = e->ai_next) {
-#ifdef IPPROTO_MPTCP
+#ifdef HAVE_IPPROTO_MPTCP
if (saddr->has_mptcp && saddr->mptcp) {
e->ai_protocol = IPPROTO_MPTCP;
}
@@ -462,7 +462,7 @@ int inet_connect_saddr(InetSocketAddress *saddr, Error
**errp)
error_free(local_err);
local_err = NULL;
-#ifdef IPPROTO_MPTCP
+#ifdef HAVE_IPPROTO_MPTCP
if (saddr->has_mptcp && saddr->mptcp) {
e->ai_protocol = IPPROTO_MPTCP;
}
@@ -699,7 +699,7 @@ int inet_parse(InetSocketAddress *addr, const char *str,
Error **errp)
}
addr->has_keep_alive = true;
}
-#ifdef IPPROTO_MPTCP
+#ifdef HAVE_IPPROTO_MPTCP
begin = strstr(optstr, ",mptcp");
if (begin) {
if (inet_parse_flag("mptcp", begin + strlen(",mptcp"),
--
2.31.1
- [PULL 17/33] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly, (continued)
- [PULL 17/33] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly, Paolo Bonzini, 2021/09/28
- [PULL 20/33] i386: acpi: Add SGX EPC entry to ACPI tables, Paolo Bonzini, 2021/09/28
- [PULL 19/33] i386/pc: Add e820 entry for SGX EPC section(s), Paolo Bonzini, 2021/09/28
- [PULL 29/33] target/i386: Fix memory leak in sev_read_file_base64(), Paolo Bonzini, 2021/09/28
- [PULL 03/33] hostmem: Add hostmem-epc as a backend for SGX EPC, Paolo Bonzini, 2021/09/28
- [PULL 21/33] q35: Add support for SGX EPC, Paolo Bonzini, 2021/09/28
- [PULL 23/33] sgx-epc: Add the fill_device_info() callback support, Paolo Bonzini, 2021/09/28
- [PULL 27/33] meson: unpack edk2 firmware even if --disable-blobs, Paolo Bonzini, 2021/09/28
- [PULL 24/33] docs/system: Add SGX documentation to the system manual, Paolo Bonzini, 2021/09/28
- [PULL 30/33] memory: Name all the memory listeners, Paolo Bonzini, 2021/09/28
- [PULL 32/33] build-sys: add HAVE_IPPROTO_MPTCP,
Paolo Bonzini <=
- [PULL 25/33] target/i386: Add HMP and QMP interfaces for SGX, Paolo Bonzini, 2021/09/28
- Re: [PULL 00/33] x86 and misc changes for 2021-09-28, Peter Maydell, 2021/09/29