From debbugs-submit-bounces@debbugs.gnu.org Tue May 23 08:40:09 2023 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: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 63516@debbugs.gnu.org Subject: [PATCH Guile-Netlink 00/11] Add 'wait-for-link' and related code 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> X-Debbugs-Cc: Julien Lepiller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 63516 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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