From patchwork Thu Mar 19 14:27:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Panos Kostopoulos Kyrimis X-Patchwork-Id: 2213261 X-Patchwork-Delegate: i.maximets@samsung.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (4096-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20251003 header.b=brY5M2hT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4fc7MT4TZSz1y1P for ; Fri, 20 Mar 2026 01:27:47 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 20EEC40B8B; Thu, 19 Mar 2026 14:27:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id o5zBgkBREO_p; Thu, 19 Mar 2026 14:27:45 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 34A5940B8F Authentication-Results: smtp4.osuosl.org; dkim=fail reason="signature verification failed" (4096-bit key) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20251003 header.b=brY5M2hT Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 34A5940B8F; Thu, 19 Mar 2026 14:27:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 11C48C03FD; Thu, 19 Mar 2026 14:27:45 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A6426C03FC for ; Thu, 19 Mar 2026 14:27:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A423384237 for ; Thu, 19 Mar 2026 14:27:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id z94QSEc0LtvV for ; Thu, 19 Mar 2026 14:27:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.125.188.123; helo=smtp-relay-internal-1.canonical.com; envelope-from=panos.kostopouloskyrimis@canonical.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 5A036841FF Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=reject dis=none) header.from=canonical.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5A036841FF Authentication-Results: smtp1.osuosl.org; dkim=pass (4096-bit key, unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20251003 header.b=brY5M2hT Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by smtp1.osuosl.org (Postfix) with ESMTPS id 5A036841FF for ; Thu, 19 Mar 2026 14:27:41 +0000 (UTC) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 1295F3F98B for ; Thu, 19 Mar 2026 14:27:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20251003; t=1773930459; bh=F0L39NljUHWhV3neXVPZQlx53ceDHCttyI5jRBZinQk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=brY5M2hTlLz/i54FcQ2iTonT14lY+SM3ffqq6RVWgidv7fvx7uh6aQxtkTU8SmMYk P05diNEKxQUL/MmT4ln6gzGrKVK0qyaik2f+a1XFdO58UPO61nAiEeAp5oTsh0Ul7B kjlyExiMtIQNqCOaNXVpJFqFF4H82aDeStl1p1VPgX6jEbNDfnLmXQjJlXT4vwH2X/ 9KfH1wNLYHYkejOCcJT8rzca3Z1hWzqMLFEa43HVyyX3a55itfGNnLkYBwjxTC6IlB DRztuN7aH97GCOM8ebFX7NS022sRKKzuyfwRY7wuIRZ+wPJVpmG9g+4Qt1u7vYEx85 aCZsZrQItCbnAEkV56lX0OWlaacwL2BI5JYt6jwOZhC+sOCyjVNiGMjoI6V75XenQo DFjhbKFBj8bV/Y32FNw5fdvKzZ8A3lU7sbIgsmg4feo5BOSZtTN5sI6ZQDFGUdOWPy syTkh78JoPX6gSWRP03lxqvB5WwVw4g5dfPn+kPOiKVglQ54EjqpD7BbilWNN1sxES UOTbZRSsLQtwUJhnxegt4YaZkYxrMjSsiS+K3Np+VfrzzNwcRlHNgQ9klZZVt8GoT5 Kb3wVTM/Xm3KgKPjXTJHPb2w9g3YiSG0LWsYiEp1V/bJDtzUriGM9XHYlV/g3OdFwL svTwtpcuvX39gjcigy1tbsDM= Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-439c794ec8eso696619f8f.1 for ; Thu, 19 Mar 2026 07:27:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773930458; x=1774535258; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=F0L39NljUHWhV3neXVPZQlx53ceDHCttyI5jRBZinQk=; b=TuWXcXm2Ohux1DTdwGEgibC3pPYHnKlsZrsjZT1dewjsNuQu9BnCtrChAT7c4QhGVM IVp7vt51bDld4KdkYjRQ499KpfBY7stEwiJHDPNJM7a5wqY1FVZRbjxYav+dSKG3ys4P caGTLez+8YkT1IFXt5iXIVKu3/FhVTimPVnhqXwj6VSKfIqa2jgKGXxVq7vTG1fRceWU EFSedqWoZczaFYOAQkBN50ucHHGHXNwdmfYxNJ8F74ipjJvnqEOnCTm7iOYhM5w7dBqp 2znNFd7fexuXxaYugG/NKbZxcaXowKsaw+ZkLFxcls7OFbXkofMB73SMzRAMk5Asb3Dg XYRQ== X-Gm-Message-State: AOJu0YxA5/jfuCFTTwLamDchzAXDYJfXxz+LzzG76xqixcPSRCjtHdBc AfkjouI3WnSx4nudDnP/EZVllsQqeHQZ6I/l1XAEXMEybdvS7wZwBvzW8Qk6yNSi/qd7KDWZlYk R3WvIuMWjBfZYvzoCTtc0l9CuZ0KuV4URCuI22NnuxCQXH2jHGFy9Vp6BeXXyEbcNB6nzhN2Wyj 95XA== X-Gm-Gg: ATEYQzyWYR92Gbbo2VAFI2g25YqihDycYKNG4Gcf/amAjenD7+Ee9IwxHB8qy61U/7a QZ+ArkjkKfox1pD8uJ4ukBp/9JC1uUZ26J6794tuez3BNo47CATPiigdqsoAcEfnnW2xSyonjcI Z8ERXehhESmW7oL0sAiHujVyzJlFVAN652vMIFL6tvM9+sliqrHvlLn0vBNJEXagMMVpIDlU4QE EzUKFaflCPcHOCOILTw4ay8mLbebG/3OgFPMtJTB/m2H/3mIDWWia2/ds4eZ+qTxrV3knv8ocs2 oDQEaMEP66r3KcYjomi9M0WGWRdspN6biyViebpwQapPVqFw0OJsNodKG1vsqdyO+j4bxhYARa5 kEgRxOdpXpbWTh1CeRCV7eO6Xf4dlI5yfGOYO+8YAe4zsb0WYXaoFLyuOzL8prC3JU6k/qHAkQU kfNrI932ChknE= X-Received: by 2002:a05:6000:2381:b0:439:b79d:b99f with SMTP id ffacd0b85a97d-43b527c792bmr11924039f8f.40.1773930446906; Thu, 19 Mar 2026 07:27:26 -0700 (PDT) X-Received: by 2002:a05:6000:2381:b0:439:b79d:b99f with SMTP id ffacd0b85a97d-43b527c792bmr11922101f8f.40.1773930432477; Thu, 19 Mar 2026 07:27:12 -0700 (PDT) Received: from localhost.localdomain (athedsl-128301.home.otenet.gr. [85.75.76.204]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b51849636sm16028859f8f.8.2026.03.19.07.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2026 07:27:12 -0700 (PDT) To: dev@openvswitch.org Date: Thu, 19 Mar 2026 14:27:09 +0000 Message-ID: <20260319142709.317535-1-panos.kostopouloskyrimis@canonical.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH v2] ovsdb-client: Allow multiple servers in ovsdb-client wait. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Panos Kostopoulos Kyrimis via dev From: Panos Kostopoulos Kyrimis Reply-To: Panos Kostopoulos Kyrimis Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Unlike other ovsdb-client commands such as needs-conversion, wait does not accept multiple servers, causing users to run multiple ovsdb-client and wait for each server until one is connected. Reported-at: https://bugs.launchpad.net/bugs/2127931 Signed-off-by: Panos Kostopoulos Kyrimis --- Looking at the example of needs-conversion, since I was going to add this feature, I thought maybe it would be beneficial to try use the open_rpc function in do_wait as well. At start it seamed like the transition would be easy as the code is similar. I tried some approaches with no result. An issue was open_rpc in a single server calls open_jsonrpc which basically is blocking request/receive, while in the case of multiple servers it uses jsonrpc_session_open + jsonrpc_session_run in a loop. Another issue is the retry flag which is false in open_rpc (but could be fixed with the addition of a retry boolean in open_rpc). I wonder if my addition is sufficient, or removing code duplication from do_wait is as important (if open_rpc can be used in this case that is). In the latter case I would need some guidance as to how to approach this as the number of available options for rpc connections is overwhelming. ovsdb/ovsdb-client.1.in | 4 ++-- ovsdb/ovsdb-client.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ovsdb/ovsdb-client.1.in b/ovsdb/ovsdb-client.1.in index c15804597..7ce650159 100644 --- a/ovsdb/ovsdb-client.1.in +++ b/ovsdb/ovsdb-client.1.in @@ -314,8 +314,8 @@ to check for databases that have not yet been added to the server, so that the \fBovsdb\-client\fR semantics of acting on a default database do not work. .IP -This command acts on a particular database server, not on a cluster, -so \fIserver\fR must name a single server, not a comma-delimited list +This command acts on a particular database server, as well as on a cluster, +so \fIserver\fR can name a single server, or a comma-delimited list of servers. .SS "Testing commands" These commands are mostly of interest for testing the correctness diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index 37cfa8b56..a33ba6165 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -2453,9 +2453,17 @@ do_wait(struct jsonrpc *rpc_unused OVS_UNUSED, ovs_fatal(0, "%s: unknown state", state); } - char *remote = argc > 2 ? xstrdup(argv[0]) : default_remote(); - struct jsonrpc_session *js = jsonrpc_session_open(remote, true); - free(remote); + struct svec remotes = SVEC_EMPTY_INITIALIZER; + struct uuid cid = UUID_ZERO; + + if (argc > 2) { + ovsdb_session_parse_remote(argv[0], &remotes, &cid); + } else { + svec_add_nocopy(&remotes, default_remote()); + } + + struct jsonrpc_session *js = jsonrpc_session_open_multiple(&remotes, true); + svec_destroy(&remotes); unsigned int seqno = 0; struct json *sdca_id = NULL;