get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2233221,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233221/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505202640.1011006-3-peterx@redhat.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/1.1/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": ""
    },
    "msgid": "<20260505202640.1011006-3-peterx@redhat.com>",
    "date": "2026-05-05T20:26:19",
    "name": "[PULL,02/23] migration: Use QAPI_CLONE_MEMBERS in migrate_params_test_apply",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0a93f2669ee985eb81ba2937acb90fd4d0e86bc0",
    "submitter": {
        "id": 67717,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/67717/?format=api",
        "name": "Peter Xu",
        "email": "peterx@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505202640.1011006-3-peterx@redhat.com/mbox/",
    "series": [
        {
            "id": 502897,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502897/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=502897",
            "date": "2026-05-05T20:26:17",
            "name": "[PULL,01/23] migration: Fix blocking in POSTCOPY_DEVICE during package load",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502897/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2233221/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2233221/checks/",
    "tags": {},
    "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=eNwVy2wp;\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=VY+yi6wn;\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)"
        ],
        "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 4g999C2k3Rz1yK2\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 06:29:35 +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 1wKMM4-0004OX-9I; Tue, 05 May 2026 16:26:56 -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 <peterx@redhat.com>) id 1wKMM0-0004MT-VQ\n for qemu-devel@nongnu.org; Tue, 05 May 2026 16:26:53 -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 1wKMLy-0002Zd-E0\n for qemu-devel@nongnu.org; Tue, 05 May 2026 16:26:52 -0400",
            "from mail-qv1-f70.google.com (mail-qv1-f70.google.com\n [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-606-whxsDk6AM7CuCQYz2ge-jw-1; Tue, 05 May 2026 16:26:47 -0400",
            "by mail-qv1-f70.google.com with SMTP id\n 6a1803df08f44-8ba9baef44cso27199556d6.0\n for <qemu-devel@nongnu.org>; Tue, 05 May 2026 13:26:47 -0700 (PDT)",
            "from x1.com ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b53c6b8123sm155283806d6.35.2026.05.05.13.26.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 05 May 2026 13:26:45 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1778012809;\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=ZaNTaQWHkBdL/8GhbYMD+GsaQBu6eMR27XHz1q7MUT8=;\n b=eNwVy2wp8CzgfaIVEOS5BFCp7uEwSIrWTsmFdmapziu32ATipl6JPhIlsAhKEXyqr9qaB0\n y8OQdeiIvjKr/tsvVo3rOcW+c+Wy/Eq5GxZihUTQl00aT60LHcqzZ9TZlJsGr3LveatklN\n E3Z8zXBvBGJQCN4YkbfHo/2tqRxWPig=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1778012807; x=1778617607; 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=ZaNTaQWHkBdL/8GhbYMD+GsaQBu6eMR27XHz1q7MUT8=;\n b=VY+yi6wnetvgT62Ybresc4YpWVqoGr2wLWCInYF8G2BZj6g+uzf5OtNG0DAD9KG7Sm\n Bcu193XAS3Ot/EIxovnqY2JMBNiBCwmsLNqrRLCK6p9RZ99HYrAuiue2F/QR6J3CvcJG\n EtC6lb11fBIP7lR4OmmNpjy8vuBFefrxqMS07+Ah0DSHJnXhObLiGM/j7DlCWZmuoc8j\n IC0bCpDRqPqP95BUJKCg8O2x9HyTd704jbMwhpMoojMgFaGj8Q3VXHWNeOYRZTQ1Zbab\n xeQYRLnCSDAsB+qbhcgwrG3yxszbW37nKFpPGKxur4lNJ66VVqO75fAcvBvlqoIW2xMX\n V8fg=="
        ],
        "X-MC-Unique": "whxsDk6AM7CuCQYz2ge-jw-1",
        "X-Mimecast-MFC-AGG-ID": "whxsDk6AM7CuCQYz2ge-jw_1778012807",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778012807; x=1778617607;\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=ZaNTaQWHkBdL/8GhbYMD+GsaQBu6eMR27XHz1q7MUT8=;\n b=mwk9CLUs+Oo5oOmOH5zzzLGX0tZsSUyKHGTyc+paffa23PVvL5PoSoUcX+r44jcpPr\n C9uVoB5IfbPwyzLsAfOcnpcOxr2CISguHZCJw4uLRPeoqlq37os+Zkm7onpX28YLIg9u\n v+E3zDCPEYPonnS3IgJJzJ+L7IGUw6salpWzV7VAN0e4UmrljCiM5ApNNIxnrevjoj4v\n 53HM+VukMKf9+VuojMqj+wZfm7GHTQ/0N2PkbHEo3euOXHeLw8C99NV0Mtx77eLDz6XI\n CxbwkmEsLU3pQ5DpbLrJfXmPOKPq8X0CuDXRQSToFkjD36xhju37OpWsVcinjsOX3IIw\n M58Q==",
        "X-Gm-Message-State": "AOJu0Yza75FkweqLJOSu/KQXj+8v4cW1jpp+kZnVZrg2vj+JeAVB/5ax\n 8Sm0fiyR8P9YNCFD0gV1IWNzLd/rZYtdSRGiIFnH/R3opk2BDxfNdwsAAlEl7s7G8jbzoY90nDe\n /yXxm94ZsZ5zmMip/d4uC/Y17nr6JTMkSVZAXylgT5/j7CWM/0t7j54mGnNX0DznbIc9bfRsSle\n TZVbRWKPpXiRgAMU1JNe0FXKrxS/N8seItdNay7g==",
        "X-Gm-Gg": "AeBDietbPAq6dixo/Z1q+NUIa15xpCdRERjig9uu2HgECMFZ5HM/s2//uewyMDzqYbG\n emWZvQ6Nsvvn8Fgd3DemVnGdkQHMA+7Znx+Eu1LcvNYKuoJPXGYSEhxhpOfU6yQ2ybrVmVV3d7J\n DI8Y8pc16gDzs8z6fSV+tcbXuLzsaymwgfa91B6taM3GZKboRk0GLS395tgrvTkwRwqFxZ3khWt\n wSrRct3KEHQhK8SJmLdQFTcINspoMMkgOXmk2wvBKruC3GwCfPj6fdLym18AQ75lNTFMsyu18XO\n bkPalJcmAmDwmXeQ5LLQs87C+1iVa3664WJh4iCd2JN3WNq9LGV/IiQIozOuOW+cAhw8/NHMbEm\n yQIidIf/8sAK3hUu70fEEXkvIOsUuTFvj4ISnfD9GmSE/RFuKjdu9Kdc=",
        "X-Received": [
            "by 2002:a05:6214:c4f:b0:8a1:8f74:3eab with SMTP id\n 6a1803df08f44-8bc4249d7a3mr5203196d6.9.1778012806773;\n Tue, 05 May 2026 13:26:46 -0700 (PDT)",
            "by 2002:a05:6214:c4f:b0:8a1:8f74:3eab with SMTP id\n 6a1803df08f44-8bc4249d7a3mr5202436d6.9.1778012806119;\n Tue, 05 May 2026 13:26:46 -0700 (PDT)"
        ],
        "From": "Peter Xu <peterx@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Fabiano Rosas <farosas@suse.de>, Paolo Bonzini <pbonzini@redhat.com>,\n Peter Xu <peterx@redhat.com>, qemu-stable <qemu-stable@nongnu.org>,\n \"Maciej S. Szmigiero\" <mail@maciej.szmigiero.name>,\n \"Maciej S. Szmigiero\" <maciej.szmigiero@oracle.com>",
        "Subject": "[PULL 02/23] migration: Use QAPI_CLONE_MEMBERS in\n migrate_params_test_apply",
        "Date": "Tue,  5 May 2026 16:26:19 -0400",
        "Message-ID": "<20260505202640.1011006-3-peterx@redhat.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260505202640.1011006-1-peterx@redhat.com>",
        "References": "<20260505202640.1011006-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": "-24",
        "X-Spam_score": "-2.5",
        "X-Spam_bar": "--",
        "X-Spam_report": "(-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.443,\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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=unavailable 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: Fabiano Rosas <farosas@suse.de>\n\nUse QAPI_CLONE_MEMBERS instead of making an assignment. The QAPI\nmethod makes the handling of the TLS strings more intuitive because it\nclones them as well.\n\nThis also fixes a segfault when a NULL TLS option is accessed as part\nof a validation check for another option (e.g. in the zero-copy +\nmultifd compression case). Details follow:\n\nCurrently, after copying s->parameters to the temporary\nMigrationParameters object before migrate_params_check(), the\nreferences in temporary object to the TLS options are dropped, either\nbecause:\n\na) the user set a new option, in which case that's fine as\n   s->parameters still holds the reference to the old memory or,\n\nb) the user did not set a new option, in which case keeping the\n   references in the temporary object would later cause them to be\n   freed along with it, leading to double-free when s->parameters is\n   also freed later on.\n\nIn this second case, it was overlooked that the TLS options can be\naccessed already during migrate_params_check() as part of validation\nof another option. Those pointers should not have been cleared.\n\nUsing QAPI_CLONE_MEMBERS fixes the issue because the temporary object\nis not stealing a reference from s->parameters anymore.\n\nCc: qemu-stable <qemu-stable@nongnu.org>\nFixes: aed97f0563 (\"migration: Normalize tls arguments\")\nReported-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>\nLink: https://lore.kernel.org/r/a65a1049-9f19-460a-8e27-a62bb30d2727@maciej.szmigiero.name\nReviewed-by: Peter Xu <peterx@redhat.com>\nSigned-off-by: Fabiano Rosas <farosas@suse.de>\nTested-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>\nLink: https://lore.kernel.org/r/20260414223718.23965-1-farosas@suse.de\nSigned-off-by: Peter Xu <peterx@redhat.com>\n---\n migration/options.c | 26 ++++++++++++--------------\n 1 file changed, 12 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/migration/options.c b/migration/options.c\nindex 7556fbc06b..68441f0276 100644\n--- a/migration/options.c\n+++ b/migration/options.c\n@@ -1279,9 +1279,9 @@ bool migrate_params_check(MigrationParameters *params, Error **errp)\n static void migrate_params_test_apply(MigrationParameters *params,\n                                       MigrationParameters *dest)\n {\n-    *dest = migrate_get_current()->parameters;\n+    MigrationState *s = migrate_get_current();\n \n-    /* TODO use QAPI_CLONE() instead of duplicating it inline */\n+    QAPI_CLONE_MEMBERS(MigrationParameters, dest, &s->parameters);\n \n     if (params->has_throttle_trigger_threshold) {\n         dest->throttle_trigger_threshold = params->throttle_trigger_threshold;\n@@ -1300,24 +1300,18 @@ static void migrate_params_test_apply(MigrationParameters *params,\n     }\n \n     if (params->tls_creds) {\n+        qapi_free_StrOrNull(dest->tls_creds);\n         dest->tls_creds = QAPI_CLONE(StrOrNull, params->tls_creds);\n-    } else {\n-        /* clear the reference, it's owned by s->parameters */\n-        dest->tls_creds = NULL;\n     }\n \n     if (params->tls_hostname) {\n+        qapi_free_StrOrNull(dest->tls_hostname);\n         dest->tls_hostname = QAPI_CLONE(StrOrNull, params->tls_hostname);\n-    } else {\n-        /* clear the reference, it's owned by s->parameters */\n-        dest->tls_hostname = NULL;\n     }\n \n     if (params->tls_authz) {\n+        qapi_free_StrOrNull(dest->tls_authz);\n         dest->tls_authz = QAPI_CLONE(StrOrNull, params->tls_authz);\n-    } else {\n-        /* clear the reference, it's owned by s->parameters */\n-        dest->tls_authz = NULL;\n     }\n \n     if (params->has_max_bandwidth) {\n@@ -1374,8 +1368,9 @@ static void migrate_params_test_apply(MigrationParameters *params,\n     }\n \n     if (params->has_block_bitmap_mapping) {\n-        dest->has_block_bitmap_mapping = true;\n-        dest->block_bitmap_mapping = params->block_bitmap_mapping;\n+        qapi_free_BitmapMigrationNodeAliasList(dest->block_bitmap_mapping);\n+        dest->block_bitmap_mapping = QAPI_CLONE(BitmapMigrationNodeAliasList,\n+                                                params->block_bitmap_mapping);\n     }\n \n     if (params->has_x_vcpu_dirty_limit_period) {\n@@ -1399,7 +1394,8 @@ static void migrate_params_test_apply(MigrationParameters *params,\n     }\n \n     if (params->has_cpr_exec_command) {\n-        dest->cpr_exec_command = params->cpr_exec_command;\n+        qapi_free_strList(dest->cpr_exec_command);\n+        dest->cpr_exec_command = QAPI_CLONE(strList, params->cpr_exec_command);\n     }\n }\n \n@@ -1555,4 +1551,6 @@ void qmp_migrate_set_parameters(MigrationParameters *params, Error **errp)\n     }\n \n     migrate_tls_opts_free(&tmp);\n+    qapi_free_BitmapMigrationNodeAliasList(tmp.block_bitmap_mapping);\n+    qapi_free_strList(tmp.cpr_exec_command);\n }\n",
    "prefixes": [
        "PULL",
        "02/23"
    ]
}