Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2194838/?format=api
{ "id": 2194838, "url": "http://patchwork.ozlabs.org/api/patches/2194838/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210032348.987549-8-zhao1.liu@intel.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": "<20260210032348.987549-8-zhao1.liu@intel.com>", "list_archive_url": null, "date": "2026-02-10T03:23:34", "name": "[v2,07/21] qom/object: introduce user interaction flags for properties", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d6b9ede38dc3fad0953a4333325057f4b8e62606", "submitter": { "id": 86545, "url": "http://patchwork.ozlabs.org/api/people/86545/?format=api", "name": "Zhao Liu", "email": "zhao1.liu@intel.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210032348.987549-8-zhao1.liu@intel.com/mbox/", "series": [ { "id": 491594, "url": "http://patchwork.ozlabs.org/api/series/491594/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491594", "date": "2026-02-10T03:23:28", "name": "qom: introduce property flags to track external user input", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/491594/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2194838/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2194838/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 (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=nVUR/lGO;\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 4f95rG4Rs8z1xtV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 13:59:26 +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 1vpdxm-0006vD-Q4; Mon, 09 Feb 2026 21:58:55 -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 <zhao1.liu@intel.com>)\n id 1vpdxj-0006fw-Tp\n for qemu-devel@nongnu.org; Mon, 09 Feb 2026 21:58:51 -0500", "from mgamail.intel.com ([198.175.65.18])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zhao1.liu@intel.com>)\n id 1vpdxh-00046a-UR\n for qemu-devel@nongnu.org; Mon, 09 Feb 2026 21:58:51 -0500", "from orviesa008.jf.intel.com ([10.64.159.148])\n by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Feb 2026 18:58:48 -0800", "from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.39])\n by orviesa008.jf.intel.com with ESMTP; 09 Feb 2026 18:58:44 -0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1770692330; x=1802228330;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=i55Q4QB2ibnxrMseEXlw3g+DVhPWxOo/yFApxpM82Oc=;\n b=nVUR/lGOL23Uy8kNaTwICKEXDIXfieBNVvfr3eSefuAWczn6BqRKFOdL\n CzgA90Em4DDWZQeHNlOxXu3OAxiGHgNwrEhO7xU7PtQne9m1XtS7K2q3w\n F+aWeMHlc5noH2nG0AxE3g9xpdl4O33FhGXHG9bBrNWz3Z1xh8NIf3gVj\n 29KcR+0R8ls0nsDFCRyEb65FFt6sQ5f0d0exZLDsraoWpOXHOPBi+uRTS\n 6Wbb7K58T4slqwIVEYNygKEaD8GCEo118PBl/sA6IqV1M5j5TRBKeBySb\n 5ttN0QaeBbDt/tljn1yLhY5SqsoIU1Rq+65MWWd7nfuoMxJ5wfczFmXgG g==;", "X-CSE-ConnectionGUID": [ "37q8+VF4Ry+ZaETbRW0QXA==", "9Pzac1INTRSQBKFIMMGYZw==" ], "X-CSE-MsgGUID": [ "amzovffiTSGS56SP0cNBAg==", "ZBz3h4RZQVSRCNFh5NqpAw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11696\"; a=\"71854301\"", "E=Sophos;i=\"6.21,283,1763452800\"; d=\"scan'208\";a=\"71854301\"", "E=Sophos;i=\"6.21,283,1763452800\"; d=\"scan'208\";a=\"211800555\"" ], "X-ExtLoop1": "1", "From": "Zhao Liu <zhao1.liu@intel.com>", "To": "Paolo Bonzini <pbonzini@redhat.com>, =?utf-8?q?Daniel_P_=2E_Berrang?=\n\t=?utf-8?q?=C3=A9?= <berrange@redhat.com>,\n Eduardo Habkost <eduardo@habkost.net>, Markus Armbruster <armbru@redhat.com>,\n Thomas Huth <thuth@redhat.com>, Igor Mammedov <imammedo@redhat.com>,\n\t=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>", "Cc": "Richard Henderson <richard.henderson@linaro.org>,\n Peter Maydell <peter.maydell@linaro.org>,\n \"Michael S . Tsirkin\" <mst@redhat.com>,\n BALATON Zoltan <balaton@eik.bme.hu>,\n Mark Cave-Ayland <mark.caveayland@nutanix.com>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>,\n Zide Chen <zide.chen@intel.com>, Dapeng Mi <dapeng1.mi@linux.intel.com>,\n Zhao Liu <zhao1.liu@intel.com>, qemu-devel@nongnu.org,\n devel@lists.libvirt.org", "Subject": "[PATCH v2 07/21] qom/object: introduce user interaction flags for\n properties", "Date": "Tue, 10 Feb 2026 11:23:34 +0800", "Message-Id": "<20260210032348.987549-8-zhao1.liu@intel.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20260210032348.987549-1-zhao1.liu@intel.com>", "References": "<20260210032348.987549-1-zhao1.liu@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=198.175.65.18; envelope-from=zhao1.liu@intel.com;\n helo=mgamail.intel.com", "X-Spam_score_int": "-27", "X-Spam_score": "-2.8", "X-Spam_bar": "--", "X-Spam_report": "(-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001,\n 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": "Introduce three new flags to `ObjectPropertyFlags` to better manage\nproperty interactions with external users (CLI, QMP, HMP):\n\n1. OBJ_PROP_FLAG_USER_SET:\n Marks a property as having been modified by an external user.\n\n This flag is designed to be \"sticky\": once set, it persists even if\n the property value is subsequently overwritten by internal logic.\n It allows the QEMU system to distinguish user intent.\n\n The advantage of this design is that it is not needed to manually\n clear the USER_SET flag on every internal write. This simplifies the\n logic and decouples flag management from the current property setting\n path (object_property_set()).\n\n This is chosen over a strict \"current origin\" approach (where\n internal writes would clear the flag) for a practical reason: QEMU\n code often modifies underlying struct fields (which are defined as\n properties) directly, bypassing the property API entirely. This makes\n it impossible to \"accurately\" track whether the *current* value truly\n comes from the user. Therefore, a sticky \"user touched this\" flag is\n the only meaningful and robust solution.\n\n2. OBJ_PROP_FLAG_DEPRECATED:\n Marks a property as deprecated.\n\n3. OBJ_PROP_FLAG_INTERNAL:\n Marks a property as internal-only, disallowing external user access.\n\nAdditionally, update object_property_set_flags() to implement the\nenforcement logic. When a property is flagged with\nOBJ_PROP_FLAG_USER_SET:\n - If the property is also marked OBJ_PROP_FLAG_DEPRECATED, report a\n warning.\n - If the property is also marked OBJ_PROP_FLAG_INTERNAL, raise an error\n and stop the operation.\n\nSuggested-by: Igor Mammedov <imammedo@redhat.com>\nSigned-off-by: Zhao Liu <zhao1.liu@intel.com>\n---\n include/qom/object.h | 24 ++++++++++++++++++++++++\n qom/object.c | 15 +++++++++++++++\n 2 files changed, 39 insertions(+)", "diff": "diff --git a/include/qom/object.h b/include/qom/object.h\nindex 856b12e7289c..1b77429aa28b 100644\n--- a/include/qom/object.h\n+++ b/include/qom/object.h\n@@ -109,6 +109,30 @@ typedef enum {\n * will automatically add a getter and a setter to this property.\n */\n OBJ_PROP_FLAG_READWRITE = (OBJ_PROP_FLAG_READ | OBJ_PROP_FLAG_WRITE),\n+ /*\n+ * The property was explicitly set by an external user.\n+ *\n+ * This flag is set whenever the property is modified via external interfaces\n+ * (CLI, QMP, HMP). It allows internal code to distinguish whether the\n+ * property has been modified by the user.\n+ *\n+ * Once set, this flag persists even if the property value is subsequently\n+ * overwritten by internal logic. It is NOT automatically cleared and must\n+ * be explicitly cleared using object_property_clear_flags().\n+ */\n+ OBJ_PROP_FLAG_USER_SET = BIT(2),\n+ /*\n+ * The property is deprecated and will be removed in the future version.\n+ *\n+ * Any setting to this property by the user will raise a deprecation warning.\n+ */\n+ OBJ_PROP_FLAG_DEPRECATED = BIT(3),\n+ /*\n+ * The property is internal only and cannot be set by the user.\n+ *\n+ * Any setting to this property by the user will raise an error.\n+ */\n+ OBJ_PROP_FLAG_INTERNAL = BIT(4),\n } ObjectPropertyFlags;\n \n struct ObjectProperty\ndiff --git a/qom/object.c b/qom/object.c\nindex 49ef99a299b6..75a1fe7ea1d3 100644\n--- a/qom/object.c\n+++ b/qom/object.c\n@@ -1242,6 +1242,21 @@ bool object_property_set_flags(Object *obj, const char *name,\n return false;\n }\n \n+ if ((flags & OBJ_PROP_FLAG_USER_SET)) {\n+ if (prop->flags & OBJ_PROP_FLAG_DEPRECATED) {\n+ warn_report(\"Property '%s.%s' has been deprecated. \"\n+ \"Please do not use it.\",\n+ object_get_typename(obj), name);\n+ }\n+\n+ if (prop->flags & OBJ_PROP_FLAG_INTERNAL) {\n+ error_setg(errp, \"Property '%s.%s' is internal only. \"\n+ \"It can't be set by external user\",\n+ object_get_typename(obj), name);\n+ return false;\n+ }\n+ }\n+\n prop->flags |= flags;\n return true;\n }\n", "prefixes": [ "v2", "07/21" ] }