get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2216054,
    "url": "http://patchwork.ozlabs.org/api/patches/2216054/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260325184259.366-9-alireza.sanaee@huawei.com/",
    "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": "<20260325184259.366-9-alireza.sanaee@huawei.com>",
    "list_archive_url": null,
    "date": "2026-03-25T18:42:56",
    "name": "[8/9] hw/cxl: Add tag-based dynamic-capacity release support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "9ec9b380b89b35dbe3c7a64c5a2483454604e412",
    "submitter": {
        "id": 90159,
        "url": "http://patchwork.ozlabs.org/api/people/90159/?format=api",
        "name": "Alireza Sanaee",
        "email": "alireza.sanaee@huawei.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260325184259.366-9-alireza.sanaee@huawei.com/mbox/",
    "series": [
        {
            "id": 497484,
            "url": "http://patchwork.ozlabs.org/api/series/497484/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497484",
            "date": "2026-03-25T18:42:48",
            "name": "Application Specific Tagged Memory Support in CXL Type 3 Devices",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497484/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2216054/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2216054/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 4fgws52vzWz1xy3\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 05:48:09 +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 1w5TGV-0005lj-TL; Wed, 25 Mar 2026 14:47:39 -0400",
            "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 <alireza.sanaee@huawei.com>)\n id 1w5TGR-0005kC-Ht\n for qemu-devel@nongnu.org; Wed, 25 Mar 2026 14:47:36 -0400",
            "from frasgout.his.huawei.com ([185.176.79.56])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <alireza.sanaee@huawei.com>)\n id 1w5TGP-0000Ec-Ro\n for qemu-devel@nongnu.org; Wed, 25 Mar 2026 14:47:35 -0400",
            "from mail.maildlp.com (unknown [172.18.224.83])\n by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4fgwrC0wMtzJ46DS;\n Thu, 26 Mar 2026 02:47:23 +0800 (CST)",
            "from dubpeml500005.china.huawei.com (unknown [7.214.145.207])\n by mail.maildlp.com (Postfix) with ESMTPS id 16DA640086;\n Thu, 26 Mar 2026 02:47:32 +0800 (CST)",
            "from a2303103017.china.huawei.com (10.47.66.203) by\n dubpeml500005.china.huawei.com (7.214.145.207) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.2.1544.11; Wed, 25 Mar 2026 18:47:30 +0000"
        ],
        "To": "<qemu-devel@nongnu.org>",
        "CC": "<anisa.su@samsung.com>, <armbru@redhat.com>, <berrange@redhat.com>,\n <eblake@redhat.com>, <jonathan.cameron@huawei.com>,\n <linux-cxl@vger.kernel.org>, <linuxarm@huawei.com>, <lizhijian@fujitsu.com>,\n <mst@redhat.com>, <pbonzini@redhat.com>, <gourry@gourry.net>,\n <nifan.cxl@gmail.com>, <me@linux.beauty>",
        "Subject": "[PATCH 8/9] hw/cxl: Add tag-based dynamic-capacity release support",
        "Date": "Wed, 25 Mar 2026 18:42:56 +0000",
        "Message-ID": "<20260325184259.366-9-alireza.sanaee@huawei.com>",
        "X-Mailer": "git-send-email 2.51.0.windows.2",
        "In-Reply-To": "<20260325184259.366-1-alireza.sanaee@huawei.com>",
        "References": "<20260325184259.366-1-alireza.sanaee@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.47.66.203]",
        "X-ClientProxiedBy": "lhrpeml500011.china.huawei.com (7.191.174.215) To\n dubpeml500005.china.huawei.com (7.214.145.207)",
        "Received-SPF": "pass client-ip=185.176.79.56;\n envelope-from=alireza.sanaee@huawei.com; helo=frasgout.his.huawei.com",
        "X-Spam_score_int": "-41",
        "X-Spam_score": "-4.2",
        "X-Spam_bar": "----",
        "X-Spam_report": "(-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3,\n RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\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>",
        "Reply-to": "Alireza Sanaee <alireza.sanaee@huawei.com>",
        "From": "Alireza Sanaee via qemu development <qemu-devel@nongnu.org>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "Add support for the tag-based dynamic-capacity release policy via the QMP\ninterface. The new path scans committed extents, selects those whose stored\ntag matches the requested UUID, and emits a Release Dynamic Capacity event\nfor each matching range.\n\nThis is intentionally scoped to tag-driven selection. Prescriptive release\nhandling and the underlying extent teardown stay in the existing paths.\n\nSigned-off-by: Alireza Sanaee <alireza.sanaee@huawei.com>\n---\n hw/mem/cxl_type3.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 61 insertions(+)",
    "diff": "diff --git a/hw/mem/cxl_type3.c b/hw/mem/cxl_type3.c\nindex 6b73d58358..d5fa8a530a 100644\n--- a/hw/mem/cxl_type3.c\n+++ b/hw/mem/cxl_type3.c\n@@ -2492,6 +2492,63 @@ static void qmp_cxl_process_dynamic_capacity_prescriptive(const char *path,\n     cxl_create_dc_event_records_for_extents(dcd, type, extents, num_extents);\n }\n \n+static void qmp_cxl_process_dynamic_capacity_tag_based(const char *path,\n+        uint16_t hid, CXLDCEventType type, uint8_t rid, const char *tag,\n+        CxlDynamicCapacityExtentList *records, Error **errp)\n+{\n+    Object *obj;\n+    CXLType3Dev *dcd;\n+    CXLDCExtentList *list = NULL;\n+    CXLDCExtent *ent;\n+    g_autofree CXLDCExtentRaw *extents = NULL;\n+\n+    obj = object_resolve_path_type(path, TYPE_CXL_TYPE3, NULL);\n+    if (!obj) {\n+        error_setg(errp, \"Unable to resolve CXL type 3 device\");\n+        return;\n+    }\n+\n+    dcd = CXL_TYPE3(obj);\n+    if (!dcd->dc.num_regions) {\n+        error_setg(errp, \"No dynamic capacity support from the device\");\n+        return;\n+    }\n+\n+    if (rid >= dcd->dc.num_regions) {\n+        error_setg(errp, \"region id is too large\");\n+        return;\n+    }\n+\n+    QemuUUID uuid_req;\n+    qemu_uuid_parse(tag, &uuid_req);\n+\n+    list = &dcd->dc.extents;\n+    size_t cap = 8, n = 0;\n+    extents = g_new0(CXLDCExtentRaw, cap);\n+    QTAILQ_FOREACH(ent, list, node) {\n+        QemuUUID uuid_ext;\n+        memcpy(&uuid_ext.data, ent->tag, sizeof(ent->tag));\n+        if (!qemu_uuid_is_equal(&uuid_req, &uuid_ext)) {\n+            continue;\n+        }\n+\n+        if (n == cap) {\n+            cap *= 2;\n+            extents = g_renew(CXLDCExtentRaw, extents, cap);\n+        }\n+\n+        extents[n++] = (CXLDCExtentRaw){ .start_dpa = ent->start_dpa,\n+                                         .len = ent->len,\n+                                         .shared_seq = 0 };\n+    }\n+\n+    if (n == 0) {\n+        return;\n+    }\n+    extents = g_renew(CXLDCExtentRaw, extents, n);\n+    cxl_create_dc_event_records_for_extents(dcd, type, extents, n);\n+}\n+\n void qmp_cxl_add_dynamic_capacity(const char *path, uint16_t host_id,\n                                   CxlExtentSelectionPolicy sel_policy,\n                                   uint8_t region, const char *tag,\n@@ -2537,6 +2594,10 @@ void qmp_cxl_release_dynamic_capacity(const char *path, uint16_t host_id,\n                                                       region, tag,\n                                                       extents, errp);\n         return;\n+    case CXL_EXTENT_REMOVAL_POLICY_TAG_BASED:\n+        qmp_cxl_process_dynamic_capacity_tag_based(path, host_id, type, region,\n+                                                   tag, extents, errp);\n+        return;\n     default:\n         error_setg(errp, \"Removal policy not supported\");\n         return;\n",
    "prefixes": [
        "8/9"
    ]
}