Received: from eggs.gnu.org ([2001:4830:134:3::10]:50241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwpQa-0004CX-Ov for qemu-devel@nongnu.org; Thu, 12 Nov 2015 05:48:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwpQX-0002XH-8K for qemu-devel@nongnu.org; Thu, 12 Nov 2015 05:48:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwpQX-0002Wp-2Y for qemu-devel@nongnu.org; Thu, 12 Nov 2015 05:48:25 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1E1535D for ; Thu, 12 Nov 2015 10:48:24 +0000 (UTC) From: Markus Armbruster References: <1447291062-11011-1-git-send-email-eblake@redhat.com> Date: Thu, 12 Nov 2015 11:48:21 +0100 In-Reply-To: <1447291062-11011-1-git-send-email-eblake@redhat.com> (Eric Blake's message of "Wed, 11 Nov 2015 18:17:38 -0700") Message-ID: <8737wbtrwq.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH for-2.5 0/4] Expose ErrorClass through introspection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org Eric Blake writes: > I noticed that introspection was not documenting either > qmp_capabilities nor the ErrorClass enum. I think this is worth > fixing for 2.5 when introspection is brand new, so that if we later > extend the ErrorClass enum or add future capability negotiation (and > in particular if such additions get backported in downstream builds), > a client will be able to use introspection to learn whether the new > features are supported, regardless of the qemu version. > > Note that this also adds qmp_capabilities to 'query-commands'. > > Yes, this is borderline, and you may decide that it doesn't deserve > to be called a bug and should wait for 2.6. Two entirely separate issues: introspecting qmp_capabilities and introspecting error classes. This reply is about the former. I'll discuss the latter in a separate message. Introspecting qmp_capabilities with query-qmp-schema is kind of academic, because by the time you can query-qmp-schema, you're already done using qmp_capabilities. That's why docs/qmp-spec.txt nails down qmp_capabilities, unlike other commands. Unfortunately, it's a bit screwy. Let's have a closer look. Right after connect, the server sends a greeting that includes a list of available capabilities (docs/qmp-spec.txt section 2.2 Server Greeting), currently none. The only valid command then is qmp_capabilities (section 4. Capabilities Negotiation). The command is meant to let clients enable capabilities from the greeting, but we've neglected to specify how. Fortunately, QMP rejects all arguments, so we can still fix that by adding optional arguments, either a list of capabilities to enable, or a (boolean) argument for each capability. My point is: unlike other commands, qmp_capabilities is baked into the protocol. Introspection is useful to examine *variable* aspects. With the hole in the protocol specification plugged, the only variable aspect of qmp_capabilities are the capabilities, and the practical way to introspect those is the server greeting. Qapifying qmp_capabilities can make sense regardless. But why does it need to be rushed into 2.5 then?