From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55DB4C433F5 for ; Mon, 15 Nov 2021 15:41:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8BCD61B31 for ; Mon, 15 Nov 2021 15:41:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B8BCD61B31 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mme76-00083h-Pw for qemu-devel@archiver.kernel.org; Mon, 15 Nov 2021 10:41:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mme5l-0007Kq-1K for qemu-devel@nongnu.org; Mon, 15 Nov 2021 10:40:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mme5h-0005XA-LN for qemu-devel@nongnu.org; Mon, 15 Nov 2021 10:40:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636990816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J6SmHSiQcVGVE6u6gAUp1Eh5+NxY1A1D04eE8rg/IzU=; b=BUG8DqcejtA5KpqZxa82OMZC/yyrzcDeXDAvaRg55r8PbhjJCIdHvrKVqf//CYhjuYMLvc 7HtS6P6NE/dvK4nntNoEIHfrdAV4bKrLdY3sG95+XZhdgiAbLkHhRlFbg9Q+GiegT+APHK i5nFUPyG/6h/B7niV9Mrn3WVKlqTsZc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-VD1aRpHpMzib094YdpBlzQ-1; Mon, 15 Nov 2021 10:40:13 -0500 X-MC-Unique: VD1aRpHpMzib094YdpBlzQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 03E6118414A0 for ; Mon, 15 Nov 2021 15:40:13 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-7.ams2.redhat.com [10.36.112.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9BDC767843; Mon, 15 Nov 2021 15:40:12 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id AB91E11380A7; Mon, 15 Nov 2021 16:40:10 +0100 (CET) From: Markus Armbruster To: Paolo Bonzini Subject: Re: [PATCH] qmp: Stabilize preconfig References: <87bl3dfg9v.fsf@dusky.pond.sub.org> <87zgqlzmxi.fsf@dusky.pond.sub.org> <87pmr7rzls.fsf@dusky.pond.sub.org> <87mtman4h1.fsf@dusky.pond.sub.org> <13efddef-cc30-9a6a-a700-060d6fca57e3@redhat.com> <87ee7lh9x2.fsf@dusky.pond.sub.org> <87wnlcsd9q.fsf@dusky.pond.sub.org> <0fba39ee-4a1a-b388-82d3-4dc44cf3b9fb@redhat.com> Date: Mon, 15 Nov 2021 16:40:10 +0100 In-Reply-To: <0fba39ee-4a1a-b388-82d3-4dc44cf3b9fb@redhat.com> (Paolo Bonzini's message of "Mon, 15 Nov 2021 13:37:33 +0100") Message-ID: <87tugdh1gl.fsf@dusky.pond.sub.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=armbru@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Received-SPF: pass client-ip=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.7, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal =?utf-8?B?UHLDrXZvem7DrWs=?= , "Daniel P. =?utf-8?Q?Berrang=C3=A9?=" , qemu-devel@nongnu.org, Igor Mammedov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Paolo Bonzini 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 ;)