Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Michael Roth (1) and Zhangleiqiang (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  qapi: fix leak in unit tests
  qmp: fix handling of cmd with Equals in qmp-shell

Message-id: 1368625179-27962-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2013-05-15 14:57:30 -05:00
commit 6b41659f4e
2 changed files with 9 additions and 2 deletions

View File

@ -99,6 +99,8 @@ class QMPShell(qmp.QEMUMonitorProtocol):
for arg in cmdargs[1:]:
opt = arg.split('=')
try:
if(len(opt) > 2):
opt[1] = '='.join(opt[1:])
value = int(opt[1])
except ValueError:
if opt[1] == 'true':

View File

@ -657,11 +657,16 @@ static void qmp_deserialize(void **native_out, void *datap,
VisitorFunc visit, Error **errp)
{
QmpSerializeData *d = datap;
QString *output_json = qobject_to_json(qmp_output_get_qobject(d->qov));
QObject *obj = qobject_from_json(qstring_get_str(output_json));
QString *output_json;
QObject *obj_orig, *obj;
obj_orig = qmp_output_get_qobject(d->qov);
output_json = qobject_to_json(obj_orig);
obj = qobject_from_json(qstring_get_str(output_json));
QDECREF(output_json);
d->qiv = qmp_input_visitor_new(obj);
qobject_decref(obj_orig);
qobject_decref(obj);
visit(qmp_input_get_visitor(d->qiv), native_out, errp);
}