All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Damien Hedde <damien.hedde@greensocs.com>
Cc: berrange@redhat.com, edgar.iglesias@gmail.com,
	mark.burton@greensocs.com, qemu-devel@nongnu.org,
	mirela.grujic@greensocs.com, marcandre.lureau@redhat.com,
	pbonzini@redhat.com, jsnow@redhat.com
Subject: Re: [PATCH RFC 00/11] vl: Explore redesign of startup
Date: Wed, 08 Dec 2021 08:07:03 +0100	[thread overview]
Message-ID: <87k0gfvalk.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <8e032cf7-8aa4-73f9-b978-f2b0d616fff2@greensocs.com> (Damien Hedde's message of "Tue, 7 Dec 2021 17:52:26 +0100")

Damien Hedde <damien.hedde@greensocs.com> writes:

> Hi Markus,
>
> It looks promising. I did not think we could so "easily" have a new
> working startup.

Look at this big axe I got!  ;)

>                  But I'm not so sure that I understand how we should 
> progress from here.

I neglected to explain this my cover letter.  My apologies...

> I see 3 main parts in this:
> A. introducing new binary (meson, ...)
> B. startup api: phase related stuff (maybe more)
> C. cli to qmp parser

Makes sense to me at a high level.

> I think if we want to add a new binary (instead of replace it), there
> will be some common api and every startup will have to
> support/implement it. Probably some part of vl.c will have to go in
> some common code.
> In practice, we probably should introduce/extract this before
> introducing the new binary.

I think there are two practical ways to structure such patches:

* Refactor existing code to make parts available for new code, then
  introduce new code that uses them.

* Copy, cut unwanted parts, refactor to deduplicate.

I think either way can work as patches.  The second way is how I'd start
the work myself.

> One central part of this api is the phase mechanism (even if legacy
> startup can only support it partially or not-at-all).
>
> I think we have 2 choices:
> + we have to use until_phase explicitly
> + we make qmp commands implicitly advances phases when needed.

Yes.

> I think it's better to go the implicit way as much as possible: it
> means we focus on commands and not on some artificial phases we set up
> because of legacy.

An explicit phase control command looked like the fast & easy path to
phase control to me, so that's what I picked for the RFC.

Instead of a single "advance to arbitrary phase" command, we can have
multiple "do X, which requires phase Y and advances to phase Y+1"
commands.  E.g. "create machine" goes from @no-machine to
@machine-created.

We may want additional, automatic phase advances for convenience, but I
feel it's best to get the essential stuff roughly right before talking
about convenience features.

> Either way, we probably should put the phase info in qapi so that we
> don't have to hardcode that in every command in order to have common 
> error handling. One thing we could do is replace "allow-preconfig" in
> qapi by some phase requirement entry(entries?) and make qmp call 
> qemu_until_phase() or some qemu_phase_check() function.

I'd also like some phase support from QAPI.  Manual phase checking code
in commands would be tedious and error prone.  Better to declare
required phase(s) in the schema.

One small step further: declare phase transitions in the schema, too.
Then the phase state machine definition is all *data*.  Data is easier
to reason about than code.  Extracting the complete state machine from
the schema is straightforward.  Extracting it from C code is anything
but.

> We also maybe need to sort out if we want to merge the phases into the
> runstate.

Yes.

> Thanks for making the effort to do this rfc,

Thanks for your feedback!



      reply	other threads:[~2021-12-08  7:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  7:04 [PATCH RFC 00/11] vl: Explore redesign of startup Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 01/11] vl: Cut off the CLI with an axe Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 02/11] vl: Drop x-exit-preconfig Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 03/11] vl: Hardcode a QMP monitor on stdio for now Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 04/11] vl: Hardcode a VGA device " Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 05/11] vl: Demonstrate (bad) CLI wrapped around QMP Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 06/11] vl: Factor qemu_until_phase() out of qemu_init() Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 07/11] vl: Implement qemu_until_phase() running from arbitrary phase Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 08/11] vl: Implement qemu_until_phase() running to " Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 09/11] vl: New QMP command until-phase Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 10/11] vl: Disregard lack of 'allow-preconfig': true Markus Armbruster
2021-12-02  7:04 ` [PATCH RFC 11/11] vl: Enter main loop in phase @machine-initialized Markus Armbruster
2021-12-02 10:26 ` [PATCH RFC 00/11] vl: Explore redesign of startup Markus Armbruster
2021-12-07 16:52 ` Damien Hedde
2021-12-08  7:07   ` Markus Armbruster [this message]

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=87k0gfvalk.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=damien.hedde@greensocs.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=jsnow@redhat.com \
    --cc=marcandre.lureau@redhat.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.