From nobody Mon Feb 9 04:07:39 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1648813944502423.423777777173; Fri, 1 Apr 2022 04:52:24 -0700 (PDT) Received: from localhost ([::1]:41058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1naFpH-0005RB-4q for importer@patchew.org; Fri, 01 Apr 2022 07:52:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naFnL-0004dT-Cb for qemu-devel@nongnu.org; Fri, 01 Apr 2022 07:50:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1naFnE-0007cP-PC for qemu-devel@nongnu.org; Fri, 01 Apr 2022 07:50:21 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-392-ySSWvo26Ml-rdzx-fAQxuw-1; Fri, 01 Apr 2022 07:50:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 956F7101A52C; Fri, 1 Apr 2022 11:50:09 +0000 (UTC) Received: from localhost (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF7091402648; Fri, 1 Apr 2022 11:50:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648813812; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TzCXY70kRQWDSj46be26HH9vA/Qm313SZDJIHOT6ntw=; b=Key6hMMUGoIusJ1UW69A630RFjTrb7FVA1jlFRKWE3waBPBVDgYMJOxQ7dBC9nlmjIuD/c W8ZliOUHUu97QxOzwH4WBBYz1CDB5pnj/+hv9wJCb5W3sV+4bUfwVZBAsTHVky7hCdqIAn ZxjPH5ZzBhU3GZFjUzrhXFS2WID7JiQ= X-MC-Unique: ySSWvo26Ml-rdzx-fAQxuw-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Subject: [PATCH] build-sys: simplify AF_VSOCK check Date: Fri, 1 Apr 2022 15:50:05 +0400 Message-Id: <20220401115005.2204000-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=marcandre.lureau@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=marcandre.lureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: michael.roth@amd.com, stefanha@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1648813945846100001 From: Marc-Andr=C3=A9 Lureau 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=C3=A9 Lureau --- meson.build | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/meson.build b/meson.build index 46b5e938b196..e8c4f5255a3b 100644 --- a/meson.build +++ b/meson.build @@ -1988,25 +1988,10 @@ have_afalg =3D get_option('crypto_afalg') \ '''), error_message: 'AF_ALG requested but could not be detected').allow= ed() config_host_data.set('CONFIG_AF_ALG', have_afalg) =20 -config_host_data.set('CONFIG_AF_VSOCK', cc.compiles(gnu_source_prefix + ''' - #include - #include - #include - #if !defined(AF_VSOCK) - # error missing AF_VSOCK flag - #endif - #include - int main(void) { - int sock, ret; - struct sockaddr_vm svm; - socklen_t len =3D sizeof(svm); - sock =3D socket(AF_VSOCK, SOCK_STREAM, 0); - ret =3D getpeername(sock, (struct sockaddr *)&svm, &len); - if ((ret =3D=3D -1) && (errno =3D=3D ENOTCONN)) { - return 0; - } - return -1; - }''')) +config_host_data.set('CONFIG_AF_VSOCK', cc.has_header_symbol( + 'linux/vm_sockets.h', 'AF_VSOCK', + prefix: '#include ', +)) =20 have_vss =3D false have_vss_sdk =3D false # old xp/2003 SDK --=20 2.35.1.693.g805e0a68082a