Skip to content

migration: include timing and RAM stats on destination when query-migrate

Trieu Huynh qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2migration: track timing and received pages in MigrationIncomingStatemigration/migration.c migration/migration.h migration/ram.c+22 -03 replies
2/2migration: expose RAM stats and timing on destination via query-migratemigration/migration.c qapi/migration.json+42 -72 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] migration: include timing and RAM stats on destination when query-migrate

From: Trieu Huynh <[email protected]>

When query-migrate is called on the *destination* QEMU after a precopy migration completes it returns only {"status": "completed"} — no timing, no RAM statistics. The source correctly returns total-time, downtime, setup-time, and full ram stats.

This series fixes the gap in two commits:

* commit 1: Track start/end timestamps and per-page-type counters in MigrationIncomingState, recorded in the receive path.

* commit 2: Make source-only MigrationStats fields optional in the QAPI schema so the destination can populate info->ram with only the fields that are meaningful on the receive side. Fields computed from tracked counters (transferred, normal, duplicate, mbps, pages-per-second) are shown; source-only fields (dirty-sync-count, precopy-bytes, etc.) are absent.

The QAPI change (commit 2) is ABI-compatible: optional fields that are not set are simply absent from the output. Source-side callers are unaffected because populate_ram_info() sets all optional fields via has_* setters, so the source output is identical to before.

On dst, {"execute":"query-migrate"}
* As-is:

{
    "return": {
        "status": "completed"
}
* To-be:
{
    "return": {
        "status": "completed",
        "total-time": 94,
        "ram": {
            "total": 554508288,
            "pages-per-second": 1440234,
            "page-size": 4096,
            "remaining": 0,
            "mbps": 97.955404255319152,
            "transferred": 1150976,
            "duplicate": 135101,
            "normal-bytes": 1150976,
            "normal": 281
        }
    }
}

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3151

Trieu Huynh (2):
migration: track timing and received pages in MigrationIncomingState
migration: expose RAM stats and timing on destination via
query-migrate

 migration/migration.c | 37 +++++++++++++++++++++++++++++++++++++
 migration/migration.h | 17 +++++++++++++++++
 migration/ram.c       |  3 +++
 qapi/migration.json   | 14 +++++++-------
 4 files changed, 64 insertions(+), 7 deletions(-)
Signature · 1 line
2.43.0