get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195093,
    "url": "http://patchwork.ozlabs.org/api/patches/2195093/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210121526.68598-10-mjt@tls.msk.ru/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api",
        "name": "QEMU Development",
        "link_name": "qemu-devel",
        "list_id": "qemu-devel.nongnu.org",
        "list_email": "qemu-devel@nongnu.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260210121526.68598-10-mjt@tls.msk.ru>",
    "list_archive_url": null,
    "date": "2026-02-10T12:15:06",
    "name": "[Stable-10.1.4,84/95] virtio: Fix crash when sriov-pf is set for non-PCI-Express device",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "b8ed6c081e02417356a9e7e2c1f828f93b844819",
    "submitter": {
        "id": 183,
        "url": "http://patchwork.ozlabs.org/api/people/183/?format=api",
        "name": "Michael Tokarev",
        "email": "mjt@tls.msk.ru"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210121526.68598-10-mjt@tls.msk.ru/mbox/",
    "series": [
        {
            "id": 491662,
            "url": "http://patchwork.ozlabs.org/api/series/491662/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491662",
            "date": "2026-02-10T12:14:58",
            "name": "Patch Round-up for stable 10.1.4, freeze on 2026-02-10 (frozen)",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491662/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195093/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195093/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)",
        "Received": [
            "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f9LNt5GYfz1xvb\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 23:25:02 +1100 (AEDT)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vpmht-0006zh-Dt; Tue, 10 Feb 2026 07:19:05 -0500",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mjt@tls.msk.ru>)\n id 1vpmgK-0003E5-TP; Tue, 10 Feb 2026 07:17:31 -0500",
            "from isrv.corpit.ru ([212.248.84.144])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <mjt@tls.msk.ru>)\n id 1vpmgH-0000mm-5o; Tue, 10 Feb 2026 07:17:28 -0500",
            "from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2])\n by isrv.corpit.ru (Postfix) with ESMTP id CAD3C187DBC;\n Tue, 10 Feb 2026 15:14:46 +0300 (MSK)",
            "from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146])\n by tsrv.corpit.ru (Postfix) with ESMTP id 67629360CE1;\n Tue, 10 Feb 2026 15:15:42 +0300 (MSK)"
        ],
        "From": "Michael Tokarev <mjt@tls.msk.ru>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "qemu-stable@nongnu.org, Kevin Wolf <kwolf@redhat.com>,\n Stefan Hajnoczi <stefanha@redhat.com>,\n \"Michael S. Tsirkin\" <mst@redhat.com>, Michael Tokarev <mjt@tls.msk.ru>",
        "Subject": "[Stable-10.1.4 84/95] virtio: Fix crash when sriov-pf is set for\n non-PCI-Express device",
        "Date": "Tue, 10 Feb 2026 15:15:06 +0300",
        "Message-ID": "<20260210121526.68598-10-mjt@tls.msk.ru>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<qemu-stable-10.1.4-20260210151454@cover.tls.msk.ru>",
        "References": "<qemu-stable-10.1.4-20260210151454@cover.tls.msk.ru>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru;\n helo=isrv.corpit.ru",
        "X-Spam_score_int": "-18",
        "X-Spam_score": "-1.9",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no",
        "X-Spam_action": "no action",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "qemu development <qemu-devel.nongnu.org>",
        "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>",
        "List-Post": "<mailto:qemu-devel@nongnu.org>",
        "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>",
        "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "From: Kevin Wolf <kwolf@redhat.com>\n\nSetting the sriov-pf property on devices that aren't PCI Express causes\nan assertion failure:\n\n    $ qemu-system-x86_64 \\\n        -blockdev null-co,node-name=null \\\n        -blockdev null-co,node-name=null2 \\\n        -device virtio-blk,drive=null,id=pf \\\n        -device virtio-blk,sriov-pf=pf,drive=null2\n    qemu-system-x86_64: ../hw/pci/pcie.c:1062: void pcie_add_capability(PCIDevice *, uint16_t, uint8_t, uint16_t, uint16_t): Assertion `offset >= PCI_CONFIG_SPACE_SIZE' failed.\n\nThis is because proxy->last_pcie_cap_offset is only initialised to a\nnon-zero value in virtio_pci_realize() if it's a PCI Express device, and\nthen virtio_pci_device_plugged() still tries to use it.\n\nTo fix this, just skip the SR-IOV code for !pci_is_express(). Then the\nnext thing pci_qdev_realize() does is call pcie_sriov_register_device(),\nwhich returns the appropriate error.\n\nCc: qemu-stable@nongnu.org\nFixes: d0c280d3fac6 ('pcie_sriov: Make a PCI device with user-created VF ARI-capable')\nSigned-off-by: Kevin Wolf <kwolf@redhat.com>\nReviewed-by: Stefan Hajnoczi <stefanha@redhat.com>\nReviewed-by: Michael S. Tsirkin <mst@redhat.com>\nSigned-off-by: Michael S. Tsirkin <mst@redhat.com>\nMessage-Id: <20251204172657.174391-1-kwolf@redhat.com>\n(cherry picked from commit 623db856476806124e9ae45fbc39e75012261570)\nSigned-off-by: Michael Tokarev <mjt@tls.msk.ru>",
    "diff": "diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c\nindex 767216d795..223ed9a707 100644\n--- a/hw/virtio/virtio-pci.c\n+++ b/hw/virtio/virtio-pci.c\n@@ -2115,15 +2115,17 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp)\n                          PCI_BASE_ADDRESS_SPACE_IO, &proxy->bar);\n     }\n \n-    if (pci_is_vf(&proxy->pci_dev)) {\n-        pcie_ari_init(&proxy->pci_dev, proxy->last_pcie_cap_offset);\n-        proxy->last_pcie_cap_offset += PCI_ARI_SIZEOF;\n-    } else {\n-        res = pcie_sriov_pf_init_from_user_created_vfs(\n-            &proxy->pci_dev, proxy->last_pcie_cap_offset, errp);\n-        if (res > 0) {\n-            proxy->last_pcie_cap_offset += res;\n-            virtio_add_feature(&vdev->host_features, VIRTIO_F_SR_IOV);\n+    if (pci_is_express(&proxy->pci_dev)) {\n+        if (pci_is_vf(&proxy->pci_dev)) {\n+            pcie_ari_init(&proxy->pci_dev, proxy->last_pcie_cap_offset);\n+            proxy->last_pcie_cap_offset += PCI_ARI_SIZEOF;\n+        } else {\n+            res = pcie_sriov_pf_init_from_user_created_vfs(\n+                &proxy->pci_dev, proxy->last_pcie_cap_offset, errp);\n+            if (res > 0) {\n+                proxy->last_pcie_cap_offset += res;\n+                virtio_add_feature(&vdev->host_features, VIRTIO_F_SR_IOV);\n+            }\n         }\n     }\n }\n",
    "prefixes": [
        "Stable-10.1.4",
        "84/95"
    ]
}