Bug 518703

Summary: [LTC 6.0 FEAT] Complete QMP support on QEMU [202013]
Product: Red Hat Enterprise Linux 6 Reporter: IBM Bug Proxy <bugproxy>
Component: qemu-kvmAssignee: Luiz Capitulino <lcapitulino>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: jjarvis, juzhang, kcao, kmonroe, llim, rpacheco, tburke
Target Milestone: betaKeywords: Tracking
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-26 09:04:44 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: 559201    
Bug Blocks: 356741, 554559    

Description IBM Bug Proxy 2009-08-21 18:10:57 UTC
=Comment: #0=================================================
Emily J. Ratliff <ratliff.com> - 
1. Feature Overview:
Feature Id:	[202013]
a. Name of Feature:	Add async qemu machine protocol (qmp) to qemu
b. Feature Description
Extend qemu to include a machine protocol for the monitor interface

2. Feature Details:
Sponsor:	LTC
Architectures:
x86
x86_64

Arch Specificity: Both
Affects Kernel Modules: Yes
Delivery Mechanism: Backport
Category:	Xen
Request Type:	Driver - New - Open Source
d. Upstream Acceptance:	Pending
Sponsor Priority	2
f. Severity: Medium
IBM Confidential:	no
Code Contribution:	3rd party code
g. Component Version Target:	qemu 0.12+

3. Business Case
By switching to a machine readable protocol we increase the robustness of the interface that is used
to control qemu

4. Primary contact at Red Hat: 
John Jarvis
jjarvis

5. Primary contacts at Partner:
Project Management Contact:
Stephanie Glass, sglass.com, 512-838-9284

Technical contact(s):
Ryan Harper, raharper.com

IBM Manager:
Warren Grunbok II, grunbok.com

Comment 2 Dor Laor 2009-09-24 11:54:48 UTC
We'll either have async monitor messages or even Qmonitor protocol. It depends of the later readiness.

Comment 3 Luiz Capitulino 2009-09-25 18:11:09 UTC
Async messages are already implemented in my qmp-unstable repository (although not reviewed), the only missing piece is the timestamp.

So, I don't think it's a big deal from QEMU's side, but I'm concerned with libvirt.

The basic async messages are always emitted like the following example:

{ "event": "SHUTDOWN", "timestamp": "" }

This is simple and can be parsed with fscanf(), another important information is that support for multiple monitors on the command-line has been merged upstream. So, libvirt could open an additional monitor channel only for async messages.

Now, the point is whether this is feasible as it may have concurrency and related problems.

Comment 4 Luiz Capitulino 2010-01-14 17:14:24 UTC
We already have most of the protocol and basic async messages merged upstream (they are in the RHEL6's qemu-kvm branch already too).

The protocol is already functional, but the following is missing for RHEL6:

- Feature negotiation
- Some async messages
- Some more commands conversions

All of those features are going to be handled in different tickets, so either we close this one or we add the others as a dependency.

Comment 5 John Jarvis 2010-01-15 17:38:07 UTC
IBM is signed up to test and provide feedback.

Comment 6 Luiz Capitulino 2010-01-15 20:32:53 UTC
Ok, they can contact me if they need assistance.

Comment 7 Eduardo Habkost 2010-01-20 11:52:07 UTC
On RHEL-6, the KVM userspace package is named "qemu-kvm". Moving bug to the right component.

Comment 8 John Jarvis 2010-01-21 22:15:11 UTC
Luiz, can you please add the dependents you mention in comment 4 and we can just use this as a tracker?

Comment 9 Luiz Capitulino 2010-01-22 20:41:33 UTC
Done for the most important features, I still have to create a ticket to hold all our bugs.

Comment 10 John Jarvis 2010-02-04 18:48:12 UTC
Converting to tracker to track the dependent items.

Comment 12 Ronald Pacheco 2010-02-12 20:49:20 UTC
Removing all flags since this is now a tracker.

Comment 13 IBM Bug Proxy 2010-02-25 19:10:58 UTC
------- Comment From ryanh.com 2010-02-25 14:07 EDT-------
QMP is upstream (as of 0.12 qemu release); marking code upstream.

Comment 14 Luiz Capitulino 2010-02-25 19:29:06 UTC
Yes, but fwiw, it's a limited "preview" version. Meaning that it's incomplete and unstable.

It's quite better currently.

Comment 16 IBM Bug Proxy 2010-05-03 23:20:53 UTC
------- Comment From mdroth.ibm.com 2010-05-03 19:13 EDT-------
verified on snap1:

[root@arsenal ~]# uname -a
Linux arsenal.linuxperf9025.net 2.6.32-22.el6.x86_64 #1 SMP Tue Apr 20 12:10:42 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@arsenal ~]# rpm -q redhat-release
redhat-release-6-6.0.0.24.el6.x86_64
[root@arsenal ~]# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.39.el6.x86_64

[root@arsenal ~]# /usr/libexec/qemu-kvm -qmp tcp:localhost:4444,server
QEMU waiting for connection on: tcp:::1:4444,server
VNC server running on `::1:5900'

...

[root@arsenal QMP]# telnet localhost 4444
Trying ::1...
Connected to localhost.
Escape character is '^]'.
{"QMP": {"version": {"qemu": "0.12.1", "package": " (qemu-kvm-0.12.1.2)"}, "capabilities": []}}
{ "execute" : "qmp_capabilities" }
{"return": {}}
{ "execute" : "query-block" }
{"return": [{"device": "ide1-cd0", "locked": false, "removable": true, "type": "cdrom"}, {"device": "floppy0", "locked": false, "removable": true, "type": "floppy"}, {"device": "sd0", "locked": false, "removable": true, "type": "floppy"}]}
{ "execute" : "query-balloon" }
{"error": {"class": "DeviceNotActive", "desc": "The balloon device has not been activated by the guest", "data": {"device": "balloon"}}}
{ "execute" : "query-kvm" }
{"return": {"enabled": true, "present": true}}
{ "execute" : "quit" }
Connection closed by foreign host.
[root@arsenal QMP]