Received: from eggs.gnu.org ([2001:4830:134:3::10]:50265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0XKR-0003FX-FL for qemu-devel@nongnu.org; Tue, 07 Jan 2014 09:08:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0XKN-0004tu-1D for qemu-devel@nongnu.org; Tue, 07 Jan 2014 09:08:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0XKM-0004tl-PV for qemu-devel@nongnu.org; Tue, 07 Jan 2014 09:08:18 -0500 From: Markus Armbruster References: <1385718225-26379-1-git-send-email-armbru@redhat.com> <1385718225-26379-2-git-send-email-armbru@redhat.com> <52AE1752.2080605@suse.de> <87k3f5mb9x.fsf@blackfin.pond.sub.org> <52CBF412.2030806@suse.de> Date: Tue, 07 Jan 2014 15:08:09 +0100 In-Reply-To: (Peter Maydell's message of "Tue, 7 Jan 2014 12:43:07 +0000") Message-ID: <87mwj7j35i.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] hw: cannot_instantiate_with_device_add_yet due to pointer props List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "Michael S. Tsirkin" , Marcel Apfelbaum , QEMU Developers , Fabien Chouteau , Blue Swirl , Gerd Hoffmann , Anthony Liguori , "Edgar E. Iglesias" , Andreas =?utf-8?Q?F=C3=A4rber?= Peter Maydell writes: > On 7 January 2014 12:33, Andreas F=C3=A4rber wrote: >> Am 16.12.2013 10:33, schrieb Peter Maydell: >>> Anyway, I don't actively object to this series. I just think >>> Anthony's going in the wrong direction which is why I haven't >>> been particularly eager to actively mark it as reviewed-by me >>> either... >> >> Sorry for not taking the time to reply to these concerns earlier. I >> thought it was self-speaking that the enterprise Linux distributors >> among us want a safeguard to avoid customers from crashing a >> long-running VM with some avoidable device_add. > > Sure. I think the right way to do that is to only allow > them to plug in devices that are truly pluggable (ie which > are on some pluggable bus like PCI or USB), rather than > this way round, which is trying to blacklist devices rather > than whitelist bus types. > > In short, we shouldn't be trying to cram all of "hotplug", > "I want an extra PCI card in my VM" and "I want to do > complete from-scratch construction of a machine model > including wiring up all the interrupts and defining the > memory map" into the same interface, because the flexibility > you need for the last one of these is going to cause endless > user errors when attempting the first two. Your point is that having one tool (device_add) for two rather different purposes ("wire components into a machine" and "plug stuff into sockets meant for that") is problematic. Makes sense to me. Now let's imagine we had a separate tool for each purpose. Let's call them "wire up" and "plug". Let's further imagine QOM/qdev and the device are basically still in their current state. Then you need a separate predicate "tool is applicable to qdev" for each of the two tools! The predicate for "plug" could perhaps be "is this a usable plug/socket pair", as you suggest. The predicate for "wire up" will be pretty much exactly what cannot_instantiate_with_device_add_yet is now: a long list of devices that can only be wired up by special-purpose code, mostly due to limitations of the "wire up" tool's general-purpose code, and the QOM/qdev infrastructure below it. As these limitations are addressed, the list should shrink. Anthony wants it to shrink to nothing eventually. In short, I doubt we're disagreeing on anything substantial.