From 0e94f3f0163480d963a68870546847cb811889d8 Mon Sep 17 00:00:00 2001
From: Luiz Capitulino <lcapitulino@redhat.com>
Date: Fri, 26 Feb 2010 14:31:23 -0300
Subject: [PATCH 7/7] QMP: Fix 'query-balloon' key change

RH-Author: Luiz Capitulino <lcapitulino@redhat.com>
Message-id: <20100226113123.38936902@redhat.com>
Patchwork-id: 7316
O-Subject: [PATCH RHEL6 qemu-kvm] QMP: Fix 'query-balloon' key change
Bugzilla: 568739
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
RH-Acked-by: Glauber Costa <glommer@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>

Bugzilla: 568739
Upstream: Partial backport of 625a5bef

Upstream commit 625a5bef changed (probably not on purpose) the
'query-balloon' command response key 'balloon' to 'actual'.

While such protocol changes are not allowed (at least not
without strong justification and planning) this one wasn't
catch by review and libvirt upstream already conforms to it.

Let's backport only the key change then.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 monitor.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 monitor.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/monitor.c b/monitor.c
index 15e5d3f..ae627c5 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2151,7 +2151,7 @@ static void monitor_print_balloon(Monitor *mon, const QObject *data)
     qdict = qobject_to_qdict(data);
 
     monitor_printf(mon, "balloon: actual=%" PRId64 "\n",
-                        qdict_get_int(qdict, "balloon") >> 20);
+                        qdict_get_int(qdict, "actual") >> 20);
 }
 
 /**
@@ -2159,11 +2159,11 @@ static void monitor_print_balloon(Monitor *mon, const QObject *data)
  *
  * Return a QDict with the following information:
  *
- * - "balloon": current balloon value in bytes
+ * - "actual": current balloon value in bytes
  *
  * Example:
  *
- * { "balloon": 1073741824 }
+ * { "actual": 1073741824 }
  */
 static void do_info_balloon(Monitor *mon, QObject **ret_data)
 {
@@ -2171,7 +2171,7 @@ static void do_info_balloon(Monitor *mon, QObject **ret_data)
 
     actual = balloon_get_value();
     if (actual != 0) {
-        *ret_data = qobject_from_jsonf("{ 'balloon': %" PRId64 "}",
+        *ret_data = qobject_from_jsonf("{ 'actual': %" PRId64 "}",
                                        (int64_t) actual);
     }
 }
-- 
1.6.6

