From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KDBBG3u0bGR7jAAASxT56A (envelope-from ) for ; Tue, 23 May 2023 14:41:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id EC5CG3u0bGRU9gAA9RJhRA (envelope-from ) for ; Tue, 23 May 2023 14:41:31 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0F9B638AAC for ; Tue, 23 May 2023 14:41:31 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RKC-0001jK-T6; Tue, 23 May 2023 08:41:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RK6-0001gq-BW for bug-guix@gnu.org; Tue, 23 May 2023 08:41:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RK5-0003W4-9G for bug-guix@gnu.org; Tue, 23 May 2023 08:41:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q1RK2-00035I-Be; Tue, 23 May 2023 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63516: [PATCH Guile-Netlink 00/11] Add 'wait-for-link' and related code Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: julien@lepiller.eu, bug-guix@gnu.org Resent-Date: Tue, 23 May 2023 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63516 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 63516@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Julien Lepiller X-Debbugs-Original-Xcc: Julien Lepiller Received: via spool by 63516-submit@debbugs.gnu.org id=B63516.168484560911629 (code B ref 63516); Tue, 23 May 2023 12:41:02 +0000 Received: (at 63516) by debbugs.gnu.org; 23 May 2023 12:40:09 +0000 Received: from localhost ([127.0.0.1]:38505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1RJA-00031O-I3 for submit@debbugs.gnu.org; Tue, 23 May 2023 08:40:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:32854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q1RJ8-00030k-9s for 63516@debbugs.gnu.org; Tue, 23 May 2023 08:40:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RJ2-0002xJ-DF; Tue, 23 May 2023 08:40:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=WH2ukp0IY3xywm4UMyPb7cfN0ir8Np+sNLR7HLpaUgM=; b=JRWdSsWzFzR3xZuDT2Jl wKAtyrQkeeZn0ODGShbY7EW8pytEq8C0UnwgptEPpt8a8binU0iurF/acbrJqh5eipy9QHrKHuPHP +a1E6e2WMqmKAeJiPFRrwNI67kWUY8EvZI/f2wWqQ2CHk7FmtsB02NUHqAMwXr3EYA70bjWVb/Dfr 8AAEwrgAilZM9JhFqtU6Sud4euKbb10QZ4vefPa2dSgQvAtu4vQG5TP0XvCDgtqoDvvu+3OJE0OQ2 t8qn3HEoAoKSToYYOej7RAXnBve/Z7dg4iO2HG+3pyiACf/TTg5gsjXKyhBK8ldicc86A6/h+/XdK 334To9AV25KWaQ==; Received: from [193.50.110.247] (helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RJ1-00081G-Vt; Tue, 23 May 2023 08:40:00 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 23 May 2023 14:39:40 +0200 Message-Id: <20230523123951.6225-1-ludo@gnu.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <871qjawqpt.fsf@gnu.org> References: <871qjawqpt.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684845691; a=rsa-sha256; cv=none; b=tJh98LJhvO0T+/9ieGPNp4L7L5WRgP1EPwGayP0wyqtbAxs7v/lFwXUtUNjH21PQ9uRNwk x/oqKvQR3EjtHb5H7ceErD9fuM4hq7YcMfRMyxz72JJp+5LG1JinidODA4l3MVnBQtf9vI V/ibMFDyg+FI932Ud7Z1a4EvZn9V4NPn0vBZmwyCXYCEFkqjVmxZBa62jUW1eQjilITjJs ggr9lHpkW6U7jBSAazUJT29u0PXMAvwL7I+s4rqNNDoKg7DyX1L6aVFjH0yxDA8INOYxu9 tKvNJRTtCsHB38h3HyC3KnZaUbMtrV/CqKp0/Ob5LlY4SEWDMnNDF+zORLB+tw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=JRWdSsWz; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684845691; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WH2ukp0IY3xywm4UMyPb7cfN0ir8Np+sNLR7HLpaUgM=; b=AyLqAqKeOlXaQ2740awokD+E41h4Jv9GddrTHk4zVI/wq4yPhfFtfPQ7Sxax7E0vcmS9vy xbfIiMACup9WMa4fMNwlHapk5SzKcpwQSkCPZZEjJuP19GXPBSmWxuwGFIabA12OlWFDh5 xdWZbl5teezfN6CuoJ2Sk2kC8od0YQHGpqGSe81eCXw6KNGNfcPuMIFEqIVxWSB9Kjys1e tYWdAuGsT2QqDjMVRDewDotQBCbaOnqLU9aGvNrGRj5aGa3UlUVRFsLfAnMe2ds0fBlrpu 21pSM0SSmRsbOIB8lhhBR+H6kauZuvPo98HiV8iBWAk+X5LvnAvJDVkL6kHYSw== X-Migadu-Spam-Score: -2.37 X-Spam-Score: -2.37 X-Migadu-Queue-Id: 0F9B638AAC X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=JRWdSsWz; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: E9KsQiVInFAI Hi Julien, As a followup to , here is code that lets us wait for a link to show up “the right way”—i.e., without polling. It works over SOCK_NONBLOCK sockets, for use in Fibers programs. I tested it in a VM created with ‘guix system vm’. If the “ens3” device is already there, (wait-for-link "ens3") returns immediately. Then I ran “rmmod e1000” to make the device disappear, and made another (wait-for-link "ens3") call: that call returns once I’ve run “modprobe e1000” in another terminal. Wonderful. :-) Now, it would be good to have a test suite that can run without complicated setups. We should check the strategy used by libnl, systemd, and the likes. Thoughts? Ludo’. Ludovic Courtès (11): connection: Remove unused procedure. connection: Use Guile's 'socket' procedure to open a socket. connection: Throw upon errors in FFI bindings. connection: Add support for suspendable sockets. connection: Allow users to pass extra SOCK_ flags to 'socket'. link: Extract 'new-link-message->link'. addr: Extract 'new-address-message->address'. connection: Add 'add-socket-membership'. error: Add 'sub-type' field to '&netlink-decoder-error' and use it. doc: Add indexes. link: Add 'wait-for-link'. doc/guile-netlink.texi | 51 +++++++++++++++-- ip/addr.scm | 46 +++++++-------- ip/link.scm | 122 ++++++++++++++++++++++++++++++--------- ip/route.scm | 6 +- netlink/connection.scm | 126 +++++++++++++++++++++++++++-------------- netlink/constant.scm | 40 +++++++++++++ netlink/data.scm | 13 +++-- netlink/error.scm | 4 +- 8 files changed, 303 insertions(+), 105 deletions(-) base-commit: beceb4cfea4739954e558411f46e07425891c774 -- 2.40.1