Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2194833/?format=api
{ "id": 2194833, "url": "http://patchwork.ozlabs.org/api/patches/2194833/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260210032348.987549-4-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-4-zhao1.liu@intel.com>", "list_archive_url": null, "date": "2026-02-10T03:23:30", "name": "[v2,03/21] qom/object: factor out object_class_property_try_add()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2129acd1737d2cfb5cc57fc830010f8c6b21e642", "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-4-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/2194833/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2194833/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=G4qMGfIZ;\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 4f95qL4lQsz1xtV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 13:58:38 +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 1vpdxR-00064t-PZ; Mon, 09 Feb 2026 21:58:33 -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 1vpdxQ-00063G-Hm\n for qemu-devel@nongnu.org; Mon, 09 Feb 2026 21:58:32 -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 1vpdxO-00046a-6J\n for qemu-devel@nongnu.org; Mon, 09 Feb 2026 21:58:32 -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:30 -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:24 -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=1770692310; x=1802228310;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=s/JlYnxjXvIrGB6oJxc/D12Kh0TiBPjCTqhRHSqsD3A=;\n b=G4qMGfIZIZp3jfSRQFS98glvRTFdBp8QmCdccNfMjpvF/H6jeWjUpeCX\n aRRrfNOZ0rmU1Ns0vuhoOuXr8djJPFTy6jxR4D8UCJLw9e2Ht4IHkRh+E\n 9PMkobyfauf9eQn7MdlZUY2IsXjDLJdNHAuZgL3MLdok0addHZ9hj1Uzq\n EyCQx5R4Dof9/qWpqxZkYehYRxwa+ldXI2qIym4bLJoUxU6UFVXy0IvNO\n yhc/5xiw3lxsBPq3mlT8yHpvXoQBTSsV7L0J0QZU44fX+BD65e0f4DHXy\n 23bp51+e8tPuxuPCJoU42iUOjaJuKa3Nlut3cJ8srYk2xsRlHA6W5Qjf1 A==;", "X-CSE-ConnectionGUID": [ "+lwqZmhjTFuotFOWmovjEQ==", "ayAaCdiVSB2REoX++RGXJw==" ], "X-CSE-MsgGUID": [ "zulYyosESueEYcFGPlZ50A==", "XikgiVXbTQyXeA48f7Z3eQ==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6800,10657,11696\"; a=\"71854249\"", "E=Sophos;i=\"6.21,283,1763452800\"; d=\"scan'208\";a=\"71854249\"", "E=Sophos;i=\"6.21,283,1763452800\"; d=\"scan'208\";a=\"211800457\"" ], "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 03/21] qom/object: factor out\n object_class_property_try_add()", "Date": "Tue, 10 Feb 2026 11:23:30 +0800", "Message-Id": "<20260210032348.987549-4-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": "Similar to object_property_try_add(), factor out\nobject_class_property_try_add().\n\nThis allows adding more arguments to the core implementation without\nchanging the signature of object_class_property_add(), avoiding the\nneed to modify the extensive number of callers distributed throughout\nthe code tree.\n\nWhile at it, add documentation for these functions.\n\nSigned-off-by: Zhao Liu <zhao1.liu@intel.com>\n---\n include/qom/object.h | 56 ++++++++++++++++++++++++++++++++++++++++++++\n qom/object.c | 34 ++++++++++++++++++++-------\n 2 files changed, 82 insertions(+), 8 deletions(-)", "diff": "diff --git a/include/qom/object.h b/include/qom/object.h\nindex 05706d4d7e3a..060db136988b 100644\n--- a/include/qom/object.h\n+++ b/include/qom/object.h\n@@ -1147,6 +1147,62 @@ ObjectProperty *object_property_add(Object *obj, const char *name,\n \n void object_property_del(Object *obj, const char *name);\n \n+/**\n+ * object_class_property_try_add:\n+ * @klass: the object class to add a property to\n+ * @name: the name of the property. This can contain any character except for\n+ * a forward slash. In general, you should use hyphens '-' instead of\n+ * underscores '_' when naming properties.\n+ * @type: the type name of the property. This namespace is pretty loosely\n+ * defined. Sub namespaces are constructed by using a prefix and then\n+ * to angle brackets. For instance, the type 'virtio-net-pci' in the\n+ * 'link' namespace would be 'link<virtio-net-pci>'.\n+ * @get: The getter to be called to read a property. If this is NULL, then\n+ * the property cannot be read.\n+ * @set: the setter to be called to write a property. If this is NULL,\n+ * then the property cannot be written.\n+ * @release: called when the property is removed from the object. This is\n+ * meant to allow a property to free its opaque upon object\n+ * destruction. This may be NULL.\n+ * @opaque: an opaque pointer to pass to the callbacks for the property\n+ * @errp: pointer to error object\n+ *\n+ * Returns: The #ObjectProperty; this can be used to set the @resolve\n+ * callback for child and link properties.\n+ */\n+ObjectProperty *object_class_property_try_add(ObjectClass *klass, const char *name,\n+ const char *type,\n+ ObjectPropertyAccessor *get,\n+ ObjectPropertyAccessor *set,\n+ ObjectPropertyRelease *release,\n+ void *opaque, Error **errp);\n+\n+\n+/**\n+ * object_class_property_add:\n+ * Same as object_class_property_try_add() with @errp hardcoded to\n+ * &error_abort.\n+ *\n+ * @klass: the object class to add a property to\n+ * @name: the name of the property. This can contain any character except for\n+ * a forward slash. In general, you should use hyphens '-' instead of\n+ * underscores '_' when naming properties.\n+ * @type: the type name of the property. This namespace is pretty loosely\n+ * defined. Sub namespaces are constructed by using a prefix and then\n+ * to angle brackets. For instance, the type 'virtio-net-pci' in the\n+ * 'link' namespace would be 'link<virtio-net-pci>'.\n+ * @get: The getter to be called to read a property. If this is NULL, then\n+ * the property cannot be read.\n+ * @set: the setter to be called to write a property. If this is NULL,\n+ * then the property cannot be written.\n+ * @release: called when the property is removed from the object. This is\n+ * meant to allow a property to free its opaque upon object\n+ * destruction. This may be NULL.\n+ * @opaque: an opaque pointer to pass to the callbacks for the property\n+ *\n+ * Returns: The #ObjectProperty; this can be used to set the @resolve\n+ * callback for child and link properties.\n+ */\n ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name,\n const char *type,\n ObjectPropertyAccessor *get,\ndiff --git a/qom/object.c b/qom/object.c\nindex f5801f4624c8..f101b48154d1 100644\n--- a/qom/object.c\n+++ b/qom/object.c\n@@ -1310,17 +1310,22 @@ object_property_add(Object *obj, const char *name, const char *type,\n }\n \n ObjectProperty *\n-object_class_property_add(ObjectClass *klass,\n- const char *name,\n- const char *type,\n- ObjectPropertyAccessor *get,\n- ObjectPropertyAccessor *set,\n- ObjectPropertyRelease *release,\n- void *opaque)\n+object_class_property_try_add(ObjectClass *klass,\n+ const char *name,\n+ const char *type,\n+ ObjectPropertyAccessor *get,\n+ ObjectPropertyAccessor *set,\n+ ObjectPropertyRelease *release,\n+ void *opaque, Error **errp)\n {\n ObjectProperty *prop;\n \n- assert(!object_class_property_find(klass, name));\n+ if (object_class_property_find(klass, name) != NULL) {\n+ error_setg(errp, \"attempt to add duplicate property '%s'\"\n+ \" to object class (type '%s')\",\n+ name, object_class_get_name(klass));\n+ return NULL;\n+ }\n \n prop = g_malloc0(sizeof(*prop));\n \n@@ -1337,6 +1342,19 @@ object_class_property_add(ObjectClass *klass,\n return prop;\n }\n \n+ObjectProperty *\n+object_class_property_add(ObjectClass *klass,\n+ const char *name,\n+ const char *type,\n+ ObjectPropertyAccessor *get,\n+ ObjectPropertyAccessor *set,\n+ ObjectPropertyRelease *release,\n+ void *opaque)\n+{\n+ return object_class_property_try_add(klass, name, type, get, set, release,\n+ opaque, &error_abort);\n+}\n+\n ObjectProperty *object_property_find(Object *obj, const char *name)\n {\n ObjectProperty *prop;\n", "prefixes": [ "v2", "03/21" ] }