Bug 557939

Summary: QMP: Full introspection support
Product: Red Hat Enterprise Linux 7 Reporter: Luiz Capitulino <lcapitulino>
Component: qemu-kvm-rhevAssignee: Markus Armbruster <armbru>
Status: CLOSED ERRATA QA Contact: CongLi <coli>
Severity: medium Docs Contact:
Priority: low    
Version: 7.0CC: ailan, areis, armbru, berrange, gcosta, juzhang, knoel, lcapitulino, michen, ngu, qzhang, tburke, virt-maint, xiagao
Target Milestone: beta   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.5.0-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1283895 (view as bug list) Environment:
Last Closed: 2016-11-07 20:06:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 559201, 580953, 643055, 693512, 821045, 950968, 1059069, 1283895    

Description Luiz Capitulino 2010-01-22 20:33:26 UTC
In order to have full forward compatibility support, QMP needs to be capable of
describing itself.

This means that we need commands to dump the following protocol information:

o Accepted commands, arguments, responses and errors
o Asynchronous messages and their data
o Protocol capabilities
o Errors

JSON schema (http://json-schema.org/) has been chosen as the format for this.

Comment 1 RHEL Program Management 2010-01-22 20:36:16 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 4 Luiz Capitulino 2010-11-10 17:10:15 UTC
Likely to be rhel7.0 material.

Comment 7 Markus Armbruster 2011-04-29 09:03:22 UTC
Related bug 647516.

Comment 8 Markus Armbruster 2011-06-07 12:48:14 UTC
Depends on upstream QAPI schema work.  Moving to RHEL-7.

Comment 10 Luiz Capitulino 2013-05-16 12:31:18 UTC
*** Bug 963590 has been marked as a duplicate of this bug. ***

Comment 11 Luiz Capitulino 2013-05-16 12:36:34 UTC
Amos, it's interesting to note our original expectation for this feature. We don't need to dump errors anymore (this is not even possible today), but we certainly need to dump events.

Two options:

 1. Move events to the schema and dump them along
 2. Extend query-events with argument information

I prefer option 1, but you don't need to do this right now. IMO, it would be acceptable to work on command/types introspection first and after that add the events.

Comment 12 Amos Kong 2013-06-07 10:25:00 UTC
send a draft patch to upstream:
http://marc.info/?l=qemu-devel&m=137059998004419&w=2

Comment 13 Amos Kong 2013-08-30 10:18:21 UTC
*** Bug 953844 has been marked as a duplicate of this bug. ***

Comment 14 Ronen Hod 2013-11-04 09:34:21 UTC
Deferring to 7.1. It almost matured upstream, but not finished yet.

Comment 15 Amos Kong 2014-01-23 15:07:14 UTC
Posted V4 to upstream:
[Qemu-devel] [PATCH v4 0/5] QMP full introspection
http://marc.info/?l=qemu-devel&m=139048842504757&w=2

Comment 17 Amos Kong 2014-05-26 08:59:39 UTC
*** Bug 647516 has been marked as a duplicate of this bug. ***

Comment 18 Ronen Hod 2014-10-27 09:34:32 UTC
Need to defer once again.
Still not settled upstream. Need to simplify and clean the solution.

Comment 21 Markus Armbruster 2015-04-04 07:07:22 UTC
Upstream goal is to crack the problem in the 2.4 development cycle,
preferably early.

[PATCH RFC 00/19] qapi: QMP introspection
https://lists.nongnu.org/archive/html/qemu-devel/2015-04/msg00342.html

Since few RFC patches survive review unscathed, I have to reserve
judgement on feasibility of a backport.

Comment 22 Markus Armbruster 2015-09-07 11:50:38 UTC
Missed upstream 2.4, now on track for 2.5.
http://lists.gnu.org/archive/html/qemu-devel/2015-09/msg01599.html

Comment 24 Markus Armbruster 2015-11-30 09:12:34 UTC
No doc text needed, because direct use of QMP isn't supported.

Comment 26 xiagao 2016-08-30 03:20:46 UTC
Hi Markus,

I'm KVM QE. I noticed this bug is related to 32 patches, so I'm confused how to test it. 
Is it OK to run a loop of qmp cases?
Could you pleas give some advice?

Thanks,
xiagao

Comment 27 Markus Armbruster 2016-08-30 15:28:02 UTC
Please test QMP command

    { "execute": "query-qmp-schema" }

It should return an array of objects.  Please test that.

If we had unlimited testing resources, I'd ask you to additionally
verify the objects make sense.  We don't, and I'm not.  Check the
return value is an array of objects, and call it a day.  Okay?

Also consider adding this to the QMP test plan.

Comment 28 xiagao 2016-08-31 06:01:37 UTC
(In reply to Markus Armbruster from comment #27)
> Please test QMP command
> 
>     { "execute": "query-qmp-schema" }
> 
> It should return an array of objects.  Please test that.
> 
> If we had unlimited testing resources, I'd ask you to additionally
> verify the objects make sense.  We don't, and I'm not.  Check the
> return value is an array of objects, and call it a day.  Okay?
> 
> Also consider adding this to the QMP test plan.

Thank you for quick reply:). It's okay for me.

Comment 29 xiagao 2016-08-31 07:36:33 UTC
Verify this bug on:
qemu-kvm-rhev-2.6.0-20.el7.x86_64

Steps:
1. Run qemu with a qmp monitor.
# /usr/libexec/qemu-kvm -nodefaults -S -display none -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 6, "major": 2}, "package": " (qemu-kvm-rhev-2.6.0-20.el7)"}, "capabilities": []}}
{"execute": "qmp_capabilities"}
{"return": {}}

2. { "execute": "query-qmp-schema" }

Result is pass.
return an array of objects. Such as:
{"name": "344", "members": [{"name": "create-type", "type": "str"}, {"name": "cid", "type": "int"}, {"name": "parent-cid", "type": "int"}, {"name": "extents", "type": "[214]"}], "meta-type": "object"}, {"name": "345", "members": [{"name": "base", "type": "int"}, {"name": "limit", "type": "int"}], "meta-type": "object"}, {"name": "[214]", "element-type": "214", "meta-type": "array"}]}

Comment 30 Gu Nini 2016-09-01 02:22:58 UTC
Change the bug status to verified according to comment #29.

Comment 32 errata-xmlrpc 2016-11-07 20:06:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2673.html