All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Damien Hedde <damien.hedde@greensocs.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Mark Burton" <mark.burton@greensocs.com>,
	qemu-devel@nongnu.org,
	"Mirela Grujic" <mirela.grujic@greensocs.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: Redesign of QEMU startup & initial configuration
Date: Mon, 13 Dec 2021 16:47:01 +0100	[thread overview]
Message-ID: <8735mwzeve.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <7fece46b-c578-8303-2dec-cf851ff5b61b@greensocs.com> (Damien Hedde's message of "Mon, 13 Dec 2021 11:51:40 +0100")

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


[...]

>> Painted with a big brush, there are two kinds of code in hw/: actual
>> device emulation, and "wiring".  Both in C, and sometimes in the same .c
>> file.
>> 
>> Doing the "wiring" in configuration instead is less powerful (no longer
>> Turing complete[2]), but easier to reason about, maintain and change.
>> Change is possible even in the field.  The obvious separation between
>> emulation and wiring is a nice bonus.
>> 
>> The wiring C code supports something not unlike templating: we have a
>> number of configuration knobs that deposit something for the wiring C
>> code to pick up.
>> 
>> It's rather limited, though: the "variables" are fixed at compile time.
>> 
>> Aside: the handling of variables that doesn't get substituted is wildly
>> inconsistent.
>> 
>> Perhaps doing wiring in configuration reduces the maintenance burden to
>> a degree where we can mitigate the "defaults gone bad, but no want
>> change" issue by offering additional, better things instead of changing
>> existing, bad things.  I don't know.
>
> We should be careful with config files, because the configuration
> parser can become a real mess.

Oh yes.

>                                There are 2 kinds of config files:
>
> 1. Imperative: an equivalent of QAPI/QMP command script. (eg like CLI
> config files Markus proposed). These are easy to handle because they 
> follow the QMP flow. We do one command after the other, the ordering
> of tasks is clear.
>
> 2. Descriptive: A description of the configuration where we describe
> the components and the wiring. This can be really complicated because
> we easily end up with ordering/determinism issues when instantiating
> them afterwards. For example the  configuration parser may have to
> solve : Which device do I create first ? I don't think a configuration
> parser should have to solve such issues, but I'm not sure if we can
> avoid it.

Actual instantiation necessarily happens in some order[*].

An imperative configuration dictates the order.

A descriptive configuration leaves it to some planner software.

Any descriptive configuration can therefore be transformed into an
imperative one.  *Unless* the planner *also* breaks up components into
smaller ones that aren't accessible in the imperative configuration.

Example: say the configuration specifies a device and its connections as
a unit.  Say we have two devices A and B, where A has a connection A->B,
and B a connection B->A.  A sufficiently smart planner can then create
A, B, A->B, B->A.  You can't express this imperatively unless connection
B->A can be specified separately from device A.

I propose to start stupid, i.e. with an imperative, low-level
configuration.  Then add smarts as we need them.


[*] Even if you instantiate stuff concurrently for some reason, there
should be at least some conceptual order.



  reply	other threads:[~2021-12-13 15:48 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  6:57 Redesign of QEMU startup & initial configuration Markus Armbruster
2021-12-09 19:11 ` Daniel P. Berrangé
2021-12-09 20:01   ` Mark Burton
2021-12-09 20:28     ` Daniel P. Berrangé
2021-12-10  8:34   ` Paolo Bonzini
2021-12-10 11:25     ` Daniel P. Berrangé
2021-12-10 14:15       ` Mark Burton
2021-12-10 14:26         ` Daniel P. Berrangé
2021-12-10 14:42           ` Mark Burton
2021-12-10 15:13       ` Paolo Bonzini
2021-12-10 15:26     ` Markus Armbruster
2021-12-10 15:39       ` Daniel P. Berrangé
2021-12-13 15:19         ` Markus Armbruster
2021-12-13 17:30           ` Paolo Bonzini
2021-12-13 17:59             ` Daniel P. Berrangé
2021-12-13 20:22               ` Mark Burton
2021-12-14 13:05                 ` Daniel P. Berrangé
2021-12-14 13:11                   ` Mark Burton
2021-12-14 13:21                     ` Daniel P. Berrangé
2021-12-14 13:36                       ` Mark Burton
2021-12-14 13:48                         ` Daniel P. Berrangé
2021-12-14 14:42                           ` Mark Burton
2021-12-14 14:56                             ` Daniel P. Berrangé
2021-12-14 15:12                               ` Markus Armbruster
2021-12-14 15:14                                 ` Mark Burton
2021-12-10 13:54   ` Markus Armbruster
2021-12-10 15:38     ` Paolo Bonzini
2021-12-13 15:28       ` Markus Armbruster
2021-12-13 17:37         ` Paolo Bonzini
2021-12-13 18:07           ` Daniel P. Berrangé
2021-12-13 18:37             ` Paolo Bonzini
2021-12-13 18:53               ` Daniel P. Berrangé
2021-12-14  7:09                 ` Meeting today? Mark Burton
2021-12-14 11:37                   ` Markus Armbruster
2021-12-14 11:39                     ` Mark Burton
2021-12-14 12:49                     ` Daniel P. Berrangé
2021-12-14 14:49                       ` Markus Armbruster
2022-01-04  9:29                         ` Edgar E. Iglesias
2022-01-06 11:21                           ` "Startup" meeting (was Re: Meeting today?) Mark Burton
2022-01-06 11:23                             ` Daniel P. Berrangé
2022-01-11 10:20                               ` Philippe Mathieu-Daudé
2022-01-11 10:22                                 ` Mark Burton
2022-01-17 17:13                                   ` Kevin Wolf
2022-01-17 19:02                                     ` Markus Armbruster
2022-01-23 20:49                                     ` Mark Burton
2022-01-25  8:50                                       ` Juan Quintela
2022-01-25 10:45                                         ` Philippe Mathieu-Daudé via
2022-01-25 10:58                                           ` Juan Quintela
2022-02-08 11:52                                             ` Mark Burton
2022-02-08 12:35                                               ` Juan Quintela
2022-01-11 10:28                                 ` Daniel P. Berrangé
2021-12-15 18:46                 ` Redesign of QEMU startup & initial configuration Paolo Bonzini
2021-12-15 18:50                   ` Daniel P. Berrangé
2021-12-14 11:48           ` Markus Armbruster
2021-12-14 13:00             ` Mark Burton
2021-12-14 14:54               ` Markus Armbruster
2021-12-15 20:00             ` Paolo Bonzini
2021-12-15 20:14               ` Mark Burton
2021-12-16 10:24               ` Markus Armbruster
2021-12-16 15:28                 ` Paolo Bonzini
2021-12-16 15:40                   ` Daniel P. Berrangé
2021-12-16 16:00                     ` Mark Burton
2021-12-16 16:15                       ` Daniel P. Berrangé
2021-12-16 16:27                         ` Mark Burton
2021-12-13 10:51     ` Damien Hedde
2021-12-13 15:47       ` Markus Armbruster [this message]
2022-01-04 12:40 ` Richard W.M. Jones
2022-01-13 16:10   ` Markus Armbruster

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