From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: damien.hedde@greensocs.com, edgar.iglesias@xilinx.com,
Mirela Grujic <mirela.grujic@greensocs.com>,
mark.burton@greensocs.com, qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 0/9] Initial support for machine creation via QMP
Date: Fri, 21 May 2021 13:32:41 +0200 [thread overview]
Message-ID: <87zgwo5nl2.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <93ae82d3-f9a7-f347-a013-54ae5cdc95f7@redhat.com> (Paolo Bonzini's message of "Thu, 13 May 2021 19:52:41 +0200")
Paolo Bonzini <pbonzini@redhat.com> writes:
> Hi Mirela, this is very interesting!
>
> It's unfortunate that I completely missed the discussions in
> January/February. You might have noticed that in the 5.2/6.0
> timeframe I worked on cleaning up the machine initialization phases
> and qemu_init. The idea behind the cleanup was to identify clearly
> the steps from one phase to the next. I am very happy that you are
> already benefitting from that work in this series and you were able to
> make a prototype with so little code.
>
> My plan was a bit more ambitious though :) and it is laid out at
> https://wiki.qemu.org/User:Paolo_Bonzini/Machine_init_sequence.
>
> My plan was to have completely different binaries than the current
> qemu-system-*.
Now you have 2x problems :)
> These would only have a handful of command line
> options (such as -name, -sandbox, -trace, -L) and would open a QMP
> connection on stdio.
>
> All other command line option would be either considered legacy or
> adjusted to be part of two new QMP commands, machine-set and
> accel-set, which would advance through the phases like this:
>
> PHASE_NO_MACHINE
> -> machine-set -> PHASE_MACHINE_CREATED ->
> -> accel-set -> PHASE_ACCEL_CREATED -> PHASE_MACHINE_INITIALIZED ->
> -> finish-machine-init -> PHASE_MACHINE_READY
> -> cont
Is machine-set one big command, or a sequence of commands, where each
command configures just one thing?
Same for accel-set.
Permit me to go off on a tangent: how much and what kind of magic do we
want in the initialization sequence?
The existing order is a confusing mess grown out of a half-hearted
attempt to make things just work. We've talked about it a few times,
e.g. here:
Message-ID: <87poomg77m.fsf@dusky.pond.sub.org>
https://lists.nongnu.org/archive/html/qemu-devel/2016-09/msg00163.html
Are you aiming for "leave ordering to the user", or for "do the right
thing" (the user's order doesn't matter)", or for "neither; confusing
messes are fun"?
Another tangent:
1. A command line option is like a QMP command that returns nothing.
Generating CLI options from a QAPI schema is no harder than generating
QMP commands, it's just work.
2. A configuration file is like a command line, only easier to work with
when configuration becomes non-trivial. Generating configuration file
language from a QAPI schema is no harder than generating QMP commands /
CLI options, it's just work.
3. QMP is strictly more powerful than CLI or comfiguration file. It's
also less convenient for ad hoc use by humans: compare -readconfig
vm123.cfg to feeding the equivalent QMP commands with socat.
4. We'll see whether the convenience for humans can motivate us to put
in the work.
> I think this idea would work well with your plan below, because the
> preconfiguration that you need to do happens mostly at
> PHASE_MACHINE_INITIALIZED.
>
> Of course, the disadvantage of my approach is that, in the initial
> version, a lot of capabilities of QEMU are not available (especially
> with respect to the UI, since there's no "display-add"
> command). However, the basic implementation of machine-set and
> accel-set should not really be *that* much more work, and it should be
> doable in parallel with the conversion efforts for those options. For
> example, today I posted a series that maps -smp to -M (and then, SMP
> configuration would automatically become available in machine-set).
>
> I have placed the skeleton of the work I was doing at
> https://gitlab.com/bonzini/qemu/ in the branch qemu-qmp-targets. You
> can see a sample execution at
> https://asciinema.org/a/TXMX8EZh8Md0fZnuE7uhfv6cO. I have not touched
> some of the patches in a long time, but I plan to give them a quick
> test tomorrow. Starting from the code in that branch, it should not
> be hard to implement the machine-set and accel-set commands in the
> same fashion as QEMU 5.2's implementation of object-add.
>
> Thanks for posting these patches, I have started a light review of them.
Please cc: on future work in this area.
I'm about to drop off for two weeks of vacation, though :)
next prev parent reply other threads:[~2021-05-21 11:33 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 8:25 [RFC PATCH 0/9] Initial support for machine creation via QMP Mirela Grujic
2021-05-13 8:25 ` [RFC PATCH 1/9] vl: Allow finer control in advancing machine through phases Mirela Grujic
2021-05-13 8:25 ` [RFC PATCH 2/9] replace machine phase_check with machine_is_initialized/ready calls Mirela Grujic
2021-05-13 17:46 ` Paolo Bonzini
2021-05-14 13:13 ` Mirela Grujic
2021-05-14 21:14 ` Paolo Bonzini
2021-06-07 16:03 ` Eric Blake
2021-05-13 8:25 ` [RFC PATCH 3/9] rename MachineInitPhase enumeration constants Mirela Grujic
2021-05-13 8:25 ` [RFC PATCH 4/9] qapi: Implement 'query-machine-phase' command Mirela Grujic
2021-05-13 17:44 ` Paolo Bonzini
2021-05-19 15:43 ` Daniel P. Berrangé
2021-05-13 8:25 ` [RFC PATCH 5/9] qapi: Implement 'next-machine-phase' command Mirela Grujic
2021-06-04 14:25 ` Eric Blake
2021-06-05 14:40 ` Paolo Bonzini
2021-05-13 8:25 ` [RFC PATCH 6/9] qapi: Implement 'advance-machine-phase' command Mirela Grujic
2021-05-19 15:37 ` Kevin Wolf
2021-05-13 8:25 ` [RFC PATCH 7/9] qdev-monitor: Restructure and fix the check for command availability Mirela Grujic
2021-05-13 17:43 ` Paolo Bonzini
2021-05-14 13:00 ` Mirela Grujic
2021-05-13 8:25 ` [RFC PATCH 8/9] qapi: Introduce 'allow-init-config' option Mirela Grujic
2021-05-13 8:25 ` [RFC PATCH 9/9] qapi: Allow some commands to be executed in machine 'initialized' phase Mirela Grujic
2021-05-13 17:52 ` [RFC PATCH 0/9] Initial support for machine creation via QMP Paolo Bonzini
2021-05-14 12:48 ` Mirela Grujic
2021-05-14 16:00 ` Paolo Bonzini
2021-05-14 16:20 ` Daniel P. Berrangé
2021-05-14 18:32 ` Paolo Bonzini
2021-05-24 17:20 ` Igor Mammedov
2021-05-24 19:05 ` Igor Mammedov
2021-05-21 11:32 ` Markus Armbruster [this message]
2021-05-21 17:02 ` Paolo Bonzini
2021-05-21 14:06 ` Mirela Grujic
2021-05-21 16:57 ` Paolo Bonzini
2021-05-24 18:27 ` Igor Mammedov
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=87zgwo5nl2.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=damien.hedde@greensocs.com \
--cc=edgar.iglesias@xilinx.com \
--cc=mark.burton@greensocs.com \
--cc=mirela.grujic@greensocs.com \
--cc=pbonzini@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.