Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216879/?format=api
{ "id": 2216879, "url": "http://patchwork.ozlabs.org/api/patches/2216879/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327111700.795099-2-peter.maydell@linaro.org/", "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": "<20260327111700.795099-2-peter.maydell@linaro.org>", "list_archive_url": null, "date": "2026-03-27T11:15:56", "name": "[v2,01/65] qom/object: Add object_resolve_and_typecheck()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "957b3bc9201d03b31bf145113fdad01dcb5d5b33", "submitter": { "id": 5111, "url": "http://patchwork.ozlabs.org/api/people/5111/?format=api", "name": "Peter Maydell", "email": "peter.maydell@linaro.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327111700.795099-2-peter.maydell@linaro.org/mbox/", "series": [ { "id": 497750, "url": "http://patchwork.ozlabs.org/api/series/497750/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497750", "date": "2026-03-27T11:16:25", "name": "arm: Implement an emulation of GICv5 interrupt controller", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/497750/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216879/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216879/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=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=WZxrxWOY;\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 4fhypS0rWVz1yFr\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 27 Mar 2026 22:19:28 +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 1w65Bh-0006NU-6w; Fri, 27 Mar 2026 07:17:13 -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 <peter.maydell@linaro.org>)\n id 1w65Bc-0006Ki-17\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:08 -0400", "from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>)\n id 1w65BY-0007Uw-Jy\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 07:17:07 -0400", "by mail-wm1-x32f.google.com with SMTP id\n 5b1f17b1804b1-486fd5360d4so24981275e9.1\n for <qemu-devel@nongnu.org>; Fri, 27 Mar 2026 04:17:04 -0700 (PDT)", "from lanath.. (wildly.archaic.org.uk. [81.2.115.145])\n by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43b919cf2b2sm15484227f8f.18.2026.03.27.04.17.02\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 04:17:02 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1774610223; x=1775215023; 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=lkvAUvzvhzGaBsiBxwCLpDMp2ckMfQUEme3r+CbAUuk=;\n b=WZxrxWOYpQEu+uJ8THGO6CmppOOIoBWnMep52Ht6VL8mLFlbXJK25b4bi7b0Q9ETrR\n HXoY50TK343QR8CTrhgEAHOFBFsegAsl+r8ksmPEAl4oBkGxA/OJOL2OmJ8n7Ra241go\n wnWrY0fKvtQQdpMPLX065DUZfpJMPOxcf2ayFf2txMYNeYLVHlzXof2jN8eIv0TzCCOv\n 12iOPp0skx17l+zD4jGleYv3/m1lRiuc7jL/UCiAWpqC2A0sinT81GNwi+WXBKKIRCc1\n c9fAZu4eB9+yyWcova5zpQQQz0bAemYpxXJ3yT1dTRWj5Bis0icNqpo6LsX+8iAih+tF\n u/gw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774610223; x=1775215023;\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=lkvAUvzvhzGaBsiBxwCLpDMp2ckMfQUEme3r+CbAUuk=;\n b=cODAEmjMkO2QGOwcguDgaYPxrOOI76ud1bP/E4dzyO7xrQUTE9NyvbwaMMwTOMlogO\n mXkuzV6qEPqe6NP8o1tcUxJOQr0teZEfqK041+9pZTnzfcAAeLFZE2jVgA1HLwP3eh36\n /+Dk2lDqDKm3aPzyBQKdqhFrw468elAT4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id\n 5b1f17b1804b1-48727ec7894mr34098055e9.21.1774610222821;\n Fri, 27 Mar 2026 04:17:02 -0700 (PDT)", "From": "Peter Maydell <peter.maydell@linaro.org>", "To": "qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org", "Cc": "Jonathan Cameron <jonathan.cameron@huawei.com>", "Subject": "[PATCH v2 01/65] qom/object: Add object_resolve_and_typecheck()", "Date": "Fri, 27 Mar 2026 11:15:56 +0000", "Message-ID": "<20260327111700.795099-2-peter.maydell@linaro.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260327111700.795099-1-peter.maydell@linaro.org>", "References": "<20260327111700.795099-1-peter.maydell@linaro.org>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=2a00:1450:4864:20::32f;\n envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.google.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, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, 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": "Add a new function object_resolve_and_typecheck(), whose purpose is\nto look up the object at a given QOM path, confirm that it is the\nexpected type, and return it. This is similar to the existing\nobject_resolve_path_type(), but it insists on a non-ambiguous path.\n\nWe were already using this functionality internally to object.c as\npart of the object_resolve_link() function, so this patch implements\nthe new function by pulling the link-property specific parts out of\nthe more generic resolve-and-typecheck part.\n\nThe motivation for this function is that we want to allow devices to\nprovide an array of link properties; for that we will need to be able\nto provide the expected type of the linked object in a different way\nto the single-item link properties.\n\nReviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\n---\n include/qom/object.h | 17 +++++++++++++++++\n qom/object.c | 41 +++++++++++++++++++++++------------------\n 2 files changed, 40 insertions(+), 18 deletions(-)", "diff": "diff --git a/include/qom/object.h b/include/qom/object.h\nindex 26df6137b9..797688f25e 100644\n--- a/include/qom/object.h\n+++ b/include/qom/object.h\n@@ -1750,6 +1750,23 @@ ObjectProperty *object_class_property_add_link(ObjectClass *oc,\n Object *val, Error **errp),\n ObjectPropertyLinkFlags flags);\n \n+/**\n+ * object_resolve_and_typecheck:\n+ * @path: path to look up\n+ * @name: name of property we are resolving for (used only in error messages)\n+ * @target_type: QOM type we expect @path to resolve to\n+ * @errp: error\n+ *\n+ * Look up the object at @path and return it. If it does not have the\n+ * correct type @target_type, return NULL and set @errp.\n+ *\n+ * This is similar to object_resolve_path_type(), but it insists on a\n+ * non-ambiguous path and it produces error messages that are\n+ * specialised to the use case of setting a link property on an object.\n+ */\n+Object *object_resolve_and_typecheck(const char *path, const char *name,\n+ const char *target_type, Error **errp);\n+\n /**\n * object_property_add_str:\n * @obj: the object to add a property to\ndiff --git a/qom/object.c b/qom/object.c\nindex ff8ede8a32..046b15c7f4 100644\n--- a/qom/object.c\n+++ b/qom/object.c\n@@ -1895,26 +1895,12 @@ static void object_get_link_property(Object *obj, Visitor *v,\n }\n }\n \n-/*\n- * object_resolve_link:\n- *\n- * Lookup an object and ensure its type matches the link property type. This\n- * is similar to object_resolve_path() except type verification against the\n- * link property is performed.\n- *\n- * Returns: The matched object or NULL on path lookup failures.\n- */\n-static Object *object_resolve_link(Object *obj, const char *name,\n- const char *path, Error **errp)\n+Object *object_resolve_and_typecheck(const char *path, const char *name,\n+ const char *target_type, Error **errp)\n {\n- const char *type;\n- char *target_type;\n bool ambiguous = false;\n Object *target;\n \n- /* Go from link<FOO> to FOO. */\n- type = object_property_get_type(obj, name, NULL);\n- target_type = g_strndup(&type[5], strlen(type) - 6);\n target = object_resolve_path_type(path, target_type, &ambiguous);\n \n if (ambiguous) {\n@@ -1931,11 +1917,30 @@ static Object *object_resolve_link(Object *obj, const char *name,\n }\n target = NULL;\n }\n- g_free(target_type);\n-\n return target;\n }\n \n+/*\n+ * object_resolve_link:\n+ *\n+ * Lookup an object and ensure its type matches the link property type. This\n+ * is similar to object_resolve_path() except type verification against the\n+ * link property is performed.\n+ *\n+ * Returns: The matched object or NULL on path lookup failures.\n+ */\n+static Object *object_resolve_link(Object *obj, const char *name,\n+ const char *path, Error **errp)\n+{\n+ const char *type;\n+ g_autofree char *target_type = NULL;\n+\n+ /* Go from link<FOO> to FOO. */\n+ type = object_property_get_type(obj, name, NULL);\n+ target_type = g_strndup(&type[5], strlen(type) - 6);\n+ return object_resolve_and_typecheck(path, name, target_type, errp);\n+}\n+\n static void object_set_link_property(Object *obj, Visitor *v,\n const char *name, void *opaque,\n Error **errp)\n", "prefixes": [ "v2", "01/65" ] }