get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2227461,
    "url": "http://patchwork.ozlabs.org/api/patches/2227461/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260423191958.1440-14-farosas@suse.de/",
    "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": "<20260423191958.1440-14-farosas@suse.de>",
    "list_archive_url": null,
    "date": "2026-04-23T19:19:27",
    "name": "[PULL,13/43] migration: convert vmstate_subsection_save/load functions to bool",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "4f46ea70f5682ab1057366002d9f6f042168b06c",
    "submitter": {
        "id": 85343,
        "url": "http://patchwork.ozlabs.org/api/people/85343/?format=api",
        "name": "Fabiano Rosas",
        "email": "farosas@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260423191958.1440-14-farosas@suse.de/mbox/",
    "series": [
        {
            "id": 501236,
            "url": "http://patchwork.ozlabs.org/api/series/501236/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501236",
            "date": "2026-04-23T19:19:14",
            "name": "[PULL,01/43] checkpatch: Allow spaces after all coroutine annotations",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501236/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2227461/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2227461/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=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=2QbVNoQX;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=9uvpbc3a;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=2QbVNoQX;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=9uvpbc3a;\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=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)",
            "smtp-out1.suse.de;\n\tnone"
        ],
        "Received": [
            "from lists1p.gnu.org (lists1p.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 4g1mFW09Lhz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2026 05:22:39 +1000 (AEST)",
            "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wFzcH-0002Wc-S4; Thu, 23 Apr 2026 15:21:37 -0400",
            "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <farosas@suse.de>) id 1wFzbw-0002GB-4n\n for qemu-devel@nongnu.org; Thu, 23 Apr 2026 15:21:19 -0400",
            "from smtp-out1.suse.de ([2a07:de40:b251:101:10:150:64:1])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <farosas@suse.de>) id 1wFzbq-0001uD-2E\n for qemu-devel@nongnu.org; Thu, 23 Apr 2026 15:21:13 -0400",
            "from imap1.dmz-prg2.suse.org (unknown [10.150.64.97])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out1.suse.de (Postfix) with ESMTPS id 3C0F66A8A4;\n Thu, 23 Apr 2026 19:20:20 +0000 (UTC)",
            "from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 36480593A3;\n Thu, 23 Apr 2026 19:20:19 +0000 (UTC)",
            "from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])\n by imap1.dmz-prg2.suse.org with ESMTPSA id KJZPAfNw6mlJCwAAD6G6ig\n (envelope-from <farosas@suse.de>); Thu, 23 Apr 2026 19:20:19 +0000"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776972020;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=a0ZCd2HuC4Fz3TAvfTlRO8nxqPP6uGkjnV2AsiN6Twc=;\n b=2QbVNoQXRToWbAnUkQv1+PA9/2sfaC51YMYvaGchpn07AlLEzneen8syMk7OCOCQh7vKKb\n R6GI6QLa/X0KJK4n9p7Gupq9Un2ISA/caykLb9DNJdLwys1zSxmZYc46NYVrfbPV90mIOB\n p0pDuD4oKnrr+u7sPcin0AJ5RkFAIsU=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776972020;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=a0ZCd2HuC4Fz3TAvfTlRO8nxqPP6uGkjnV2AsiN6Twc=;\n b=9uvpbc3aV31u/EQWfdamR14HY7omgpQZ6t7sOLEz7+3VMrqHdGLF3opngmU5zlQ0S3udWN\n hsb+iIsQ+Gn3itDw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776972020;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=a0ZCd2HuC4Fz3TAvfTlRO8nxqPP6uGkjnV2AsiN6Twc=;\n b=2QbVNoQXRToWbAnUkQv1+PA9/2sfaC51YMYvaGchpn07AlLEzneen8syMk7OCOCQh7vKKb\n R6GI6QLa/X0KJK4n9p7Gupq9Un2ISA/caykLb9DNJdLwys1zSxmZYc46NYVrfbPV90mIOB\n p0pDuD4oKnrr+u7sPcin0AJ5RkFAIsU=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776972020;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=a0ZCd2HuC4Fz3TAvfTlRO8nxqPP6uGkjnV2AsiN6Twc=;\n b=9uvpbc3aV31u/EQWfdamR14HY7omgpQZ6t7sOLEz7+3VMrqHdGLF3opngmU5zlQ0S3udWN\n hsb+iIsQ+Gn3itDw=="
        ],
        "From": "Fabiano Rosas <farosas@suse.de>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Peter Xu <peterx@redhat.com>,\n Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>",
        "Subject": "[PULL 13/43] migration: convert vmstate_subsection_save/load\n functions to bool",
        "Date": "Thu, 23 Apr 2026 16:19:27 -0300",
        "Message-ID": "<20260423191958.1440-14-farosas@suse.de>",
        "X-Mailer": "git-send-email 2.51.0",
        "In-Reply-To": "<20260423191958.1440-1-farosas@suse.de>",
        "References": "<20260423191958.1440-1-farosas@suse.de>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Spamd-Result": "default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[];\n R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000];\n MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[];\n FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+];\n TO_DN_SOME(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid,suse.de:email];\n RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[];\n RCVD_COUNT_TWO(0.00)[2]; FUZZY_RATELIMITED(0.00)[rspamd.com];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n RCPT_COUNT_THREE(0.00)[3]; RCVD_TLS_ALL(0.00)[]",
        "X-Spam-Score": "-2.80",
        "Received-SPF": "pass client-ip=2a07:de40:b251:101:10:150:64:1;\n envelope-from=farosas@suse.de; helo=smtp-out1.suse.de",
        "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, 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": "From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\n\nConvert them to bool return value, as preparation to further\nconvertion of vmstate_save/load_state().\n\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>\nReviewed-by: Peter Xu <peterx@redhat.com>\nLink: https://lore.kernel.org/qemu-devel/20260304212303.667141-12-vsementsov@yandex-team.ru\nSigned-off-by: Fabiano Rosas <farosas@suse.de>\n---\n migration/vmstate.c | 57 +++++++++++++++++++++------------------------\n 1 file changed, 26 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/migration/vmstate.c b/migration/vmstate.c\nindex 53b57c09d8..8825aa3b1f 100644\n--- a/migration/vmstate.c\n+++ b/migration/vmstate.c\n@@ -21,11 +21,11 @@\n #include \"qemu/error-report.h\"\n #include \"trace.h\"\n \n-static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,\n-                                   void *opaque, JSONWriter *vmdesc,\n-                                   Error **errp);\n-static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,\n-                                   void *opaque, Error **errp);\n+static bool vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,\n+                                    void *opaque, JSONWriter *vmdesc,\n+                                    Error **errp);\n+static bool vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,\n+                                    void *opaque, Error **errp);\n static int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,\n                                 void *opaque, JSONWriter *vmdesc,\n                                 int version_id, Error **errp);\n@@ -305,10 +305,9 @@ int vmstate_load_state(QEMUFile *f, const VMStateDescription *vmsd,\n     }\n     assert(field->flags == VMS_END);\n \n-    ret = vmstate_subsection_load(f, vmsd, opaque, errp);\n-    if (ret != 0) {\n-        qemu_file_set_error(f, ret);\n-        return ret;\n+    if (!vmstate_subsection_load(f, vmsd, opaque, errp)) {\n+        qemu_file_set_error(f, -EINVAL);\n+        return -EINVAL;\n     }\n \n     if (!vmstate_post_load(vmsd, opaque, version_id, errp)) {\n@@ -637,7 +636,7 @@ static int vmstate_save_state_v(QEMUFile *f, const VMStateDescription *vmsd,\n         json_writer_end_array(vmdesc);\n     }\n \n-    ret = vmstate_subsection_save(f, vmsd, opaque, vmdesc, errp);\n+    ret = vmstate_subsection_save(f, vmsd, opaque, vmdesc, errp) ? 0 : -EINVAL;\n \n out:\n     if (vmsd->post_save) {\n@@ -667,15 +666,14 @@ int vmstate_save_state(QEMUFile *f, const VMStateDescription *vmsd,\n                                 errp);\n }\n \n-static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,\n-                                   void *opaque, Error **errp)\n+static bool vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,\n+                                    void *opaque, Error **errp)\n {\n     ERRP_GUARD();\n     trace_vmstate_subsection_load(vmsd->name);\n \n     while (qemu_peek_byte(f, 0) == QEMU_VM_SUBSECTION) {\n         char idstr[256], *idstr_ret;\n-        int ret;\n         uint8_t version_id, len, size;\n         const VMStateDescription *sub_vmsd;\n \n@@ -683,12 +681,12 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,\n         if (len < strlen(vmsd->name) + 1) {\n             /* subsection name has to be \"section_name/a\" */\n             trace_vmstate_subsection_load_bad(vmsd->name, \"(short)\", \"\");\n-            return 0;\n+            return true;\n         }\n         size = qemu_peek_buffer(f, (uint8_t **)&idstr_ret, len, 2);\n         if (size != len) {\n             trace_vmstate_subsection_load_bad(vmsd->name, \"(peek fail)\", \"\");\n-            return 0;\n+            return true;\n         }\n         memcpy(idstr, idstr_ret, size);\n         idstr[size] = 0;\n@@ -696,41 +694,39 @@ static int vmstate_subsection_load(QEMUFile *f, const VMStateDescription *vmsd,\n         if (strncmp(vmsd->name, idstr, strlen(vmsd->name)) != 0) {\n             trace_vmstate_subsection_load_bad(vmsd->name, idstr, \"(prefix)\");\n             /* it doesn't have a valid subsection name */\n-            return 0;\n+            return true;\n         }\n         sub_vmsd = vmstate_get_subsection(vmsd->subsections, idstr);\n         if (sub_vmsd == NULL) {\n             trace_vmstate_subsection_load_bad(vmsd->name, idstr, \"(lookup)\");\n             error_setg(errp, \"VM subsection '%s' in '%s' does not exist\",\n                        idstr, vmsd->name);\n-            return -ENOENT;\n+            return false;\n         }\n         qemu_file_skip(f, 1); /* subsection */\n         qemu_file_skip(f, 1); /* len */\n         qemu_file_skip(f, len); /* idstr */\n         version_id = qemu_get_be32(f);\n \n-        ret = vmstate_load_state(f, sub_vmsd, opaque, version_id, errp);\n-        if (ret) {\n+        if (vmstate_load_state(f, sub_vmsd, opaque, version_id, errp) < 0) {\n             trace_vmstate_subsection_load_bad(vmsd->name, idstr, \"(child)\");\n             error_prepend(errp,\n-                          \"Loading VM subsection '%s' in '%s' failed: %d: \",\n-                          idstr, vmsd->name, ret);\n-            return ret;\n+                          \"Loading VM subsection '%s' in '%s' failed: \",\n+                          idstr, vmsd->name);\n+            return false;\n         }\n     }\n \n     trace_vmstate_subsection_load_good(vmsd->name);\n-    return 0;\n+    return true;\n }\n \n-static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,\n-                                   void *opaque, JSONWriter *vmdesc,\n-                                   Error **errp)\n+static bool vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,\n+                                    void *opaque, JSONWriter *vmdesc,\n+                                    Error **errp)\n {\n     const VMStateDescription * const *sub = vmsd->subsections;\n     bool vmdesc_has_subsections = false;\n-    int ret = 0;\n \n     trace_vmstate_subsection_save_top(vmsd->name);\n     while (sub && *sub) {\n@@ -754,9 +750,8 @@ static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,\n             qemu_put_byte(f, len);\n             qemu_put_buffer(f, (uint8_t *)vmsdsub->name, len);\n             qemu_put_be32(f, vmsdsub->version_id);\n-            ret = vmstate_save_state(f, vmsdsub, opaque, vmdesc, errp);\n-            if (ret) {\n-                return ret;\n+            if (vmstate_save_state(f, vmsdsub, opaque, vmdesc, errp) < 0) {\n+                return false;\n             }\n \n             if (vmdesc) {\n@@ -770,5 +765,5 @@ static int vmstate_subsection_save(QEMUFile *f, const VMStateDescription *vmsd,\n         json_writer_end_array(vmdesc);\n     }\n \n-    return ret;\n+    return true;\n }\n",
    "prefixes": [
        "PULL",
        "13/43"
    ]
}