Received: from eggs.gnu.org ([2001:4830:134:3::10]:60079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buITL-0003I6-QE for qemu-devel@nongnu.org; Wed, 12 Oct 2016 08:17:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buITJ-0008Nh-KW for qemu-devel@nongnu.org; Wed, 12 Oct 2016 08:17:22 -0400 From: Markus Armbruster References: <1c8e6e73084e968514b6522576cfacd1bf69609e.1475757437.git.berto@igalia.com> <48b78d7e-3f52-79d3-27a1-19047100161b@redhat.com> <20161011145712.GF6334@noname.redhat.com> <878ttu9788.fsf@dusky.pond.sub.org> Date: Wed, 12 Oct 2016 14:17:13 +0200 In-Reply-To: (Alberto Garcia's message of "Wed, 12 Oct 2016 11:28:43 +0200") Message-ID: <87shs1vk1i.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v10 09/16] block: Add QMP support for streaming to an intermediate layer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz Alberto Garcia writes: > On Tue 11 Oct 2016 06:32:39 PM CEST, Markus Armbruster wrote: > >>>> 3) QEMU could advertise that feature to the client. This is probably >>>> simpler than trying to figure it out from the API. I guess that's >>>> the idea of 'qmp_capabilities'? >>> >>> I think that was the idea, though it was never used. If we had used >>> it, I'm not sure how long the capabilities list would be today. :-) >> >> QMP capabilities are for changes in the QMP protocol, not for changes >> in commands, events and types. The protocol has been good enough so >> far, thus no capabilities. > > I see. Wouldn't it make sense in general to have a way to ask QEMU > whether some certain feature is supported? Feature bits work fine for interfaces that see relatively little change. Some QEMU interfaces are like that, for instance the QMP protocol itself. Other interfaces, however, change at a rapid pace. If we tried to provide a feature bit for every change there, we'd end up with a huge number of them, almost certainly underdocumented, and most of them not used by any client. We'd probably fail to provide feature bits for some of the interface changes, and have "feature X" bits followed some time later by "feature X, except now it actually works" bits. Instead, we opted for making external interfaces introspectable, so that clients can detect stuff whether we thought of the need to detect it or not. The first interface with decent introspection is QMP: there's query-qmp-schema. Changes are easy to detect there as long as they're *syntactic*: new commands or events, type extensions and so forth. QMP introspection is blind to purely *semantic* changes, say a string argument that can now denote a node-name in addition to a filename. Such changes should be avoided.