get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2218258/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2218258,
    "url": "http://patchwork.ozlabs.org/api/patches/2218258/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260331194202.1722082-7-vipinsh@google.com/",
    "project": {
        "id": 70,
        "url": "http://patchwork.ozlabs.org/api/projects/70/?format=api",
        "name": "Linux KVM RISC-V",
        "link_name": "kvm-riscv",
        "list_id": "kvm-riscv.lists.infradead.org",
        "list_email": "kvm-riscv@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "http://lists.infradead.org/pipermail/kvm-riscv/",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260331194202.1722082-7-vipinsh@google.com>",
    "list_archive_url": null,
    "date": "2026-03-31T19:41:59",
    "name": "[v4,6/9] KVM: selftests: Add various print flags to KVM selftest runner",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8f226ff3226ef238e67b7c1c87432773ff2e0b67",
    "submitter": {
        "id": 86282,
        "url": "http://patchwork.ozlabs.org/api/people/86282/?format=api",
        "name": "Vipin Sharma",
        "email": "vipinsh@google.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260331194202.1722082-7-vipinsh@google.com/mbox/",
    "series": [
        {
            "id": 498244,
            "url": "http://patchwork.ozlabs.org/api/series/498244/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/list/?series=498244",
            "date": "2026-03-31T19:41:53",
            "name": "KVM: selftests: Create KVM selftests runner",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/498244/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2218258/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2218258/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=aX0z9yh5;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256\n header.s=20251104 header.b=rZ/M8s4c;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fldn06vcVz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 01 Apr 2026 06:42:28 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w7eyp-0000000DUSV-1lmE;\n\tTue, 31 Mar 2026 19:42:27 +0000",
            "from mail-pj1-x104a.google.com ([2607:f8b0:4864:20::104a])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1w7eym-0000000DUPr-3fGV\n\tfor kvm-riscv@lists.infradead.org;\n\tTue, 31 Mar 2026 19:42:26 +0000",
            "by mail-pj1-x104a.google.com with SMTP id\n 98e67ed59e1d1-35c0cbe0f64so17569357a91.0\n        for <kvm-riscv@lists.infradead.org>;\n Tue, 31 Mar 2026 12:42:24 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID:\n\tReferences:Mime-Version:In-Reply-To:Date:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Owner;\n\tbh=MBsW3Dp0QIVeCccLJZQ2oe/Uzf3avP0QdYpC50oO9qw=; b=aX0z9yh58nwlM2QxzZiCH6c1Px\n\tUlhG216AeZSToONz4XC8v2s/RyEySdFIx1pWbcv0XrjMDq19ZTtjFM3izQnIFnCQaVjWdkgaB05/H\n\tRPzvR/1jOIbdRk2qxOYPa6cBMsjzDMF8XoIQT9c6isoqXxKirCZUxEeLHmFpf3obsDf8850bVOYvq\n\tBL4ReMFJre42SQ5LCp/umEdL8n0EN+kdOzq0CmhinMFpd+r1D6x2J0BW471anwQGkTiRPEhcy6dSd\n\t7m7ZYlmkZFSEpaKvYaO6NOP26khUtynbKuXUKek0gN5PNyrRfTO4OCPhtqUp6BmIiTsXBbWkXANoU\n\thYCUIGNg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=google.com; s=20251104; t=1774986144; x=1775590944;\n darn=lists.infradead.org;\n        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to\n         :date:from:to:cc:subject:date:message-id:reply-to;\n        bh=SmS1uHrhcJAkZ/77nv6KxNChDlZ5TAlHKr2qEzAIUF0=;\n        b=rZ/M8s4cw/r1itpg6KkUZzVQbk64QLvYxDY595vFo04Tb76+tQY+a1eCThrCYce7Pz\n         6e7Vb8t+uHedqFOcuLiQfmFBX9fMx0oAUQKfipolSVvQVSn9LO8ix931s51Ooq/CFFpn\n         ND9kRswLtB+0fY7UEEJOGh/SJy9a9e9vzeHBHdXmTeD1tBO2rcnE2n+KsxlsYkV340Tr\n         CjiQ819ycqZJm6tgEyXGNQoB8D+ZJw6wiYw3oKttPjCivhBX42JulSUqyc9HDB1NCSAk\n         PKIRbfe9awPh+C0goYbxO5CviT+B6P6qTPE/ai1FoklrrTrVu5/X5NxoqSQ/ciTkq5tl\n         kNWw=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774986144; x=1775590944;\n        h=cc:to:from:subject:message-id:references:mime-version:in-reply-to\n         :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n        bh=SmS1uHrhcJAkZ/77nv6KxNChDlZ5TAlHKr2qEzAIUF0=;\n        b=e+rlPMPmWyOLQS3TaMXTAAagGRvoMY9YPK9n+LIGE1qU/I/vaLRnjxV+LTKI/OnkJ2\n         Xjc7M+JU0ZUJ+OoKbzjd4m8gSJZnKe+1jN9GubtTdv8ZS9Qn4E5qjHQ0i4TjgAVSwPP0\n         B7Rbd3Xlu8PHeo6g+iJfr4Jyb8zottpm8LZBbUGz5E55RQjPputFXW44iFQJijeKrwta\n         IArVNUcqvz74SIMXKnv5lfCl1KZv+AausK/zdKxfJ4KpiErY+k1B2X+HqvCaGZeqhNGV\n         yQ2axJsWeFIsaWU7+2NmFGgFTUDiNF9nj2aFcKXLxtoQNovHTLZ/m2t40Y1wqLAiUTUL\n         rQYg==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCU605Vip9Q7pg6cKioWUeFSWznDRU8+0dqIT6FjsojLU3GsKOoD5w7du/LAxeNDIXw5LLF36dvA0DU=@lists.infradead.org",
        "X-Gm-Message-State": "AOJu0Yx3yj9NqfFJ+wJgeSZgRFo16zbEbA6zNsaTKtOrLUrlEKKDD5mU\n\tMLxNhSSvs+YntxRCT19JnJit1IJgZciGxGCFbQ9t9u7OzoD+ZC9gPBjPtCRENmN2MXKSpoRVWnJ\n\teh8hTUQ75Pw==",
        "X-Received": "from pjbng13.prod.google.com\n ([2002:a17:90b:1a8d:b0:35c:23cf:b494])\n (user=vipinsh job=prod-delivery.src-stubby-dispatcher) by\n 2002:a17:90b:2ec4:b0:34c:904a:d92\n with SMTP id 98e67ed59e1d1-35dc6fdd803mr478428a91.26.1774986143568; Tue, 31\n Mar 2026 12:42:23 -0700 (PDT)",
        "Date": "Tue, 31 Mar 2026 12:41:59 -0700",
        "In-Reply-To": "<20260331194202.1722082-1-vipinsh@google.com>",
        "Mime-Version": "1.0",
        "References": "<20260331194202.1722082-1-vipinsh@google.com>",
        "X-Mailer": "git-send-email 2.53.0.1118.gaef5881109-goog",
        "Message-ID": "<20260331194202.1722082-7-vipinsh@google.com>",
        "Subject": "[PATCH v4 6/9] KVM: selftests: Add various print flags to KVM\n selftest runner",
        "From": "Vipin Sharma <vipinsh@google.com>",
        "To": "kvm@vger.kernel.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org",
        "Cc": "seanjc@google.com, pbonzini@redhat.com, borntraeger@linux.ibm.com,\n\tfrankja@linux.ibm.com, imbrenda@linux.ibm.com, anup@brainfault.org,\n\tatish.patra@linux.dev, zhaotianrui@loongson.cn, maobibo@loongson.cn,\n\tchenhuacai@kernel.org, maz@kernel.org, oliver.upton@linux.dev,\n\tajones@ventanamicro.com, Vipin Sharma <vipinsh@google.com>",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260331_124224_922439_0DFFE2C0 ",
        "X-CRM114-Status": "GOOD (  10.22  )",
        "X-Spam-Score": "-9.5 (---------)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Add various print flags to selectively print outputs on\n terminal\n    based on test execution status (passed, failed, timed out, skipped,\n no run).\n    For each status provide further options (off, full, stderr, stdout,\n status)\n    to choose verbosity of their prints. Make \"full\" the default choice.\n Content analysis details:   (-9.5 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/, no\n                             trust\n                             [2607:f8b0:4864:20:0:0:0:104a listed in]\n                             [list.dnswl.org]\n -7.5 USER_IN_DEF_DKIM_WL    From: address is in the default DKIM welcome-list\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n -0.0 DKIMWL_WL_MED          DKIMwl.org - Medium trust sender",
        "X-BeenThere": "kvm-riscv@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<kvm-riscv.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/kvm-riscv/>",
        "List-Post": "<mailto:kvm-riscv@lists.infradead.org>",
        "List-Help": "<mailto:kvm-riscv-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"kvm-riscv\" <kvm-riscv-bounces@lists.infradead.org>",
        "Errors-To": "kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "Add various print flags to selectively print outputs on terminal based\non test execution status (passed, failed, timed out, skipped, no run).\n\nFor each status provide further options (off, full, stderr, stdout,\nstatus) to choose verbosity of their prints. Make \"full\" the default\nchoice.\n\nExample: To print stderr for the failed tests and only status for the\npassed test:\n\n   python3 runner --test-dirs tests  --print-failed stderr \\\n   --print-passed status\n\nAbove command with disable print off skipped, timed out, and no run\ntests.\n\nSigned-off-by: Vipin Sharma <vipinsh@google.com>\n---\n .../testing/selftests/kvm/runner/__main__.py  | 45 +++++++++++++++++++\n .../selftests/kvm/runner/test_runner.py       | 19 ++++++--\n 2 files changed, 60 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/tools/testing/selftests/kvm/runner/__main__.py b/tools/testing/selftests/kvm/runner/__main__.py\nindex 96402c89aea9..13f4cbea1fa7 100644\n--- a/tools/testing/selftests/kvm/runner/__main__.py\n+++ b/tools/testing/selftests/kvm/runner/__main__.py\n@@ -9,6 +9,7 @@ import os\n import sys\n import datetime\n import pathlib\n+import textwrap\n \n from test_runner import TestRunner\n from selftest import SelftestStatus\n@@ -60,6 +61,50 @@ def cli():\n                         type=int,\n                         help=\"Maximum number of tests that can be run concurrently. (Default: 1)\")\n \n+    status_choices = [\"off\", \"full\", \"stdout\", \"stderr\", \"status\"]\n+    status_help_text = textwrap.dedent('''\\\n+                        Control output of the {} test (default is full).\n+                        off   : dont print anything.\n+                        full  : print stdout, stderr, and status of the test.\n+                        stdout: print stdout and status of the test.\n+                        stderr: print stderr and status of the test.\n+                        status: only print the status of test execution and no other output.''');\n+\n+    parser.add_argument(\"--print-passed\",\n+                        default=\"full\",\n+                        const=\"full\",\n+                        nargs='?',\n+                        choices=status_choices,\n+                        help = status_help_text.format(\"passed\"))\n+\n+    parser.add_argument(\"--print-failed\",\n+                        default=\"full\",\n+                        const=\"full\",\n+                        nargs='?',\n+                        choices=status_choices,\n+                        help = status_help_text.format(\"failed\"))\n+\n+    parser.add_argument(\"--print-skipped\",\n+                        default=\"full\",\n+                        const=\"full\",\n+                        nargs='?',\n+                        choices=status_choices,\n+                        help = status_help_text.format(\"skipped\"))\n+\n+    parser.add_argument(\"--print-timed-out\",\n+                        default=\"full\",\n+                        const=\"full\",\n+                        nargs='?',\n+                        choices=status_choices,\n+                        help = status_help_text.format(\"timed-out\"))\n+\n+    parser.add_argument(\"--print-no-run\",\n+                        default=\"full\",\n+                        const=\"full\",\n+                        nargs='?',\n+                        choices=status_choices,\n+                        help = status_help_text.format(\"no-run\"))\n+\n     return parser.parse_args()\n \n \ndiff --git a/tools/testing/selftests/kvm/runner/test_runner.py b/tools/testing/selftests/kvm/runner/test_runner.py\nindex 92eec18fe5c6..e8e8fd91c1ad 100644\n--- a/tools/testing/selftests/kvm/runner/test_runner.py\n+++ b/tools/testing/selftests/kvm/runner/test_runner.py\n@@ -17,6 +17,13 @@ class TestRunner:\n         self.tests = []\n         self.output_dir = args.output\n         self.jobs = args.jobs\n+        self.print_stds = {\n+            SelftestStatus.PASSED: args.print_passed,\n+            SelftestStatus.FAILED: args.print_failed,\n+            SelftestStatus.SKIPPED: args.print_skipped,\n+            SelftestStatus.TIMED_OUT: args.print_timed_out,\n+            SelftestStatus.NO_RUN: args.print_no_run\n+        }\n \n         for testcase in testcases:\n             self.tests.append(Selftest(testcase, args.path, args.timeout,\n@@ -27,10 +34,14 @@ class TestRunner:\n         return test\n \n     def _log_result(self, test_result):\n-        logger.info(\"*** stdout ***\\n\" + test_result.stdout)\n-        logger.info(\"*** stderr ***\\n\" + test_result.stderr)\n-        logger.log(test_result.status,\n-                   f\"[{test_result.status.name}] {test_result.test_path}\")\n+        print_level = self.print_stds.get(test_result.status, \"full\")\n+\n+        if (print_level == \"full\" or print_level == \"stdout\"):\n+            logger.info(\"*** stdout ***\\n\" + test_result.stdout)\n+        if (print_level == \"full\" or print_level == \"stderr\"):\n+            logger.info(\"*** stderr ***\\n\" + test_result.stderr)\n+        if (print_level != \"off\"):\n+            logger.log(test_result.status, f\"[{test_result.status.name}] {test_result.test_path}\")\n \n     def start(self):\n         ret = 0\n",
    "prefixes": [
        "v4",
        "6/9"
    ]
}