From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0sLk-0002pU-62 for qemu-devel@nongnu.org; Fri, 05 Jun 2015 10:11:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0sLe-00069z-Hp for qemu-devel@nongnu.org; Fri, 05 Jun 2015 10:11:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0sLe-00069q-Ca for qemu-devel@nongnu.org; Fri, 05 Jun 2015 10:11:50 -0400 Date: Fri, 5 Jun 2015 15:11:44 +0100 From: "Daniel P. Berrange" Message-ID: <20150605141144.GI11483@redhat.com> References: <027e01d09f90$f620dc00$e2629400$@samsung.com> <029b01d09f97$be534270$3af9c750$@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <029b01d09f97$be534270$3af9c750$@samsung.com> Subject: Re: [Qemu-devel] [BUG] Monitor QMP is broken ? Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin Cc: qemu-devel@nongnu.org, 'Markus Armbruster' On Fri, Jun 05, 2015 at 04:58:46PM +0300, Pavel Fedin wrote: > Hello! > > > I have updated my qemu to the recent version and it seems to have lost compatibility > with > > libvirt. The error message is: > > --- cut --- > > internal error: unable to execute QEMU command 'qmp_capabilities': QMP input object > > member > > 'id' is unexpected > > --- cut --- > > What does it mean? Is it intentional or not? > > I have found the problem. It is caused by commit > 65207c59d99f2260c5f1d3b9c491146616a522aa. libvirt does not seem to use the removed > asynchronous interface but it still feeds in JSONs with 'id' field set to something. So i > think the related fragment in qmp_check_input_obj() function should be brought back If QMP is rejecting the 'id' parameter that is a regression bug. [quote] The QMP spec says 2.3 Issuing Commands -------------------- The format for command execution is: { "execute": json-string, "arguments": json-object, "id": json-value } Where, - The "execute" member identifies the command to be executed by the Server - The "arguments" member is used to pass any arguments required for the execution of the command, it is optional when no arguments are required. Each command documents what contents will be considered valid when handling the json-argument - The "id" member is a transaction identification associated with the command execution, it is optional and will be part of the response if provided. The "id" member can be any json-value, although most clients merely use a json-number incremented for each successive command 2.4 Commands Responses ---------------------- There are two possible responses which the Server will issue as the result of a command execution: success or error. 2.4.1 success ------------- The format of a success response is: { "return": json-value, "id": json-value } Where, - The "return" member contains the data returned by the command, which is defined on a per-command basis (usually a json-object or json-array of json-objects, but sometimes a json-number, json-string, or json-array of json-strings); it is an empty json-object if the command does not return data - The "id" member contains the transaction identification associated with the command execution if issued by the Client [/quote] And as such, libvirt chose to /always/ send an 'id' parameter in all commands it issues. We don't however validate the id in the reply, though arguably we should have done so. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|