get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2233213,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233213/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505202640.1011006-9-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-9-peterx@redhat.com>",
    "date": "2026-05-05T20:26:25",
    "name": "[PULL,08/23] migration: Use the new save_query_pending() API directly",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "288253a57752d21865407be4a0af0bd9d0ce47f6",
    "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-9-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/2233213/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2233213/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=MNRmERA1;\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=tHCq57IG;\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 4g998S0Zrbz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 06:28:56 +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 1wKMMA-0004S7-SP; Tue, 05 May 2026 16:27:03 -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 1wKMM7-0004QT-Nq\n for qemu-devel@nongnu.org; Tue, 05 May 2026 16:27:00 -0400",
            "from us-smtp-delivery-124.mimecast.com ([170.10.129.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 1wKMM5-0002cT-PH\n for qemu-devel@nongnu.org; Tue, 05 May 2026 16:26:59 -0400",
            "from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-681-WrEcZGZaOpucLwz0sWOx0Q-1; Tue, 05 May 2026 16:26:55 -0400",
            "by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-8b5f089a5c3so124372356d6.3\n for <qemu-devel@nongnu.org>; Tue, 05 May 2026 13:26:55 -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.52\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 05 May 2026 13:26:53 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1778012817;\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=3dC1qfNQleJy8e4gs+qK727UJ4brhGZIIHFtrIFxT4w=;\n b=MNRmERA1aHtcusIT+86n56x9HpdOBIS7+jYAVUrNJzG1NtSjM4QWRcSauaRksWd6rGJF5U\n 6JrYm0Iy4Q6DAbz2b/z4Wh4kq3K/mpjgREKURERoo1DPQ1815GermpulzfpHSxvT0q3Rc8\n p27SK/a9d9olwuiVuNnJ5OCgg7GB5jE=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1778012815; x=1778617615; 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=3dC1qfNQleJy8e4gs+qK727UJ4brhGZIIHFtrIFxT4w=;\n b=tHCq57IGFdngi8zGcMAamTyCtQ4YDmEnb3eN56RFaF13R3+SfrymAT+2Zn0auyvTRw\n H98J5bkAobHn49w5TltKlkC8MrFNFhhTmhON/qHeHjCBT+zoL09YDIm5gEHUSZvPC+uf\n iHyMSl5FhulbtMEo0boTJUO08or481jneeau+KDPCfKmHDzjC+oNfNoV5MBo47BQa8Fc\n QYJ8D9eemJlbLv6I5I2uWB9L1vFk5yRs3nsBcKhJIvrDEGlumPvfHbnuHtR4vSLi8+A6\n 1Ib8iuoV0gb+ZisULhuupA7HUWRCXO9OdOCHXtFd3Z9/ZJGaGHbTW9iHmfIf0V/483fQ\n 1pkg=="
        ],
        "X-MC-Unique": "WrEcZGZaOpucLwz0sWOx0Q-1",
        "X-Mimecast-MFC-AGG-ID": "WrEcZGZaOpucLwz0sWOx0Q_1778012815",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778012815; x=1778617615;\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=3dC1qfNQleJy8e4gs+qK727UJ4brhGZIIHFtrIFxT4w=;\n b=lIQggvhujEeyH1yp6CU5+6hR8myZ70RAYagAZSQRpW9GI4MOYiawgKdaeH0LrAhV2h\n Omodza1K3XgOrW8CImhgpqzN/WCh8y5cPlMVdS7Ddmehmn9gDqlXJtqNPmRNAWH3ZwkQ\n hrosXwTuMMVmBxfCR62inUcEUP57Jo8XQqmO39jjlClpkM1qW3c37w4soUy0ZByjUq2i\n kORG8y0z3dnyZzAYVNq1kL1BsNTy860fjV01jxAhbAf7bROnHCn+WBhhNaHE1/eTD/+X\n 4PUiyzWihMc8EVC3ccgc1a96fQlk8TcRhV9zEj43MRTEmIhtJm7Rx1JBrpKORe5vt2QF\n HLYA==",
        "X-Gm-Message-State": "AOJu0YwQ9NuGnP4Vo6L9lpkpWdsiECgNmI2e0lqTYjiaBnZvm5Z2vJSX\n AVq3bkCWD0J9RYB8myzgeeXcECV8EseNWqESaUNzegsMUIvIS/pmr5kFkRfVr6dHC36/QBaa71P\n aH/TPvuFodNL8k4pemFOps6iMwOWTZ+hDWyDQN0jey/MVS2VLwtDFFavbcbV/JhIkRNWw52VyV3\n zpbw7+FrXiP/Y0wbAGDZWbw6TYfBaJmhT2Hr01Sw==",
        "X-Gm-Gg": "AeBDieu9llyLVA6rRSr7ITxfccqTuURlaT/pn4gCCJTXVaFHL6KJtgL7VHUIPdgxrRk\n kJSlwv97PrmObNgzXhL8dV3T+bUvpW6X6BwnUD2AFsE14G/vFcoTrZSGwkpKErsJzEACinKtjd3\n xlfONc1u/CGP0fJEtACfkBzRX70dlLeAZUGv/6wl0DIvzg9n+O7xmW5xDiWllRgmlMWkjE96/az\n WPegDNcztEhuF0QVl6a99jgxzydSAtSCgTzRr6HclRq4p0DuQsL3byYpeD8VyhCsihryfEDrHPe\n c1pcPYaIDZEgOq/Fm8goTHFMvOUpWMdEUYKmnHT6xrvYAZPQyTbTZzmFS6nFMMuZUkVcs6Npr/B\n OYq4sRVZ8GwUUjquhxz4YtCQFzzu5WWotMqNScNtZFohJWPbnYen77Eg=",
        "X-Received": [
            "by 2002:a05:6214:2245:b0:8b9:428a:e640 with SMTP id\n 6a1803df08f44-8bc41bcab79mr5615216d6.2.1778012814605;\n Tue, 05 May 2026 13:26:54 -0700 (PDT)",
            "by 2002:a05:6214:2245:b0:8b9:428a:e640 with SMTP id\n 6a1803df08f44-8bc41bcab79mr5614276d6.2.1778012813861;\n Tue, 05 May 2026 13:26:53 -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>, Juraj Marcin <jmarcin@redhat.com>,\n Avihai Horon <avihaih@nvidia.com>",
        "Subject": "[PULL 08/23] migration: Use the new save_query_pending() API directly",
        "Date": "Tue,  5 May 2026 16:26:25 -0400",
        "Message-ID": "<20260505202640.1011006-9-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.129.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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n SPF_HELO_PASS=-0.001, 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": "It's easier to use the new API directly in the migration iterations.  This\nalso paves way for follow up patches to add new data to report directly to\nthe iterator function.\n\nWhen at it, merge the tracepoints too into one.\n\nNo functional change intended.\n\nReviewed-by: Juraj Marcin <jmarcin@redhat.com>\nReviewed-by: Avihai Horon <avihaih@nvidia.com>\nLink: https://lore.kernel.org/r/20260421202110.306051-7-peterx@redhat.com\nSigned-off-by: Peter Xu <peterx@redhat.com>\n---\n migration/savevm.h     |  4 ----\n migration/migration.c  | 16 +++++++---------\n migration/savevm.c     | 23 ++---------------------\n migration/trace-events |  3 +--\n 4 files changed, 10 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/migration/savevm.h b/migration/savevm.h\nindex e4efd243f3..96fdf96d4e 100644\n--- a/migration/savevm.h\n+++ b/migration/savevm.h\n@@ -46,10 +46,6 @@ void qemu_savevm_state_cleanup(void);\n void qemu_savevm_state_complete_postcopy(QEMUFile *f);\n int qemu_savevm_state_complete_precopy(MigrationState *s);\n void qemu_savevm_query_pending(MigPendingData *pending, bool exact);\n-void qemu_savevm_state_pending_exact(uint64_t *must_precopy,\n-                                     uint64_t *can_postcopy);\n-void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,\n-                                        uint64_t *can_postcopy);\n int qemu_savevm_state_complete_precopy_iterable(QEMUFile *f, bool in_postcopy);\n bool qemu_savevm_state_postcopy_prepare(QEMUFile *f, Error **errp);\n void qemu_savevm_state_end(QEMUFile *f);\ndiff --git a/migration/migration.c b/migration/migration.c\nindex 5f4efb1fe5..c75ad01b64 100644\n--- a/migration/migration.c\n+++ b/migration/migration.c\n@@ -3208,17 +3208,17 @@ typedef enum {\n  */\n static MigIterateState migration_iteration_run(MigrationState *s)\n {\n-    uint64_t must_precopy, can_postcopy, pending_size;\n     Error *local_err = NULL;\n     bool in_postcopy = (s->state == MIGRATION_STATUS_POSTCOPY_DEVICE ||\n                         s->state == MIGRATION_STATUS_POSTCOPY_ACTIVE);\n     bool can_switchover = migration_can_switchover(s);\n+    MigPendingData pending = { };\n+    uint64_t pending_size;\n     bool complete_ready;\n \n     /* Fast path - get the estimated amount of pending data */\n-    qemu_savevm_state_pending_estimate(&must_precopy, &can_postcopy);\n-    pending_size = must_precopy + can_postcopy;\n-    trace_migrate_pending_estimate(pending_size, must_precopy, can_postcopy);\n+    qemu_savevm_query_pending(&pending, false);\n+    pending_size = pending.precopy_bytes + pending.postcopy_bytes;\n \n     if (in_postcopy) {\n         /*\n@@ -3259,14 +3259,12 @@ static MigIterateState migration_iteration_run(MigrationState *s)\n          * during postcopy phase.\n          */\n         if (pending_size <= s->threshold_size) {\n-            qemu_savevm_state_pending_exact(&must_precopy, &can_postcopy);\n-            pending_size = must_precopy + can_postcopy;\n-            trace_migrate_pending_exact(pending_size, must_precopy,\n-                                        can_postcopy);\n+            qemu_savevm_query_pending(&pending, true);\n+            pending_size = pending.precopy_bytes + pending.postcopy_bytes;\n         }\n \n         /* Should we switch to postcopy now? */\n-        if (must_precopy <= s->threshold_size &&\n+        if (pending.precopy_bytes <= s->threshold_size &&\n             can_switchover && qatomic_read(&s->start_postcopy)) {\n             if (postcopy_start(s, &local_err)) {\n                 migrate_error_propagate(s, error_copy(local_err));\ndiff --git a/migration/savevm.c b/migration/savevm.c\nindex 41f1906598..72454e15ad 100644\n--- a/migration/savevm.c\n+++ b/migration/savevm.c\n@@ -1812,28 +1812,9 @@ void qemu_savevm_query_pending(MigPendingData *pending, bool exact)\n         }\n         se->ops->save_query_pending(se->opaque, pending, exact);\n     }\n-}\n-\n-void qemu_savevm_state_pending_estimate(uint64_t *must_precopy,\n-                                        uint64_t *can_postcopy)\n-{\n-    MigPendingData pending;\n-\n-    qemu_savevm_query_pending(&pending, false);\n-\n-    *must_precopy = pending.precopy_bytes;\n-    *can_postcopy = pending.postcopy_bytes;\n-}\n-\n-void qemu_savevm_state_pending_exact(uint64_t *must_precopy,\n-                                     uint64_t *can_postcopy)\n-{\n-    MigPendingData pending;\n-\n-    qemu_savevm_query_pending(&pending, true);\n \n-    *must_precopy = pending.precopy_bytes;\n-    *can_postcopy = pending.postcopy_bytes;\n+    trace_qemu_savevm_query_pending(exact, pending->precopy_bytes,\n+                                    pending->postcopy_bytes);\n }\n \n void qemu_savevm_state_cleanup(void)\ndiff --git a/migration/trace-events b/migration/trace-events\nindex 34143b14b4..ca7dfd4cb7 100644\n--- a/migration/trace-events\n+++ b/migration/trace-events\n@@ -7,6 +7,7 @@ qemu_loadvm_state_section_partend(uint32_t section_id) \"%u\"\n qemu_loadvm_state_post_main(int ret) \"%d\"\n qemu_loadvm_state_section_startfull(uint32_t section_id, const char *idstr, uint32_t instance_id, uint32_t version_id) \"%u(%s) %u %u\"\n qemu_savevm_send_packaged(void) \"\"\n+qemu_savevm_query_pending(bool exact, uint64_t precopy, uint64_t postcopy) \"exact=%d, precopy=%\"PRIu64\", postcopy=%\"PRIu64\n loadvm_state_switchover_ack_needed(unsigned int switchover_ack_pending_num) \"Switchover ack pending num=%u\"\n loadvm_state_setup(void) \"\"\n loadvm_state_cleanup(void) \"\"\n@@ -161,8 +162,6 @@ migration_cleanup(void) \"\"\n migrate_error(const char *error_desc) \"error=%s\"\n migration_cancel(void) \"\"\n migrate_handle_rp_req_pages(const char *rbname, size_t start, size_t len) \"in %s at 0x%zx len 0x%zx\"\n-migrate_pending_exact(uint64_t size, uint64_t pre, uint64_t post) \"exact pending size %\" PRIu64 \" (pre = %\" PRIu64 \" post=%\" PRIu64 \")\"\n-migrate_pending_estimate(uint64_t size, uint64_t pre, uint64_t post) \"estimate pending size %\" PRIu64 \" (pre = %\" PRIu64 \" post=%\" PRIu64 \")\"\n migrate_send_rp_message(int msg_type, uint16_t len) \"%d: len %d\"\n migrate_send_rp_recv_bitmap(char *name, int64_t size) \"block '%s' size 0x%\"PRIi64\n migration_completion_file_err(void) \"\"\n",
    "prefixes": [
        "PULL",
        "08/23"
    ]
}