get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2219987,
    "url": "http://patchwork.ozlabs.org/api/patches/2219987/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260405152612.93027-2-viking4@gmail.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": "<20260405152612.93027-2-viking4@gmail.com>",
    "list_archive_url": null,
    "date": "2026-04-05T15:26:07",
    "name": "[1/2] migration: track timing and received pages in MigrationIncomingState",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5413c5c0eccb2dc6dbd489cef79fd4e201084f1e",
    "submitter": {
        "id": 92831,
        "url": "http://patchwork.ozlabs.org/api/people/92831/?format=api",
        "name": "Trieu Huynh",
        "email": "vikingtc4@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260405152612.93027-2-viking4@gmail.com/mbox/",
    "series": [
        {
            "id": 498790,
            "url": "http://patchwork.ozlabs.org/api/series/498790/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=498790",
            "date": "2026-04-05T15:26:06",
            "name": "migration: include timing and RAM stats on destination when query-migrate",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498790/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2219987/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2219987/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=IHl8HVgd;\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 4fpbt23WJJz1yFs\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 06 Apr 2026 01:27:05 +1000 (AEST)",
            "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 1w9PN1-0006ls-6m; Sun, 05 Apr 2026 11:26:39 -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 <vikingtc4@gmail.com>)\n id 1w9PMz-0006l7-K1\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 11:26:37 -0400",
            "from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <vikingtc4@gmail.com>)\n id 1w9PMx-0008Rv-Ue\n for qemu-devel@nongnu.org; Sun, 05 Apr 2026 11:26:37 -0400",
            "by mail-pf1-x42c.google.com with SMTP id\n d2e1a72fcca58-82cd5c07f93so1425100b3a.1\n for <qemu-devel@nongnu.org>; Sun, 05 Apr 2026 08:26:35 -0700 (PDT)",
            "from localhost.localdomain ([123.19.199.205])\n by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cf9c72967sm11187938b3a.49.2026.04.05.08.26.32\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 05 Apr 2026 08:26:33 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775402794; x=1776007594; 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=vtzvMbJwqmZg1QTzQYdfCcfO+oD+mRx9jQ0oIMWTBPI=;\n b=IHl8HVgdq9JulcAQVkYqXGw5Dedj3klnXfyDvsZe8+iSRgkLxaFh//Dh3n4Qhi0WY7\n x5igdQHwTqz8If8iioFZgkikuyZqxg9efYAtMr6dH2wDZhRid4l7B9BNdxFY59mtJFj0\n uKOdn9kRP2uvisGZk2NQUsX+kgXxADkuWrF6gr0WVB+AtxjEud659ot+4B+ttWHPw+N1\n qLntehftutxxumOlVdGYB5aDcmB7iw2eoTMvDdAkxtkHylRSc4OrZYo6igZ4HuVj/D8f\n cl4sGXZPSuK0OkglbxLfzTkbBByeFi/We7gftZpWlJpWjKna9t8viK9SM0S4K6yMvED0\n AvLw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775402794; x=1776007594;\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=vtzvMbJwqmZg1QTzQYdfCcfO+oD+mRx9jQ0oIMWTBPI=;\n b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SMTP id\n d2e1a72fcca58-82d0db8b083mr8599271b3a.42.1775402794346;\n Sun, 05 Apr 2026 08:26:34 -0700 (PDT)",
        "From": "Trieu Huynh <vikingtc4@gmail.com>",
        "X-Google-Original-From": "Trieu Huynh <viking4@gmail.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "Trieu Huynh <vikingtc4@gmail.com>, Peter Xu <peterx@redhat.com>,\n Fabiano Rosas <farosas@suse.de>",
        "Subject": "[PATCH 1/2] migration: track timing and received pages in\n MigrationIncomingState",
        "Date": "Sun,  5 Apr 2026 22:26:07 +0700",
        "Message-ID": "<20260405152612.93027-2-viking4@gmail.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260405152612.93027-1-viking4@gmail.com>",
        "References": "<20260405152612.93027-1-viking4@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Received-SPF": "pass client-ip=2607:f8b0:4864:20::42c;\n envelope-from=vikingtc4@gmail.com; helo=mail-pf1-x42c.google.com",
        "X-Spam_score_int": "-17",
        "X-Spam_score": "-1.8",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.8 / 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 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,\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": "From: Trieu Huynh <vikingtc4@gmail.com>\n\nAdd start_time, total_time, received_normal_pages,\nreceived_zero_pages, and received_xbzrle_pages to\nMigrationIncomingState.\n\nstart_time is recorded when the incoming state transitions to ACTIVE;\ntotal_time is recorded when it transitions to COMPLETED. The page\ncounters are incremented in ram_load_precopy() as each page type is\nreceived from the source.\n\nThese fields will be used by a subsequent patch to populate\nfill_destination_migration_info() for the migration COMPLETED case.\n\nSigned-off-by: Trieu Huynh <vikingtc4@gmail.com>\n---\n migration/migration.c |  2 ++\n migration/migration.h | 17 +++++++++++++++++\n migration/ram.c       |  3 +++\n 3 files changed, 22 insertions(+)",
    "diff": "diff --git a/migration/migration.c b/migration/migration.c\nindex 5c9aaa6e58..17c9a8b344 100644\n--- a/migration/migration.c\n+++ b/migration/migration.c\n@@ -726,6 +726,7 @@ static void process_incoming_migration_bh(void *opaque)\n      */\n     migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE,\n                       MIGRATION_STATUS_COMPLETED);\n+    mis->total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - mis->start_time;\n     migration_incoming_state_destroy();\n }\n \n@@ -758,6 +759,7 @@ process_incoming_migration_co(void *opaque)\n     migrate_set_state(&mis->state, MIGRATION_STATUS_SETUP,\n                       MIGRATION_STATUS_ACTIVE);\n \n+    mis->start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);\n     mis->loadvm_co = qemu_coroutine_self();\n     ret = qemu_loadvm_state(mis->from_src_file, &local_err);\n     mis->loadvm_co = NULL;\ndiff --git a/migration/migration.h b/migration/migration.h\nindex b6888daced..cd51ae452c 100644\n--- a/migration/migration.h\n+++ b/migration/migration.h\n@@ -176,6 +176,23 @@ struct MigrationIncomingState {\n     /* PostCopyFD's for external userfaultfds & handlers of shared memory */\n     GArray   *postcopy_remote_fds;\n \n+    /*\n+     * Timestamps for reporting migration duration via query-migrate on the\n+     * destination. start_time is recorded when the state moves to ACTIVE;\n+     * total_time is recorded when it moves to COMPLETED.\n+     */\n+    int64_t start_time;\n+    int64_t total_time;\n+\n+    /*\n+     * Page counters for reporting RAM statistics via query-migrate on the\n+     * destination.  Incremented in ram_load_precopy() as each page type\n+     * is received.\n+     */\n+    uint64_t received_normal_pages;\n+    uint64_t received_zero_pages;\n+    uint64_t received_xbzrle_pages;\n+\n     MigrationStatus state;\n \n     /*\ndiff --git a/migration/ram.c b/migration/ram.c\nindex 979751f61b..6646e5daad 100644\n--- a/migration/ram.c\n+++ b/migration/ram.c\n@@ -4417,10 +4417,12 @@ static int ram_load_precopy(QEMUFile *f)\n                 break;\n             }\n             ram_handle_zero(host, TARGET_PAGE_SIZE);\n+            mis->received_zero_pages++;\n             break;\n \n         case RAM_SAVE_FLAG_PAGE:\n             qemu_get_buffer(f, host, TARGET_PAGE_SIZE);\n+            mis->received_normal_pages++;\n             break;\n \n         case RAM_SAVE_FLAG_XBZRLE:\n@@ -4430,6 +4432,7 @@ static int ram_load_precopy(QEMUFile *f)\n                 ret = -EINVAL;\n                 break;\n             }\n+            mis->received_xbzrle_pages++;\n             break;\n         case RAM_SAVE_FLAG_MULTIFD_FLUSH:\n             multifd_recv_sync_main();\n",
    "prefixes": [
        "1/2"
    ]
}