From patchwork Fri Apr 12 07:26:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Meng X-Patchwork-Id: 1922879 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" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VJv8sa8X; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4VG7Rk3ZwGz1yYM for ; Fri, 12 Apr 2024 17:26:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 87E4041BCE; Fri, 12 Apr 2024 07:26:56 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1kN4DGO7tzUO; Fri, 12 Apr 2024 07:26:53 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E30D040175 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VJv8sa8X Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id E30D040175; Fri, 12 Apr 2024 07:26:52 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id B5F51C0077; Fri, 12 Apr 2024 07:26:52 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id B2058C0037 for ; Fri, 12 Apr 2024 07:26:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 91A42824D4 for ; Fri, 12 Apr 2024 07:26:51 +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 TtFpRRme6Cp4 for ; Fri, 12 Apr 2024 07:26:50 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=jmeng@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 949A7823E0 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 949A7823E0 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VJv8sa8X Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 949A7823E0 for ; Fri, 12 Apr 2024 07:26:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712906809; 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=OHlYZahGS37Hu/Awcj0ErHFYZxxl/EFb6LTmbAtlKPs=; b=VJv8sa8XyJLpwUxxpubUqdpjN5sbVrWJaKU/uxnPGHWzFtU+Ec5R71te4yTJQbAzyyzajk E05fvktN+REA4Sm+CfscaK/14BtT5o6fkrByZuv2TnT0fMtaIMA1yoqXFyDyaZmxTQYwyx E3XS32dSZZ/h409KBazK/C4L3NPQH9M= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-471-qpdpt453PeeOZDecBglcfw-1; Fri, 12 Apr 2024 03:26:48 -0400 X-MC-Unique: qpdpt453PeeOZDecBglcfw-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a52052809caso43940566b.2 for ; Fri, 12 Apr 2024 00:26:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712906807; x=1713511607; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=OHlYZahGS37Hu/Awcj0ErHFYZxxl/EFb6LTmbAtlKPs=; b=Lu3dLzgveF0VXq+lHQfwFbWKKp+LCXE3drl9o5LmLFzR7guQiBGKEDaoc/PnsU084S s81zvZAJ0K0UMnJ0VTkYeRbfBikrh4OcYRTcglZH1J09mA+7dO0hz36QoFPyrZHFrzkl r50B9hISTj3tnCvwe3r395C4IaMtbD4b1EDi+bSgdkBVYDmYt6baOn52n4fUGXnBCD2n ZpE0jdwMwHKkWD44Hn/KpQ4nFLCkq4coLXq4FgAQLpB/V2MI+9ks5x2EIYCLVas3mkQ1 4afX5mwcvVPJhx8N2nuC304riCzt4DarEwy6yiMISBIULiyV6IYJmJ6+dgJUBVM2kzGi GZow== X-Gm-Message-State: AOJu0YxLmG3iC/V4ov71UDeSd6e6FLntzOn1CAnDXMSPjV8jN/Xc8SUM jZ9FqQr7SMP1RMllBCU3cJiZIwQEeBAdeb+fph9UgnUKYeTjEX2RzLb6tUZLNz/+DTB01ABo637 s8wEC36fNslb5q1JhSTSAwFF8FMS5YI2S5/BQ7dp8zd98cliRgsDg2hc9J6P9ZQCDNgOP/KZOLe //KXc29yOhgEmd2DYg/KGdRzh+SHmt X-Received: by 2002:a17:907:e91:b0:a4e:57c5:e736 with SMTP id ho17-20020a1709070e9100b00a4e57c5e736mr1940353ejc.25.1712906806939; Fri, 12 Apr 2024 00:26:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHyr5XcgFx3b5X1YHjWG8sf5sVgbcnGIHDLf9s0N/xHpjm9t1r20aqeMJuGj8c58qL++rZ5nw== X-Received: by 2002:a17:907:e91:b0:a4e:57c5:e736 with SMTP id ho17-20020a1709070e9100b00a4e57c5e736mr1940327ejc.25.1712906806580; Fri, 12 Apr 2024 00:26:46 -0700 (PDT) Received: from positronik4lide.. ([87.122.58.150]) by smtp.gmail.com with ESMTPSA id t2-20020a1709064f0200b00a51dd500071sm1502373eju.169.2024.04.12.00.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 00:26:46 -0700 (PDT) From: jmeng@redhat.com To: dev@openvswitch.org, i.maximets@ovn.org, echaudro@redhat.com, ktraynor@redhat.com, aconole@redhat.com, rjarry@redhat.com Date: Fri, 12 Apr 2024 09:26:32 +0200 Message-Id: <20240412072638.712622-1-jmeng@redhat.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v9 0/6] Add global option to output JSON from ovs-appctl cmds. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Jakob Meng Changes compared to v8 [0]: * Use "unsigned int" for format_flags variable in pretty patch for ovs-appctl. * Fix --pretty option in appctl.py. [0] https://patchwork.ozlabs.org/project/openvswitch/list/?series=402629&archive=both&state=* Jakob Meng (6): Add global option for JSON output to ovs-appctl. python: Add global option for JSON output to Python tools. appctl: Add option '--pretty' for pretty-printing JSON output. python: Add option '--pretty' for pretty-printing JSON output. vswitchd: Add JSON output for 'list-commands' command. ofproto: Add JSON output for 'dpif/show' command. NEWS | 13 +++ lib/command-line.c | 36 +++++++ lib/command-line.h | 10 ++ lib/unixctl.c | 204 ++++++++++++++++++++++++++--------- lib/unixctl.h | 11 ++ ofproto/ofproto-dpif.c | 124 +++++++++++++++++++-- python/ovs/unixctl/client.py | 14 ++- python/ovs/unixctl/server.py | 45 +++++++- python/ovs/util.py | 8 ++ tests/appctl.py | 31 +++++- tests/ovs-vswitchd.at | 27 +++++ tests/pmd.at | 28 +++++ tests/unixctl-py.at | 8 ++ utilities/ovs-appctl.c | 122 ++++++++++++++++++--- 14 files changed, 599 insertions(+), 82 deletions(-)