Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2218748/?format=api
{ "id": 2218748, "url": "http://patchwork.ozlabs.org/api/patches/2218748/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260401202844.673494-9-peterx@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": "<20260401202844.673494-9-peterx@redhat.com>", "list_archive_url": null, "date": "2026-04-01T20:28:41", "name": "[08/11] vmstate: Implement load of ptr marker in vmstate core", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "5a51c079123783e1a61b3a5b66dad1aa15a5818e", "submitter": { "id": 67717, "url": "http://patchwork.ozlabs.org/api/people/67717/?format=api", "name": "Peter Xu", "email": "peterx@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260401202844.673494-9-peterx@redhat.com/mbox/", "series": [ { "id": 498385, "url": "http://patchwork.ozlabs.org/api/series/498385/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498385", "date": "2026-04-01T20:28:34", "name": "vmstate: Implement VMS_ARRAY_OF_POINTER_AUTO_ALLOC", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498385/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2218748/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2218748/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=jHNFcQ4S;\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=Y74KgR+3;\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 4fmGnn5Ld9z1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 07:30:21 +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 1w82BT-0004MJ-Q7; Wed, 01 Apr 2026 16:29:03 -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 <peterx@redhat.com>) id 1w82BR-0004Ko-Rt\n for qemu-devel@nongnu.org; Wed, 01 Apr 2026 16:29:01 -0400", "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 <peterx@redhat.com>) id 1w82BQ-00039F-9R\n for qemu-devel@nongnu.org; Wed, 01 Apr 2026 16:29:01 -0400", "from mail-qk1-f197.google.com (mail-qk1-f197.google.com\n [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-528-cSyKGx1pMtalhM0garvwuA-1; Wed, 01 Apr 2026 16:28:58 -0400", "by mail-qk1-f197.google.com with SMTP id\n af79cd13be357-8cb0595def4so55244785a.0\n for <qemu-devel@nongnu.org>; Wed, 01 Apr 2026 13:28:58 -0700 (PDT)", "from x1.com ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8d2a548a4efsm68194085a.8.2026.04.01.13.28.55\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 Apr 2026 13:28:56 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775075339;\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=X3KS3isoeM2A51oCNrcxhEcDD2YvjinIbubXfJ5TPfE=;\n b=jHNFcQ4SAJu5D9MQT2yt7izTZi/ChmS004etXE8Y6xDpIDVN9mh3geCaLuHm1JbxhdkAVL\n cHUOZz5PrGf51OfD4+SkX+RH8B9v3oLCUoLFL3qFowewxTqrfdF0l2xMRfDVAm7rJR4SZh\n NNWysXj4PrD9uOIB1ro5Bs4IITg4R8Y=", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1775075337; x=1775680137; 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=X3KS3isoeM2A51oCNrcxhEcDD2YvjinIbubXfJ5TPfE=;\n b=Y74KgR+3IZMuByyNBlZ9UQxAYJUxNd3oxLOm/cQENZx/JZiRPaigGCY4+LPRdOW2sn\n Dk2yQaE1Dwf0CheUl4eCaiHTMn9O0OhFu1yuVULcfDWeWx/In4kPe0/K6DRTFz33wuTI\n DLR5JJ4jy0kVEU+KPn5pG++kCnHWCdd08HsW7kTTYmLU3JUlax42GwWmxlvx++ViIf+m\n F+pDz4ylB0iCcciG6BXp7wW0G6eJu26fWbi8BrnzWyHc8M9kmnrHBzzFGdJRlMLqIFAK\n EVuQKAHwMpsdIFfP/bDO8q96PLMyC7pNIFnN+P9jPICyYm3O2SHHL/Ikn5/WYgHEbYZM\n 9gDA==" ], "X-MC-Unique": "cSyKGx1pMtalhM0garvwuA-1", "X-Mimecast-MFC-AGG-ID": "cSyKGx1pMtalhM0garvwuA_1775075338", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775075337; x=1775680137;\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=X3KS3isoeM2A51oCNrcxhEcDD2YvjinIbubXfJ5TPfE=;\n b=h3KEgPw7js2pjHdgge6Q7HRNJTw7m5xl2vijDUw4HX73v+ft6EQqQFN0tMmhUBwaeL\n Tvot8Wnujck0gGjEPvINR40n8AZ57KBpM1LRmb9IQLHusOk2sSSaI/kvPsI8Ft6b8GJ/\n mDWU7LSq1jZzo/CEs9Efr76QX0n2mKBKqh4AYgUYJzdhKLI0iCA0egHO26/WEoduTsmd\n 4LdSUoiH7BsFtFJbxe/WG7zGCBJhvPDITfvv10pSqoDjnZ03ZzDQQbTMQr3FtjdFcD/4\n V4IkjQw6Z74cfS0PSbI8wyQ8EC69njdO++rlr9sMkuIpYsQYVsWQzZJ4FcK8v6RuXhs/\n oHxQ==", "X-Gm-Message-State": "AOJu0YzI2uZHlYB6Xz6mznWt2nBttNI87RNY71kxL3O9Ky9BdEKnqqcj\n tSm/xmas1zXKToJ7yugVVkI/iqYUXevxP+YMJ8GpmIjSELkrJ7RSNIazPG/ykK0I3k+Q7q9TNF/\n WYJHJ0Y1MM3P8M1M13r5BBDhW0LqL0hDIue+fQbLBlz12Xn8dLuaqxM2za4FRjnVk77kw9zdhAd\n k+CHSKPBPpmGbIhcbZeM+gcw6Vk1RHs2tQpzd23g==", "X-Gm-Gg": "ATEYQzx5iQ0UbTMFKe+A9rMVwpt7Ab7sue+vT/bwOUvBiVYFBZpEwUQAHhMO0hdjT+V\n PzAlEWxkGKLyyNi5y4i4BX0oG655NDeKI/r4RQq73r5QD2Ohu3Spw2lHUfZpaL60sr2CJOf/uVF\n DMRuUE4qSOq4Y0BuOaSzJKjrKTgN7svf5BksXBmiNeTQ9/C9uhIjQrYPLX4AdAu/QjPdsdDWAe8\n 9ns6eoFFY8xLh+XpXs4yQmRmixx/8Vm33wKjdhWbNQNMtqYXKrqD6835rIqMgsJcAZ2hVAH/DST\n BLBPTp3+W7Xl4+z2qytdRkND2Wv6mB9NRP0mYntanvABMpD4dLb/ruehWpW2uyFkCGQ17mv6d6I\n svA8k4Ag7hz/+WBi+XYPQQz4tn9/gHnO1bptb5Hiw4jM=", "X-Received": [ "by 2002:a05:620a:14bc:b0:8d1:b71e:10a0 with SMTP id\n af79cd13be357-8d1b71e2575mr436273685a.5.1775075337387;\n Wed, 01 Apr 2026 13:28:57 -0700 (PDT)", "by 2002:a05:620a:14bc:b0:8d1:b71e:10a0 with SMTP id\n af79cd13be357-8d1b71e2575mr436270185a.5.1775075336819;\n Wed, 01 Apr 2026 13:28:56 -0700 (PDT)" ], "From": "Peter Xu <peterx@redhat.com>", "To": "qemu-devel@nongnu.org", "Cc": "Juraj Marcin <jmarcin@redhat.com>,\n Alexander Mikhalitsyn <alexander@mihalicyn.com>,\n Fabiano Rosas <farosas@suse.de>, Peter Xu <peterx@redhat.com>,\n Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>", "Subject": "[PATCH 08/11] vmstate: Implement load of ptr marker in vmstate core", "Date": "Wed, 1 Apr 2026 16:28:41 -0400", "Message-ID": "<20260401202844.673494-9-peterx@redhat.com>", "X-Mailer": "git-send-email 2.50.1", "In-Reply-To": "<20260401202844.673494-1-peterx@redhat.com>", "References": "<20260401202844.673494-1-peterx@redhat.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Received-SPF": "pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com", "X-Spam_score_int": "-6", "X-Spam_score": "-0.7", "X-Spam_bar": "/", "X-Spam_report": "(-0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\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.01,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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": "The loader side of ptr marker is pretty straightforward, instead of playing\nthe inner_field trick, just do the load manually assuming the marker layout\nis a stable ABI (which it is true already).\n\nThis will remove some logic while loading VMSD, and hopefully it makes it\nslightly easier to read. Unfortunately, we still need to keep the sender\nside because of the JSON blob we're maintaining..\n\nThis paves way for future processing of non-NULL markers as well.\n\nWhen at it, not check \"size\" anymore for existing NULL markers, and move it\nunder the same VMS_ARRAY_OF_POINTER section because that's the only place\nthat NULL marker can happen (which guarantess size==host ptr size, which is\nnon-zero).\n\nReviewed-by: Fabiano Rosas <farosas@suse.de>\nReviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>\nSigned-off-by: Peter Xu <peterx@redhat.com>\n---\n migration/vmstate-types.c | 12 ++++------\n migration/vmstate.c | 46 ++++++++++++++++++++++++---------------\n 2 files changed, 32 insertions(+), 26 deletions(-)", "diff": "diff --git a/migration/vmstate-types.c b/migration/vmstate-types.c\nindex b31689fc3c..ae465c5c2c 100644\n--- a/migration/vmstate-types.c\n+++ b/migration/vmstate-types.c\n@@ -363,14 +363,10 @@ static bool load_ptr_marker(QEMUFile *f, void *pv, size_t size,\n const VMStateField *field, Error **errp)\n \n {\n- int byte = qemu_get_byte(f);\n-\n- if (byte == VMS_MARKER_PTR_NULL || byte == VMS_MARKER_PTR_VALID) {\n- /* TODO: process PTR_VALID case */\n- return true;\n- }\n-\n- error_setg(errp, \"%s: unexpected ptr marker: %d\", __func__, byte);\n+ /*\n+ * Load is done in vmstate core, see vmstate_ptr_marker_load().\n+ */\n+ g_assert_not_reached();\n return false;\n }\n \ndiff --git a/migration/vmstate.c b/migration/vmstate.c\nindex b333aa1744..47812eb882 100644\n--- a/migration/vmstate.c\n+++ b/migration/vmstate.c\n@@ -142,6 +142,21 @@ static void vmstate_handle_alloc(void *ptr, const VMStateField *field,\n }\n }\n \n+static bool vmstate_ptr_marker_load(QEMUFile *f, bool *load_field,\n+ Error **errp)\n+{\n+ int byte = qemu_get_byte(f);\n+\n+ if (byte == VMS_MARKER_PTR_NULL) {\n+ /* When it's a null ptr marker, do not continue the load */\n+ *load_field = false;\n+ return true;\n+ }\n+\n+ error_setg(errp, \"Unexpected ptr marker: %d\", byte);\n+ return false;\n+}\n+\n static bool vmstate_pre_load(const VMStateDescription *vmsd, void *opaque,\n Error **errp)\n {\n@@ -264,30 +279,25 @@ bool vmstate_load_vmsd(QEMUFile *f, const VMStateDescription *vmsd,\n }\n \n for (i = 0; i < n_elems; i++) {\n- bool ok;\n+ /* If we will process the load of field? */\n+ bool load_field = true;\n+ bool ok = true;\n void *curr_elem = first_elem + size * i;\n- const VMStateField *inner_field;\n \n if (field->flags & VMS_ARRAY_OF_POINTER) {\n curr_elem = *(void **)curr_elem;\n+ if (!curr_elem) {\n+ /* Read the marker instead of VMSD itself */\n+ if (!vmstate_ptr_marker_load(f, &load_field, errp)) {\n+ trace_vmstate_load_field_error(field->name,\n+ -EINVAL);\n+ return false;\n+ }\n+ }\n }\n \n- if (!curr_elem && size) {\n- /*\n- * If null pointer found (which should only happen in\n- * an array of pointers), use null placeholder and do\n- * not follow.\n- */\n- inner_field = vmsd_create_ptr_marker_field(field);\n- } else {\n- inner_field = field;\n- }\n-\n- ok = vmstate_load_field(f, curr_elem, size, inner_field, errp);\n-\n- /* If we used a fake temp field.. free it now */\n- if (inner_field != field) {\n- g_clear_pointer((gpointer *)&inner_field, g_free);\n+ if (load_field) {\n+ ok = vmstate_load_field(f, curr_elem, size, field, errp);\n }\n \n if (ok) {\n", "prefixes": [ "08/11" ] }