From patchwork Thu May 16 10:19:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Meng X-Patchwork-Id: 1935926 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=H8cRg33z; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (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 4Vg5gd73pYz1ymw for ; Thu, 16 May 2024 20:19:57 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 41CF882531; Thu, 16 May 2024 10:19:56 +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 rTaZ6NF1KCwS; Thu, 16 May 2024 10:19:55 +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 smtp1.osuosl.org 32958824CB Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H8cRg33z Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 32958824CB; Thu, 16 May 2024 10:19:55 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D5040C0072; Thu, 16 May 2024 10:19:54 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id CC8AAC0037 for ; Thu, 16 May 2024 10:19:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id AD3444029B for ; Thu, 16 May 2024 10:19:52 +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 BwjFHkNG3rI9 for ; Thu, 16 May 2024 10:19:51 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.133.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=jmeng@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 2F26140204 Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 2F26140204 Authentication-Results: smtp2.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=H8cRg33z Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 2F26140204 for ; Thu, 16 May 2024 10:19:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715854789; 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=JGQ2klwPfGwaXhjSghCa4ZNn2h5uhhO1xG9mR75QerY=; b=H8cRg33zkB2ozHohd87F32q3EhdbFN1FzRQV2GaH0kowF9V/POLM2AMXF5mu0WMh+2fjNT 1WQXnXLn8vhy/1PHOVfnaXMwLBZtqrtLAr/fuxSpM/2sMu+y/lO0n1eH/ptxojX56EPFJe OciWexKgvPHvoPVbOcp0qczOweqbtv4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-552-GSgKE9YVOYykg1RtZGiamw-1; Thu, 16 May 2024 06:19:47 -0400 X-MC-Unique: GSgKE9YVOYykg1RtZGiamw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-42011360193so37640615e9.3 for ; Thu, 16 May 2024 03:19:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715854787; x=1716459587; 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=JGQ2klwPfGwaXhjSghCa4ZNn2h5uhhO1xG9mR75QerY=; b=kt+DPtdIr7Fp3icixFGJtRyI+ija1ki4UYCzQRiGR4HOL2VIG5TEhA2+CPauZAmwCU Hw537aEfA3MSosFDtIRuTE/mnXyTgR78CsEE1J+YaTsKhdOJlfY0h5qek4v8AVO3KP73 Ey7PqPLDjcxrojhWDHa1MqXsijz3C1MsyQdo8H845rqv7pOH+t+mDnwLktB4CcujfkS7 bjC3B4d6TbYMnJIekbEJwmr899LAYEmvfBxOlmPqAe+fvXwBZcXzHVCokI04DO1MStzV aoEZTmVrdbC5UOrDKCKKlrm08tUV+20BWYYPdOtc9eKOt3Qfh4HNIyVxUzhvpWHCOOe6 CK+g== X-Gm-Message-State: AOJu0YxxfV9dq18blZYHaIh/ySLDjmvpiiwwRk/0Wd4Mo8/QHwarpLbs jgxOIcdWo0miz6PSDF6sv/OWXSr1DZ1bZ8jJo1Yai62U59L0r0w6PUa1qtFh96zPbBVjmQaB8RF igZ9pV0rVPTaG6Y52R5YiViv/fr581uEhj7u8uAU1DkjR03mSnM9SMn4LYjlNHpIMkr5ZJfxXDg BDdLgzGPPvFw7J61LdpXi5nZWFRBLp X-Received: by 2002:a05:600c:5252:b0:420:f8:23d6 with SMTP id 5b1f17b1804b1-42000f82681mr175852445e9.36.1715854786871; Thu, 16 May 2024 03:19:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJtVb+GSrnqLkUFeM01ijiDmnWUBgm4+SA7mNbsSYhY5nJzzW+zbTRyBqQslDHp9R6e3CxGA== X-Received: by 2002:a05:600c:5252:b0:420:f8:23d6 with SMTP id 5b1f17b1804b1-42000f82681mr175852225e9.36.1715854786519; Thu, 16 May 2024 03:19:46 -0700 (PDT) Received: from positronik4lide.redhat.com ([87.122.57.114]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee934csm265507145e9.38.2024.05.16.03.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 03:19:46 -0700 (PDT) From: jmeng@redhat.com To: dev@openvswitch.org, i.maximets@ovn.org Date: Thu, 16 May 2024 12:19:33 +0200 Message-Id: <20240516101939.54900-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 v11 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 v11 has one tiny change compared to v10 [0]: * Added a missing newline at the end of utilities/ovs-appctl.c. [0] https://patchwork.ozlabs.org/project/openvswitch/list/?series=407002&archive=both&state=* Jakob Meng (6): Add global option for JSON output to ovs-appctl. python: Add option for JSON output to unixctl classes and appctl.py. appctl: Add option '--pretty' for pretty-printing JSON output. python: Add option for pretty-printing JSON output to appctl.py. vswitchd: Add JSON output for 'list-commands' command. ofproto: Add JSON output for 'dpif/show' command. Documentation/ref/ovs-appctl.8.rst | 19 +++ NEWS | 9 ++ lib/unixctl.c | 239 ++++++++++++++++++++++------- lib/unixctl.h | 20 ++- lib/util.c | 6 +- ofproto/ofproto-dpif.c | 120 +++++++++++++-- python/ovs/unixctl/client.py | 5 +- python/ovs/unixctl/server.py | 55 +++++-- python/ovs/util.py | 8 + tests/appctl.py | 40 ++++- tests/ovs-vswitchd.at | 29 ++++ tests/pmd.at | 23 +++ tests/unixctl-py.at | 8 + utilities/ovs-appctl.c | 152 +++++++++++++++--- 14 files changed, 625 insertions(+), 108 deletions(-)