From: Paolo Bonzini <pbonzini@redhat.com>
To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org
Cc: berrange@redhat.com, armbru@redhat.com, stefanha@redhat.com
Subject: Re: [RFC v3 02/32] build-sys: add HAVE_IPPROTO_MPTCP
Date: Mon, 13 Sep 2021 15:02:30 +0200 [thread overview]
Message-ID: <50b16dfb-f625-1bf3-00bb-6bae9fb392cf@redhat.com> (raw)
In-Reply-To: <20210907121943.3498701-3-marcandre.lureau@redhat.com>
On 07/09/21 14:19, marcandre.lureau@redhat.com wrote:
> 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>
> ---
> meson.build | 2 ++
> qapi/sockets.json | 2 +-
> io/dns-resolver.c | 2 +-
> util/qemu-sockets.c | 6 +++---
> 4 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/meson.build b/meson.build
> index 9e43c9b311..6e871af4d0 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -1367,6 +1367,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 7866dc27d6..c9101f937f 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/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/util/qemu-sockets.c b/util/qemu-sockets.c
> index f2f3676d1f..02eb2f3d34 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"),
>
Queued, thanks.
Paolo
next prev parent reply other threads:[~2021-09-13 13:27 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-07 12:19 [RFC v3 00/32] Rust binding for QAPI and qemu-ga QMP handler examples marcandre.lureau
2021-09-07 12:19 ` [RFC v3 01/32] RFC: docs: add supported host CPUs section marcandre.lureau
2021-09-07 12:33 ` Peter Maydell
2021-09-13 11:32 ` Marc-André Lureau
2021-09-13 11:46 ` Peter Maydell
2021-09-07 12:19 ` [RFC v3 02/32] build-sys: add HAVE_IPPROTO_MPTCP marcandre.lureau
2021-09-08 12:01 ` Markus Armbruster
2021-09-13 13:02 ` Paolo Bonzini [this message]
2021-09-07 12:19 ` [RFC v3 03/32] scripts/qapi: teach c_param_type() to return const argument type marcandre.lureau
2021-09-08 12:10 ` Markus Armbruster
2021-09-08 14:33 ` Marc-André Lureau
2021-09-07 12:19 ` [RFC v3 04/32] glib-compat: add G_SIZEOF_MEMBER marcandre.lureau
2021-09-08 12:16 ` Markus Armbruster
2021-09-08 13:49 ` Marc-André Lureau
2021-09-07 12:19 ` [RFC v3 05/32] scripts/qapi: add QAPISchemaVisitor.visit_module_end marcandre.lureau
2021-09-08 12:26 ` Markus Armbruster
2021-09-07 12:19 ` [RFC v3 06/32] scripts/qapi: add a CABI module marcandre.lureau
2021-09-07 12:19 ` [RFC v3 07/32] scripts/qapi: generate CABI dump for C types marcandre.lureau
2021-09-07 12:19 ` [RFC v3 08/32] tests: build qapi-cabi (C ABI dump) marcandre.lureau
2021-09-07 12:19 ` [RFC v3 09/32] build-sys: add i686 cpu target marcandre.lureau
2021-09-08 13:45 ` Peter Maydell
2021-09-07 12:19 ` [RFC v3 10/32] build-sys: add --with-rust{-target} & basic build infrastructure marcandre.lureau
2021-09-08 14:00 ` Peter Maydell
2021-09-08 14:21 ` Marc-André Lureau
2021-09-07 12:19 ` [RFC v3 11/32] build-sys: add a cargo-wrapper script marcandre.lureau
2021-09-07 12:19 ` [RFC v3 12/32] rust: provide a common crate for QEMU marcandre.lureau
2021-09-10 1:18 ` Alistair Francis
2021-09-10 7:43 ` Marc-André Lureau
2021-09-13 17:11 ` Paolo Bonzini
2021-09-14 11:34 ` Marc-André Lureau
2021-09-07 12:19 ` [RFC v3 13/32] rust: use vendored-sources marcandre.lureau
2021-09-08 15:38 ` Ian Jackson
2021-09-08 15:47 ` Marc-André Lureau
2021-09-08 15:55 ` Ian Jackson
2021-09-08 16:15 ` Marc-André Lureau
2021-09-08 16:22 ` Peter Maydell
2021-09-08 16:22 ` Ian Jackson
2021-09-08 16:20 ` Marc-André Lureau
2021-09-08 16:29 ` Ian Jackson
2021-09-08 16:34 ` Marc-André Lureau
2021-09-08 16:50 ` Ian Jackson
2021-09-08 19:33 ` Marc-André Lureau
2021-09-09 16:02 ` Peter Maydell
2021-09-09 16:29 ` Marc-André Lureau
2021-09-09 16:53 ` Daniel P. Berrangé
2021-09-09 17:04 ` Ian Jackson
2021-09-13 14:21 ` Paolo Bonzini
2021-09-09 16:49 ` Daniel P. Berrangé
2021-09-09 17:02 ` Ian Jackson
2021-09-07 12:19 ` [RFC v3 14/32] scripts/qapi: add QAPISchemaIfCond.rsgen() marcandre.lureau
2021-09-08 12:33 ` Markus Armbruster
2021-09-08 14:06 ` Marc-André Lureau
2021-09-07 12:19 ` [RFC v3 15/32] scripts/qapi: strip trailing whitespaces marcandre.lureau
2021-09-07 12:19 ` [RFC v3 16/32] scripts/qapi: add Rust FFI bindings generation marcandre.lureau
2021-09-07 12:19 ` [RFC v3 17/32] scripts/qapi: learn to generate ABI dump for Rust FFI marcandre.lureau
2021-09-07 12:19 ` [RFC v3 18/32] tests: generate Rust bindings marcandre.lureau
2021-09-07 12:19 ` [RFC v3 19/32] tests: check Rust and C CABI diffs marcandre.lureau
2021-09-07 12:19 ` [RFC v3 20/32] scripts/qapi: generate high-level Rust bindings marcandre.lureau
2021-09-07 12:19 ` [RFC v3 21/32] tests/rust: build a common library, checking bindings compile marcandre.lureau
2021-09-07 12:19 ` [RFC v3 22/32] qga: build qapi-cabi binary (ABI from C) marcandre.lureau
2021-09-07 12:19 ` [RFC v3 23/32] qga/rust: build and link an empty static library marcandre.lureau
2021-09-07 12:19 ` [RFC v3 24/32] qga/rust: generate QGA QAPI types FFI bindings marcandre.lureau
2021-09-07 12:19 ` [RFC v3 25/32] qga/rust: build a qga-cabi-rs executable (ABI from Rust) marcandre.lureau
2021-09-07 12:19 ` [RFC v3 26/32] qga/rust: check the Rust C binding marcandre.lureau
2021-09-07 12:19 ` [RFC v3 27/32] qga/rust: build high-level Rust QAPI types marcandre.lureau
2021-09-07 12:19 ` [RFC v3 28/32] qga/rust: implement get-host-name in Rust (example) marcandre.lureau
2021-09-07 12:19 ` [RFC v3 29/32] qga/rust: implement {get,set}-vcpus " marcandre.lureau
2021-09-07 12:19 ` [RFC v3 30/32] tests/vm: add Rust to FreeBSD VM marcandre.lureau
2021-09-07 12:19 ` [RFC v3 31/32] tests/vm: bump fedora VM to f32 marcandre.lureau
2021-09-07 12:19 ` [RFC v3 32/32] tests/vm: add Rust to Fedora marcandre.lureau
2021-09-08 13:22 ` [RFC v3 00/32] Rust binding for QAPI and qemu-ga QMP handler examples Markus Armbruster
2021-09-08 13:55 ` Marc-André Lureau
2021-09-09 10:31 ` Markus Armbruster
2021-09-09 15:22 ` Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50b16dfb-f625-1bf3-00bb-6bae9fb392cf@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).