From: Fabiano Rosas <farosas@suse.de>
To: Markus Armbruster <armbru@redhat.com>,
"Dr. David Alan Gilbert" <dave@treblig.org>
Cc: Peter Xu <peterx@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 14/20] migration: Use output visitor in info command
Date: Fri, 18 Sep 2026 19:32:07 -0300 [thread overview]
Message-ID: <87ik42ry1k.fsf@suse.de> (raw)
In-Reply-To: <87h5jnnf7u.fsf@pond.sub.org>
Markus Armbruster <armbru@redhat.com> writes:
> "Dr. David Alan Gilbert" <dave@treblig.org> writes:
>
>> * Peter Xu (peterx@redhat.com) wrote:
>>> On Thu, Sep 17, 2026 at 01:53:22PM +0200, Markus Armbruster wrote:
>>> > Fabiano Rosas <farosas@suse.de> writes:
>>> >
>>> > > The hmp_info_migrate_parameters function currently open-codes the
>>> > > mon_printf calls for each migration parameter. As with the set command
>>> > > in the last patch, this should not be necessary as the QAPI
>>> > > infrastructure already has generated code that takes type and struct
>>> > > member names into account, including converting _ from C into the '-'
>>> > > character as part of parameter names strings.
>>> > >
>>> > > The current code is also quite painful to rebase if a series has been
>>> > > carried for a long time while parameters have been added in master.
>>> > >
>>> > > Replace all of this with a conversion from MigrationParameters to
>>> > > QDict using an output visitor and a loop over the QDict that prints
>>> > > per-QAPI-type formatted strings.
>>> > >
>>> > > Modelled after block/qapi.c:dump_qobject, but with some changes to
>>> > > keep the migration command output formatting.
>>> > >
>>> > > Signed-off-by: Fabiano Rosas <farosas@suse.de>
>>> >
>>> > Old output of info migrate_parameters for me:
>>> >
>>> > announce-initial: 50
>>> > announce-max: 550
>>> > announce-rounds: 5
>>> > announce-step: 100
>>> > throttle-trigger-threshold: 50
>>> > cpu-throttle-initial: 20
>>> > cpu-throttle-increment: 10
>>> > cpu-throttle-tailslow: off
>>> > max-cpu-throttle: 99
>>> > tls-creds:
>>> > tls-hostname:
>>> > tls-authz:
>>> > max-bandwidth: 134217728
>>> > avail-switchover-bandwidth: 0
>>> > max-postcopy-bandwidth: 0
>>> > downtime-limit: 300
>>> > x-checkpoint-delay: 20000
>>> > multifd-channels: 2
>>> > multifd-compression: none
>>> > zero-page-detection: multifd
>>> > xbzrle-cache-size: 67108864
>>> > x-vcpu-dirty-limit-period: 1000
>>> > vcpu-dirty-limit: 1
>>> > mode: normal
>>> > direct-io: off
>>> > x-rdma-chunk-size: 1048576
>>> > cpr-exec-command:
>>> >
>>> > New output:
>>> >
>>> > cpu-throttle-tailslow: off
>>> > xbzrle-cache-size: 67108864
>>> > cpu-throttle-initial: 20
>>> > announce-max: 550
>>> > direct-io: off
>>> > avail-switchover-bandwidth: 0
>>> > local: off
>>> > zero-page-detection: multifd
>>> > multifd-qatzip-level: 1
>>> > x-rdma-chunk-size: 1048576
>>> > multifd-channels: 2
>>> > mode: normal
>>> > multifd-zstd-level: 1
>>> > announce-initial: 50
>>> > downtime-limit: 300
>>> > tls-authz:
>>> > cpr-exec-command:
>>> >
>>> > vcpu-dirty-limit: 1
>>> > multifd-compression: none
>>> > announce-rounds: 5
>>> > announce-step: 100
>>> > tls-creds:
>>> > x-vcpu-dirty-limit-period: 1000
>>> > multifd-zlib-level: 1
>>> > max-cpu-throttle: 99
>>> > max-postcopy-bandwidth: 0
>>> > tls-hostname:
>>> > throttle-trigger-threshold: 50
>>> > max-bandwidth: 134217728
>>> > x-checkpoint-delay: 20000
>>> > cpu-throttle-increment: 10
>>> >
>>> > New output has an unwanted blank line after "cpr-exec-command:".
>>> >
>>> > New output adds @local, @multifd-qatzip-level, @multifd-zlib-level,
>>> > @multifd-zstd-level. Commit message should point that out.
>>> >
>>> > Order of parameters changes, and not for the better. Hmm.
>>>
>>> Good point.. it might start to be awkward to users looking for tls-*,
>>> multifd-*, announce-* or cpu-throttle*, etc. after this change, expecting
>>> them grouped.
>>>
>>> Maybe we can sort them by name with inserting top level to a QList first
>>> from the QDict.
>>
>> Are there any filter visitors in qemu's visitor system - e.g. something that
>> sorts?
>
> No. Visitors walk members in source order. Source order is good as
> long as we care to make it good. But it doesn't help us here, because
> we use the visitor only to convert to QObject, then walk that. This
> loses order.
>
> If QDict iterated in insertion order, we'd be fine. Python dict do.
> Could be a fun little project for someone with time to spare.
>
> The other solution is to iterate over sorted QDict keys, as Peter says.
>
Thanks, I didn't notice the output changed so drastically. The readline
completion suggestions are sorted, so I just assumed the parameters were
sorted too. I'll fix it up.
next prev parent reply other threads:[~2026-09-18 22:32 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 0:01 [PATCH v3 00/20] migration: MigrationParameters changes Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 01/20] checkpatch: Fix checking of newlines in error messages Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 02/20] migration/options.c: Don't export migrate_tls_opts_free Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 03/20] migration: Rename variables in qmp_migrate_set_parameters Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 04/20] migration: Use QAPI_CLONE_MEMBERS in migrate_params_apply Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 05/20] migration: Merge parameter structs instead of assigning one by one Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 06/20] migration: Open code migrate_params_apply Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 07/20] migration: Stop freeing s->parameters members individually Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 08/20] migration: Use migrate_params_free during finalize Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 09/20] tests/qtest/migration: Add a test for HMP Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 10/20] tests/qtest/migration: Add a test for HMP completion Fabiano Rosas
2026-09-15 0:01 ` [PATCH v3 11/20] migration: HMP: Change bandwidth parameters expected input unit Fabiano Rosas
2026-09-15 0:02 ` [PATCH v3 12/20] migration: Change HMP 'info migrate_parameters' output Fabiano Rosas
2026-09-15 11:57 ` Markus Armbruster
2026-09-17 21:08 ` Dr. David Alan Gilbert
2026-09-15 0:02 ` [PATCH v3 13/20] migration: Use keyval input visitor in HMP set command Fabiano Rosas
2026-09-17 11:08 ` Markus Armbruster
2026-09-17 18:28 ` Peter Xu
2026-09-17 18:41 ` Markus Armbruster
2026-09-15 0:02 ` [PATCH v3 14/20] migration: Use output visitor in info command Fabiano Rosas
2026-09-17 11:53 ` Markus Armbruster
2026-09-17 11:58 ` Markus Armbruster
2026-09-17 18:41 ` Peter Xu
2026-09-17 20:57 ` Dr. David Alan Gilbert
2026-09-18 8:20 ` Markus Armbruster
2026-09-18 22:32 ` Fabiano Rosas [this message]
2026-09-18 22:41 ` Fabiano Rosas
2026-09-15 0:02 ` [PATCH v3 15/20] migration: Rewrite migrate_set_parameter_completion using QDict Fabiano Rosas
2026-09-17 12:02 ` Markus Armbruster
2026-09-15 0:02 ` [PATCH v3 16/20] migration: Add capabilities into MigrationParameters Fabiano Rosas
2026-09-15 0:02 ` [PATCH v3 17/20] migration: Remove s->capabilities Fabiano Rosas
2026-09-15 0:02 ` [PATCH v3 18/20] qapi/migration: Deprecate capabilities commands Fabiano Rosas
2026-09-15 0:02 ` [PATCH v3 19/20] migration: Set the parameters present flag with a clone visitor Fabiano Rosas
2026-09-17 14:10 ` Markus Armbruster
2026-09-15 0:02 ` [PATCH v3 20/20] qapi: Remove MigrationParameter Fabiano Rosas
2026-09-17 12:06 ` Markus Armbruster
2026-09-22 12:44 ` [PATCH v3 00/20] migration: MigrationParameters changes Fabiano Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ik42ry1k.fsf@suse.de \
--to=farosas@suse.de \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.