get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195842,
    "url": "http://patchwork.ozlabs.org/api/patches/2195842/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212062522.99565-31-anisinha@redhat.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": "<20260212062522.99565-31-anisinha@redhat.com>",
    "list_archive_url": null,
    "date": "2026-02-12T06:25:14",
    "name": "[v4,30/31] hw/machine: introduce machine specific option 'x-change-vmfd-on-reset'",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8e34d897a520c01d3a01798c5c40c524c30fbe1c",
    "submitter": {
        "id": 86030,
        "url": "http://patchwork.ozlabs.org/api/people/86030/?format=api",
        "name": "Ani Sinha",
        "email": "anisinha@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260212062522.99565-31-anisinha@redhat.com/mbox/",
    "series": [
        {
            "id": 491935,
            "url": "http://patchwork.ozlabs.org/api/series/491935/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491935",
            "date": "2026-02-12T06:24:45",
            "name": "Introduce support for confidential guest reset (x86)",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/491935/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195842/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195842/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\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=LBdWndDS;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=O819v+VB;\n\tdkim-atps=neutral",
            "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 4fBQNp2qzTz1xvb\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 17:28:42 +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 1vqQBN-000299-Oa; Thu, 12 Feb 2026 01:28:09 -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 <anisinha@redhat.com>)\n id 1vqQAi-0000aK-Ia\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:27:31 -0500",
            "from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <anisinha@redhat.com>)\n id 1vqQAg-0005NP-U9\n for qemu-devel@nongnu.org; Thu, 12 Feb 2026 01:27:28 -0500",
            "from mail-pj1-f70.google.com (mail-pj1-f70.google.com\n [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-668-UPqFaFUMO8ucKxzjnivDzQ-1; Thu, 12 Feb 2026 01:27:24 -0500",
            "by mail-pj1-f70.google.com with SMTP id\n 98e67ed59e1d1-3562171b56dso5577703a91.2\n for <qemu-devel@nongnu.org>; Wed, 11 Feb 2026 22:27:24 -0800 (PST)",
            "from rhel9-box.lan ([122.164.27.113])\n by smtp.googlemail.com with ESMTPSA id\n 98e67ed59e1d1-3567e7d95d8sm4894122a91.2.2026.02.11.22.27.19\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 11 Feb 2026 22:27:22 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770877646;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=M1UCM7z53H+LxOmB5d/FdTplSUqdefLOAGc/QpHzO9M=;\n b=LBdWndDSIUy2jsjsHz+zl1/do/TaK0oqel2WMMab4wsmicbJU/KAWvWPfZLEIOmevS7uSP\n oXcBkpEoEwepKczuAEbzAGwdceny7Mby97MnglFHTpmgsCMKKAbz2d9ZE18sD1ZRH5mIzu\n EH/6tlyxdWzgU+l1UJp9OnZKzhpenug=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1770877643; x=1771482443; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=M1UCM7z53H+LxOmB5d/FdTplSUqdefLOAGc/QpHzO9M=;\n b=O819v+VBCfrkmP2sNWR3Xd+qOqqzc+pMuGbpAF+KM+qepddwnB6YKg6qJ2yJa5H+39\n djMkLTuMBmkPDdRBXZWiZJ46XTeGUck47n1jqvQgpFc+9pdxNosryFi37PgoWYOQa6ig\n 2r5exZ8w87e3Nfjhod0YS4A6FK5TGdARIR1+zyqGEr+Pj/9DTConwpZxGPpDqmJ9NX2i\n 41y5U9pwHl5QLWYO9k3KR+WRLqgPeOfKH35TC9E7Sn/b7fBzLIHunaRIrq9cushjbLLb\n wPwGABR8MoZ+m7PG9BI3XYfartQ+GW307h5R24y+XblmE/4eB3bI+hvf8CYs6fSLVKx0\n M2aw=="
        ],
        "X-MC-Unique": "UPqFaFUMO8ucKxzjnivDzQ-1",
        "X-Mimecast-MFC-AGG-ID": "UPqFaFUMO8ucKxzjnivDzQ_1770877644",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770877643; x=1771482443;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=M1UCM7z53H+LxOmB5d/FdTplSUqdefLOAGc/QpHzO9M=;\n b=HiHTBRa9hmTsG1G3WY86MdGd8scc0Tgp+oA5k6rGPQomd3LLjRSHcw607NtyMt/ZdA\n oQ7T8Xg/s4Pkhtis9G6ymM60MlVjlmQ2w7QpDcO7OSIIiFa60c6u4KX8QUuuI+s/xObB\n Mv9NXYX4+YpYnRyL2jHy63kAfYlJekBMiroJxQQOO/ywrbabEjWaN5Yf+FasFoyHDRfI\n EbdOLUyyO9bFLjEZPWCK0dHdk3kEchOfIFzFtT8II2PGcXehG/wMaamHF5G0mJ1UMQ3L\n axOPTXv3xJgsufsBbv8sDxToftSoIdVbAxMXIDJW3kJAry9Cy1FIO3DBdxAPXtd+SQ9Z\n r50A==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCVrmpRPHzF9Rv5gOBZH1lF/jLzqR50sroqI0wYjNyWOkzHzpeOIwCyCoE+Wbpgqa8prXzkTIQyyiD4I@nongnu.org",
        "X-Gm-Message-State": "AOJu0Yyg6MMYF5O2sI3o9bx7+j4Oabs5or05C/YtGGNcBpg+59NLMpVk\n FGZlHEg78rTuCdtPn2dBcjTbdXxk3yMv0rbXhB/2o93kif2dqemhJcx6dxQJghjRrCE9qBeV7ce\n VZWMrBBFiZdZIzdD1jiaz1kX+56zUCu5tTmxwbGwbnpBC5bUpX9B6i/RV",
        "X-Gm-Gg": "AZuq6aLjETa7fUP8U1GCsLU/DqL8/q/pIgvTrnY9FKarDdNsVDIn7sdw4C/xniZu3M3\n cwm97eWqTq3ZMKBmnlddfTdOnJ/PBags0APa5ZL/fd9VBlYzeAbB02efE+f+LJMLoIRXNd4BbZ1\n ymGpA/IC4vu7eZLGAx5FqQ3r6DKpnM4VQ3I2SLB7QJhGhaxQ5pjGQfr/yjnEku1GWf95MxO8rkc\n Vg5JvjZgYNPjZU0GFTyMuvHHr9mhttOR7mPdSN4fydJ8XoKS0zvhmMBLxgcugW0ukeaQKaZomce\n McxDLbPLRAHfPYWvRbqKbCv+pZYl5OeIPa5fxuVXJ89q1ywgHM3/8uv87Da/LoJAjmIN33SBGrD\n Cbf6jbdzmvjWR/p6vhOummzr0Yw5gOEZ545908/R/getTjh/Iqt5dcwA=",
        "X-Received": [
            "by 2002:a17:90a:ec8d:b0:356:24c8:229d with SMTP id\n 98e67ed59e1d1-3568f3deb15mr1545581a91.21.1770877643542;\n Wed, 11 Feb 2026 22:27:23 -0800 (PST)",
            "by 2002:a17:90a:ec8d:b0:356:24c8:229d with SMTP id\n 98e67ed59e1d1-3568f3deb15mr1545561a91.21.1770877643160;\n Wed, 11 Feb 2026 22:27:23 -0800 (PST)"
        ],
        "From": "Ani Sinha <anisinha@redhat.com>",
        "To": "Eduardo Habkost <eduardo@habkost.net>,\n Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, =?utf-8?q?Philippe_Mathieu-D?=\n\t=?utf-8?q?aud=C3=A9?= <philmd@linaro.org>,\n Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>,\n Paolo Bonzini <pbonzini@redhat.com>",
        "Cc": "kraxel@redhat.com, Ani Sinha <anisinha@redhat.com>, qemu-devel@nongnu.org",
        "Subject": "[PATCH v4 30/31] hw/machine: introduce machine specific option\n 'x-change-vmfd-on-reset'",
        "Date": "Thu, 12 Feb 2026 11:55:14 +0530",
        "Message-ID": "<20260212062522.99565-31-anisinha@redhat.com>",
        "X-Mailer": "git-send-email 2.42.0",
        "In-Reply-To": "<20260212062522.99565-1-anisinha@redhat.com>",
        "References": "<20260212062522.99565-1-anisinha@redhat.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=170.10.133.124;\n envelope-from=anisinha@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com",
        "X-Spam_score_int": "-20",
        "X-Spam_score": "-2.1",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-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": "A new machine specific option 'x-change-vmfd-on-reset' is introduced for\ndebugging and testing only (hence the 'x-' prefix). This option when enabled\nwill force KVM VM file descriptor to be changed upon guest reset like\nin the case of confidential guests. This can be used to exercise the code\nchanges that are specific for confidential guests on non-confidential\nguests as well (except changes that require hardware support for\nconfidential guests).\nA new functional test has been added in the next patch that uses this new\nparameter to test the VM file descriptor changes.\n\nSigned-off-by: Ani Sinha <anisinha@redhat.com>\n---\n hw/core/machine.c        | 22 ++++++++++++++++++++++\n include/hw/core/boards.h |  6 ++++++\n system/runstate.c        | 20 ++++++++++----------\n 3 files changed, 38 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/hw/core/machine.c b/hw/core/machine.c\nindex 6411e68856..95d7650db9 100644\n--- a/hw/core/machine.c\n+++ b/hw/core/machine.c\n@@ -450,6 +450,21 @@ static void machine_set_dump_guest_core(Object *obj, bool value, Error **errp)\n     ms->dump_guest_core = value;\n }\n \n+static bool machine_get_new_accel_vmfd_on_reset(Object *obj, Error **errp)\n+{\n+    MachineState *ms = MACHINE(obj);\n+\n+    return ms->new_accel_vmfd_on_reset;\n+}\n+\n+static void machine_set_new_accel_vmfd_on_reset(Object *obj,\n+                                                bool value, Error **errp)\n+{\n+    MachineState *ms = MACHINE(obj);\n+\n+    ms->new_accel_vmfd_on_reset = value;\n+}\n+\n static bool machine_get_mem_merge(Object *obj, Error **errp)\n {\n     MachineState *ms = MACHINE(obj);\n@@ -1198,6 +1213,13 @@ static void machine_class_init(ObjectClass *oc, const void *data)\n     object_class_property_set_description(oc, \"dump-guest-core\",\n         \"Include guest memory in a core dump\");\n \n+    object_class_property_add_bool(oc, \"x-change-vmfd-on-reset\",\n+        machine_get_new_accel_vmfd_on_reset,\n+        machine_set_new_accel_vmfd_on_reset);\n+    object_class_property_set_description(oc, \"x-change-vmfd-on-reset\",\n+        \"Generate new accelerator fd on reset, \"\n+        \"to be used only for testing and debugging.\");\n+\n     object_class_property_add_bool(oc, \"mem-merge\",\n         machine_get_mem_merge, machine_set_mem_merge);\n     object_class_property_set_description(oc, \"mem-merge\",\ndiff --git a/include/hw/core/boards.h b/include/hw/core/boards.h\nindex 07f8938752..ee3cc9130e 100644\n--- a/include/hw/core/boards.h\n+++ b/include/hw/core/boards.h\n@@ -447,6 +447,12 @@ struct MachineState {\n     struct NVDIMMState *nvdimms_state;\n     struct NumaState *numa_state;\n     bool acpi_spcr_enabled;\n+    /*\n+     * whether to change virtual machine accelerator file descriptor upon\n+     * reset or not. used only for debugging and testing purpose.\n+     * It should be set to false for all regular use.\n+     */\n+    bool new_accel_vmfd_on_reset;\n };\n \n /*\ndiff --git a/system/runstate.c b/system/runstate.c\nindex 0a74e3ade5..29953fb088 100644\n--- a/system/runstate.c\n+++ b/system/runstate.c\n@@ -526,25 +526,25 @@ void qemu_system_reset(ShutdownCause reason)\n         type = RESET_TYPE_COLD;\n     }\n \n-    /*\n-     * different accelerators implement how to close the old file handle of\n-     * the accelerator descriptor and create a new one here. Resetting\n-     * file handle is necessary to create a new confidential VM context post\n-     * VM reset.\n-     */\n-    if (!cpus_are_resettable() &&\n-        (reason == SHUTDOWN_CAUSE_GUEST_RESET ||\n-         reason == SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET)) {\n+    if ((reason == SHUTDOWN_CAUSE_GUEST_RESET ||\n+         reason == SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET) &&\n+        (current_machine->new_accel_vmfd_on_reset || !cpus_are_resettable())) {\n         if (ac->reset_vmfd) {\n             ret = ac->reset_vmfd(current_machine);\n             if (ret < 0) {\n                 error_report(\"unable to reset vmfd: %s(%d)\",\n                              strerror(-ret), ret);\n                 vm_stop(RUN_STATE_INTERNAL_ERROR);\n+            } else if (current_machine->new_accel_vmfd_on_reset) {\n+                info_report(\"virtual machine accel file descriptor \"\n+                            \"has changed.\");\n             }\n             vmfd_reset = true;\n+        } else if (!cpus_are_resettable())  {\n+            error_report(\"accelerator does not support reset!\");\n         } else {\n-            error_report(\"accelerator does not support reset\");\n+            error_report(\"accelerator does not support vmfd change reset, \"\n+                         \"proceeding with normal reset!\");\n         }\n     }\n \n",
    "prefixes": [
        "v4",
        "30/31"
    ]
}