Skip to contentSkip to conversation

QMP: Drop wrong assert()

Qemu-devel Applied Luiz Capitulino 3 participants 3 messages Dec 22, 2009 – Jan 8, 2010

lore
Share & tools
lore
#0 lore raw

Some commands return a QList of QDicts, which is valid, but will trig the assert().

Just drop it.

---
 monitor.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
monitor.c +0 -1
index c0dc48e..3af1d5c 100644
@@ -283,7 +283,6 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data)
     if (!monitor_has_error(mon)) {
         /* success response */
         if (data) {
-            assert(qobject_type(data) == QTYPE_QDICT);
             qobject_incref(data);
             qdict_put_obj(qmp, "return", data);
         } else {
Signature · 1 line
1.6.6.rc3
#1 lore raw
Quoted 16 lines · Luiz Capitulino

Some commands return a QList of QDicts, which is valid, but will trig the assert().

Just drop it.

---
 monitor.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
monitor.c +0 -0
index c0dc48e..3af1d5c 100644

monitor.c static void monitor_protocol_emitter(Monitor *mon, QObject *data) · line 288

Quoted 7 lines
monitor.c +0 -1
@@ -283,7 +283,6 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data)
     if (!monitor_has_error(mon)) {
         /* success response */
         if (data) {
-            assert(qobject_type(data) == QTYPE_QDICT);
             qobject_incref(data);
             qdict_put_obj(qmp, "return", data);
         } else {

Yes, let's drop the assertion for now.

qmp-spec.txt specifies "json-object", so it needs fixing as well. I figure what we want is either a dictionary (json-object), or a list of dictionaries (json-array of json-object).

#2 lore raw
In reply to Luiz Capitulino
Quoted 8 lines · Luiz Capitulino

Some commands return a QList of QDicts, which is valid, but will trig the assert().

Just drop it.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 17 lines
---
  monitor.c |    1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
monitor.c +0 -1
index c0dc48e..3af1d5c 100644
@@ -283,7 +283,6 @@ static void monitor_protocol_emitter(Monitor *mon, QObject *data)
      if (!monitor_has_error(mon)) {
          /* success response */
          if (data) {
-            assert(qobject_type(data) == QTYPE_QDICT);
              qobject_incref(data);
              qdict_put_obj(qmp, "return", data);
          } else {