qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: "Damien Hedde" <damien.hedde@greensocs.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Mark Burton" <mark.burton@greensocs.com>,
	qemu-devel@nongnu.org,
	"Mirela Grujic" <mirela.grujic@greensocs.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: Redesign of QEMU startup & initial configuration
Date: Thu, 16 Dec 2021 16:28:29 +0100	[thread overview]
Message-ID: <8dd178b7-631b-25b4-4f68-334b0d583f72@redhat.com> (raw)
In-Reply-To: <875yroyhih.fsf@dusky.pond.sub.org>

On 12/16/21 11:24, Markus Armbruster wrote:
>> Not really, in particular the startup has been mostly reworked already
>> and I disagree that it is messy.  softmmu/vl.c is messy, sure: it has
>> N different command line parser for command line options, magic
>> related to default devices, and complicated ordering of -object
>> creation.
>>
>> But the building of emulator data structures is not messy; only the
>> code that transforms the user's instructions into startup commands.
>> The messy parts are almost entirely contained within softmmu/vl.c.
> 
> In my opinion, the worst mess is the reordering and the (commonly
> unstated, sometimes unknown) dependencies that govern it.
> The reordering is part of the stable interface.  Its finer points
> basically nobody understands, at least not without staring at the code.

Then we agree, because that's what I meant by "the messy parts are 
almost entirely contained within softmmu/vl.c".

>> The one (and important, but fixable) exception is backends for
>> on-board devices: serial_hd, drive_get, and nd_table.
> 
> Practical ideas on fixing it?

What you did with pflash, turned up to 11.

>>> * A new binary sidesteps the need to manage incompatible change.
>>
>> More precisely, a new binary sidesteps the need to integrate an
>> existing mechanism with a new transport, and deal with the
>> incompatibilities that arise.
> 
> I'm not sure I got this.

Configuring the VM part in CLI and part in QMP is not something anybody 
needs nor should desire.  A new binary can use the CLI only for things 
that really have to be done before QMP is up, for example the 
configuration of sandboxing or tracing; and even that is only 
nice-to-have and not absolutely necessary.

>> The problem is that CLI and HMP, being targeted to humans (and as you
>> say below humans matter), are not necessarily trivial transports.  If
>> people find the trivial transport unusable, we will not be able to
>> retire the old CLI.
> 
> Yes, a trivial CLI transport alone may not suffice to retire the old
> CLI.  By itself, that doesn't mean trivial transports must be avoided.
> 
> Do I have to argue the benefits of a trivial configuration file
> transport?

I think you do; I'm not sure that a trivial configuration file transport 
is useful.  It's a middle ground in sophistication that I'm not sure 
would serve many people.  The only source of bug reports for -readconfig 
has been lxd, and I think we agree that they would be served better by QMP.

> Do I have to argue the benefits of a trivial CLI transport for use by
> relatively unsophisticated programs / relatively sophisticated humans
> (such as developers)? Can we agree these benefits are not zero?

We can.  But again I think you're misunderstanding the pain that the 
existing CLI inflicts on users.  Most users do not find the ordering 
complicated in practice; they do not even know that the issue exists. 
The problem that users have is the 100+ character command lines, and 
that can be fixed in two ways:

- with a trivial configuration file transport

- with a management tool such as virt-manager or virsh.

And I maintain that most users would be better served by the latter.  In 
fact, I constantly wonder how much we're overestimating the amount of 
people that are using QEMU.  In every post (Reddit, HN, wherever) that 
mentions QEMU being too complex and not having a front-end like 
VirtualBox, there's always someone that mentions virt-manager.

For developers it's different of course.

>> Bad CLI is also very hard to deprecate because, unlike QMP (for which
>> you can delegate the workarounds to Libvirt & friends) and HMP (for
>> which people can just learn the new thing and type it), it is baked in
>> countless scripts.  People hate it when scripts break.
> 
> I assure you that bad QMP is plenty hard to deprecate, even when libvirt
> can be updated to cope.

Right, and CLI is worse. :)

>> The issues with the CLI then can be completely self-contained within
>> softmmu/vl.c, and will not influence the innards of QEMU.
> 
> The issues with the CLI will still influence its users. Can we
> agree that human users deserve something better than the current
> CLI?

Deserve, yes.  Need, not sure.  Do you agree that a lot of clients of 
QEMU would be better served by Libvirt (programs) and virt-manager (humans)?

So, if I have to choose between better QMP now and better CLI now, I 
choose better QMP now.  Exactly to avoid the "somebody could" trap and 
focus on something that "we can" do now.

> I think we can learn from our experience with HMP/QMP.
> 
> Good:
> 
> * Separate interfaces for machines and for humans
> * Layering the human interface on top of the machine interface: HMP
>    commands implemented on top of QMP's internal C interface.

Agreed.  CLI should likewise be implemented on top of QMP's internal C 
interface, the same way non-preconfig mode concludes startup with 
qmp_x_exit_preconfig(NULL).  Second choice (inferior but sometimes 
acceptable): implement it on top of the same QOM interfaces as the QOM 
commands.

> * The stable interface is clear: QMP unless explicitly marked unstable.

Agreed, the problem here is that CLI is harder to evolve.

Paolo


  reply	other threads:[~2021-12-16 15:30 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 [this message]
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
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=8dd178b7-631b-25b4-4f68-334b0d583f72@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).