get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2233217,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2233217/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260505202640.1011006-17-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-17-peterx@redhat.com>",
    "date": "2026-05-05T20:26:33",
    "name": "[PULL,16/23] migration/qapi: Introduce system-wide \"remaining\" reports",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "2e3cff3aa8dd5fd56fc0359bb393ff0dd78cbf7a",
    "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-17-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/2233217/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2233217/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=M8523RIu;\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=iJED753Z;\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 4g998t1HbDz1yKX\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 06:29:18 +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 1wKMMN-0004bn-F3; Tue, 05 May 2026 16:27:15 -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 1wKMMH-0004Vf-GP\n for qemu-devel@nongnu.org; Tue, 05 May 2026 16:27:11 -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 1wKMME-0002eD-Hk\n for qemu-devel@nongnu.org; Tue, 05 May 2026 16:27:08 -0400",
            "from mail-qv1-f69.google.com (mail-qv1-f69.google.com\n [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-501-s3Z_xlT8PTSyp2x2DUzzGA-1; Tue, 05 May 2026 16:27:04 -0400",
            "by mail-qv1-f69.google.com with SMTP id\n 6a1803df08f44-8b597b14a22so10670296d6.0\n for <qemu-devel@nongnu.org>; Tue, 05 May 2026 13:27:04 -0700 (PDT)",
            "from x1.com ([142.189.10.167]) by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b53c6b8123sm155283806d6.35.2026.05.05.13.27.01\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 05 May 2026 13:27:02 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1778012825;\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=rbz2uMzwfgzI8Mc9mnmGPnBL6d4IDbn2j6z1RXzuo7Q=;\n b=M8523RIucVayfY8L8LFWfC2czNOutqfli0WMYArKFhWS920r4andMW4IsPI7+C3Y/i7irt\n iCE0zMT4Tutk1P+8M/m/sQSFLRbSDc+u9K2WFy4WvvzItV8qAeid76fJ3UnuBZ0tIAmuJ2\n ixoMG5uiTcjC7AWYUDbcsF/r8VVxGU0=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1778012823; x=1778617623; 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=rbz2uMzwfgzI8Mc9mnmGPnBL6d4IDbn2j6z1RXzuo7Q=;\n b=iJED753ZbH01oaZcY8ecUreEJSfoUQi8LoOF5a3Zsru0LF3eQ+NpLhC++AUnnki+tl\n aGAqoEnt/izBRxicE4tYYS8q569s/KmhRsug96MLOqbPNLG7+hhxSFbHqpziECEt9CBX\n bxSn3EEaYeGZKTo2LaLsipptFkvxIj2RnaK6C8QPRMFODnEZJBp8UkntGq1PmaI9AAd+\n 5MVTbB9gQ7qqM6WIP3WVMTHdzat0Jdq1ttsEIMxuaY2XAnsWmTKUr4IM8xsZB4QgMHL3\n 08GqvLhPf1aTM1Cm6yU80x7dyo5CjbHVZkCAZmYI00XTW18CDm35nYei/aiWjoZQz6kf\n CtNg=="
        ],
        "X-MC-Unique": "s3Z_xlT8PTSyp2x2DUzzGA-1",
        "X-Mimecast-MFC-AGG-ID": "s3Z_xlT8PTSyp2x2DUzzGA_1778012824",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778012823; x=1778617623;\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=rbz2uMzwfgzI8Mc9mnmGPnBL6d4IDbn2j6z1RXzuo7Q=;\n b=Uc8x9tXvx5iV+gIsjPJ87xEdYNPeM5WjmejWkdsPpRkvQaNOgkKGSKVhhCezvcCq9k\n lwm6JAfTntzYFa15s9dbu/sEkwDuGy2YLA/J87zdE5WHZfeL5CLcxlNKQoZ9O9DCwF4t\n tssBF+CU1tYbRwD7TZlf0ZJy6/DHDv6ENH3pRtK1mFZDA2ELIBwNxetUREyRMJpGe802\n Mm3jOzv5N3PTHGEqW2UP7twF5QpyCmly3vfLIMQWAtW9IWI/tiDsbRoaVUYMCMid34zI\n rSVNt0G/KutLWehW0tliuUPOaIByC1IA2QWd/F2HWEAF4KAZ0aMmL09gyzHnnlF1bu6d\n 8hPA==",
        "X-Gm-Message-State": "AOJu0YycsoaP8QPpSaidHLoGC10inlrxFAMfzQO0P8I42NoJtA6KLLnD\n uND8BcydWB35NxIWoN5534xvjjTAPFdJWuub7Av5/+NfsnMwQIxJKsIwMZuuMZvuLUpHU/1J5Bg\n EMYJQ2gZfBPnUsdYh/FT3RwnTSqCouQkuZWCgsHa8UGrj1sEtW1Di0xgzHL9QGBHDi5dwzOBINv\n tb1s5MRRfFqDlJ76D4xV9/fXHxo9p3rSRz0T8fSg==",
        "X-Gm-Gg": "AeBDieuzCOiTs1MxctP/FDZdNIhYb025xDVO/cDnqCYaQjpU48rtbYbRaUEtcz9Ltzi\n YEyP9gWny8bBKgHEo4i7Zf0t1lEa0RuG/Rc/9Qto0BnRA8rnjFjUz2FtPrLoFYeUNvxXvMe6M8Q\n smWrjp/PTE/9eeir76uKkMtjPi9NfBpuOG8thl9Bf83Jz40yUuV2shfgiWknFHHhMxZE8u4xPOk\n gYjQIrUId4mTXcIP+ou7ORv7iE2HEsKDaGA2M4PTcp4rLU+NFYj65vr/R09crDoh2iZG0Hxywmk\n Be7dHgm5CCrXBSO8431h9KyXnVOxgVcxPtV9ZuJW2lvpdOzPueXQjlxELT/ta0m/nzHjlJrtVnd\n 7tc2R1A0zJ8pI/4h6jmMPA/3PsbUM7e4m5ZCw/46M3QNCnSm7Bf+sCAE=",
        "X-Received": [
            "by 2002:a05:6214:5e08:b0:8b0:33a2:2520 with SMTP id\n 6a1803df08f44-8bc2ebdad5dmr7282466d6.10.1778012823313;\n Tue, 05 May 2026 13:27:03 -0700 (PDT)",
            "by 2002:a05:6214:5e08:b0:8b0:33a2:2520 with SMTP id\n 6a1803df08f44-8bc2ebdad5dmr7281756d6.10.1778012822615;\n Tue, 05 May 2026 13:27:02 -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>, Aseef Imran <aimran@redhat.com>,\n Juraj Marcin <jmarcin@redhat.com>,\n \"Dr. David Alan Gilbert\" <dave@treblig.org>,\n Markus Armbruster <armbru@redhat.com>",
        "Subject": "[PULL 16/23] migration/qapi: Introduce system-wide \"remaining\"\n reports",
        "Date": "Tue,  5 May 2026 16:26:33 -0400",
        "Message-ID": "<20260505202640.1011006-17-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": "Currently, mgmt can only query for remaining RAM using QMP command\n\"query-migrate\" and monitor the \"ram\" section.  There's no way to report\nsystem-wide remaining data including VFIO devices.  It was not a problem\nbefore, because for a very long time RAM was the only part that matters.\n\nAfter VFIO migrations landed upstream, it may not be enough. There can be\nGPU devices that contain GBs of device states.  Mgmt may want to know how\nmuch remaining for special devices like VFIO, because all of them will be\naccounted as VM data to migrate and will contribute to downtime in the\nswitchover phase.\n\nAdd a new \"remaining\" field in query-migrate results on the top level,\nreflecting system-wide remaining data, which will include everything like\nVFIO devices.\n\nThis information will be useful for mgmt to implement generic way of stall\ndetection that covers all system resources.  For example, when system-wide\nremaining data (especially, if sampled right after each migration\niteration) does not decrease anymore for a relatively long period of time,\nthen it may imply there is a challenge of converging, mgmt can react based\non how this value changes over time.\n\nBefore this patch, \"expected_downtime\" almost played this role. For\nexample, by monitoring \"expected_downtime\" at the beginning of each\niteration can in most cases also reflect the progress of migration\nsystem-wide.\n\nSaid that, \"expected_downtime\" was always calculated based on a bandwidth\nvalue that can fluctuate if avail-switchover-bandwidth is not used. This\nnew \"remaining\" field will remove that part of uncertainty for mgmt no\nmatter if avail-switchover-bandwidth is used by the mgmt.\n\nWith the new field, HMP \"info migrate\" now reports this:\n\n(qemu) info migrate\nStatus:                 active\nTime (ms):              total=12080, setup=14, exp_down=300\nRemaining:              1.36 GiB        <--- this is the new line\nRAM info:\n  Throughput (Mbps):    840.50\n  Sizes:                pagesize=4 KiB, total=4.02 GiB\n  Transfers:            transferred=1.18 GiB, remain=1.36 GiB\n    Channels:           precopy=1.18 GiB, multifd=0 B, postcopy=0 B\n    Page Types:         normal=307923, zero=388148\n  Page Rates (pps):     transfer=25660\n  Others:               dirty_syncs=1\n\nWhen VFIO is not involved, the value reported in the new field should be\napproximately the same as reported in the \"remaining\" field of the RAM\nsection.  It is only approximately because the system-wide remaining data\nis a cached value, which gets frequently updated by migration core.  OTOH,\nthe RAM's remaining data is accurate.\n\nWhen VFIO is involved, the new value reported should normally be larger,\nbecause it will include the size of VFIO remaining data too.\n\nCc: Aseef Imran <aimran@redhat.com>\nReviewed-by: Juraj Marcin <jmarcin@redhat.com>\nReviewed-by: Dr. David Alan Gilbert <dave@treblig.org>\nAcked-by: Markus Armbruster <armbru@redhat.com> # QAPI schema\nLink: https://lore.kernel.org/r/20260421202110.306051-15-peterx@redhat.com\nSigned-off-by: Peter Xu <peterx@redhat.com>\n---\n qapi/migration.json            | 4 ++++\n migration/migration-hmp-cmds.c | 5 +++++\n migration/migration.c          | 7 +++++++\n 3 files changed, 16 insertions(+)",
    "diff": "diff --git a/qapi/migration.json b/qapi/migration.json\nindex ed475e4261..9a4817ec73 100644\n--- a/qapi/migration.json\n+++ b/qapi/migration.json\n@@ -300,6 +300,9 @@\n #     average memory load of the virtual CPU indirectly.  Note that\n #     zero means guest doesn't dirty memory.  (Since 8.1)\n #\n+# @remaining: amount of bytes remaining to be migrated system-wide,\n+#     includes both RAM and all devices (like VFIO).  (Since 11.1)\n+#\n # Features:\n #\n # @unstable: Members @postcopy-latency, @postcopy-vcpu-latency,\n@@ -310,6 +313,7 @@\n ##\n { 'struct': 'MigrationInfo',\n   'data': {'*status': 'MigrationStatus', '*ram': 'MigrationRAMStats',\n+           '*remaining': 'size',\n            '*vfio': 'VfioStats',\n            '*xbzrle-cache': 'XBZRLECacheStats',\n            '*total-time': 'int',\ndiff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c\nindex 4f6c1dbf89..2703448c52 100644\n--- a/migration/migration-hmp-cmds.c\n+++ b/migration/migration-hmp-cmds.c\n@@ -178,6 +178,11 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)\n         }\n     }\n \n+    if (info->has_remaining) {\n+        g_autofree char *remaining = size_to_str(info->remaining);\n+        monitor_printf(mon, \"Remaining: \\t\\t%s\\n\", remaining);\n+    }\n+\n     if (info->has_socket_address) {\n         SocketAddressList *addr;\n \ndiff --git a/migration/migration.c b/migration/migration.c\nindex ab09dcbcf4..ecc69dc4d2 100644\n--- a/migration/migration.c\n+++ b/migration/migration.c\n@@ -1076,6 +1076,12 @@ static void populate_time_info(MigrationInfo *info, MigrationState *s)\n     }\n }\n \n+static void populate_global_info(MigrationInfo *info, MigrationState *s)\n+{\n+    info->has_remaining = true;\n+    info->remaining = qatomic_read(&mig_stats.dirty_bytes_total);\n+}\n+\n static void populate_ram_info(MigrationInfo *info, MigrationState *s)\n {\n     size_t page_size = qemu_target_page_size();\n@@ -1177,6 +1183,7 @@ static void fill_source_migration_info(MigrationInfo *info)\n         /* TODO add some postcopy stats */\n         populate_time_info(info, s);\n         populate_ram_info(info, s);\n+        populate_global_info(info, s);\n         migration_populate_vfio_info(info);\n         break;\n     case MIGRATION_STATUS_COLO:\n",
    "prefixes": [
        "PULL",
        "16/23"
    ]
}