qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Michal Prívozník" <mprivozn@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	qemu-devel@nongnu.org, "Igor Mammedov" <imammedo@redhat.com>
Subject: Re: [PATCH] qmp: Stabilize preconfig
Date: Mon, 15 Nov 2021 16:40:10 +0100	[thread overview]
Message-ID: <87tugdh1gl.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <0fba39ee-4a1a-b388-82d3-4dc44cf3b9fb@redhat.com> (Paolo Bonzini's message of "Mon, 15 Nov 2021 13:37:33 +0100")

Paolo Bonzini <pbonzini@redhat.com> writes:

> On 11/13/21 08:52, Markus Armbruster wrote:
>> I'm not asking what to do "if it hurts", or "if you want a cold-plugged
>> device".  I'm asking whether there's a reason for ever wanting hot plug
>> instead of cold plug.  Or in other words, what can hot plug possibly
>> gain us over cold plug?
>> 
>> As far as I know, the answer is "nothing but trouble".
>
> Yes, I agree.
>
>> If that's true, then what we should tell users is to stick to -device
>> for initial configuration, and stay away from device_add.
>
> Yes, which is one issue with stabilizing -preconfig.  It's not clear 
> what exactly it is solving.
>
>>>>> The boat for this has sailed.  The only sane way to do this is a new binary.
>>>>
>>>> "Ideally" still applies to any new binary.
>>>
>>> Well, "ideally" any new binary would only have a few command line
>>> options, and ordering would be mostly irrelevant.  For example I'd
>>> expect a QMP binary to only have a few options, mostly for
>>> debugging/development (-L, -trace) and for process-wide settings (such
>>> as -name).
>> 
>> This is where we disagree.  For me, a new, alternative qemu-system-FOO binary
>> should be able to replace the warty one we have.
>> 
>> One important kind of user is management applications.  Libvirt
>> developers tell us that they'd like to configure as much as possible via
>> QMP.  Another kind of user dear to me is me^H^Hdevelopers.  For ad hoc
>> testing, having to configure via QMP is a pain we'd rathe do without.  I
>> don't want to remain stuck on the traditional binary, I want to do this
>> with the new one.
>
> Why do you care?  For another example, you can use "reboot" or 
> "systemctl isolate reboot.target" and they end up doing the same thing.
>
> As long as qemu_init invokes qmp_machine_set, qmp_accel_set, 
> qmp_device_add, qmp_plugin_add, qmp_cont, etc. to do its job, the 
> difference between qemu-system-* and qemu-qmp-* is a couple thousands 
> lines of boring code that all but disappears once the VM is up and 
> running.  IOW, with the right design (e.g. shortcut options for QOM 
> properties good; dozens of global variables bad), there's absolutely no 
> issue with some people using qemu-system-* and some using qemu-qmp-*.

I think maintaining two binaries forever is madness.  I want the old one
to wither away.

Making the new binary capable of serving all use cases should not be
hard, just work (see my design sketch).  I expect the result to serve
*better* than the mess we have now.

>>>>>> Likewise, we'd fail QMP commands that are "out of phase".
>>>>>> @allow-preconfig is a crutch that only exists because we're afraid (with
>>>>>> reason) of hidden assumptions in QMP commands.
>>>>>
>>>>> At this point, it's not even like that anymore (except for block devices
>>>>> because my patches haven't been applied).
>>>>
>>>> My point is that we still have quite a few commands without
>>>> 'allow-preconfig' mostly because we are afraid of allowing them in
>>>> preconfig state, not because of true phase dependencies.
>>>
>>> I think there's very few of them, if any (outside the block layer for
>>> which patches exist), and those are due to distraction more than fear.
>> 
>> qapi/*.json has 216 commands, of which 26 carry 'allow-preconfig'.
>
> Well, 
> https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg01597.html 
> alone would more than double that. :)
>
> Places like machine.json, machine-target.json, migration.json, 
> replay.json have a lot of commands that are, obviously, almost entirely 
> not suitable for preconfig.  I don't think there are many commands left, 
> I'd guess maybe 30 (meaning that ~60% are done).

My point is that "very few" is not literally true, and I think you just
confirmed it ;)



  reply	other threads:[~2021-11-15 15:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 11:08 [PATCH] qmp: Stabilize preconfig Michal Privoznik
2021-10-25 12:19 ` Markus Armbruster
2021-10-25 17:01   ` Paolo Bonzini
2021-11-01 14:37   ` Michal Prívozník
2021-11-01 14:57     ` Daniel P. Berrangé
2021-11-03  8:02       ` Markus Armbruster
2021-11-03  9:27         ` Daniel P. Berrangé
2021-11-10 12:54         ` Michal Prívozník
2021-11-10 13:23           ` Damien Hedde
2021-11-10 21:56         ` Paolo Bonzini
2021-11-11  6:11           ` Markus Armbruster
2021-11-11  8:15             ` Paolo Bonzini
2021-11-11 14:37               ` Markus Armbruster
2021-11-11 19:22                 ` Paolo Bonzini
2021-11-12 11:48                   ` Markus Armbruster
2021-11-12 22:18                     ` Paolo Bonzini
2021-11-13  7:52                       ` Markus Armbruster
2021-11-15 12:37                         ` Paolo Bonzini
2021-11-15 15:40                           ` Markus Armbruster [this message]
2021-11-16  6:50                             ` Paolo Bonzini

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=87tugdh1gl.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mprivozn@redhat.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 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).