History | View | Annotate | Download (8 kB)
qapi: QMP input visitor, handle floats parsed as ints
JSON numbers can be interpreted as either integers or floating pointvalues depending on their representation. As a result, QMP input visitormight visit a QInt when it was expecting a QFloat, so add handling to...
qapi: g_hash_table_find() instead of GHashTableIter.
GHashTableIter was first introduced in glib 2.16.This patch removes it in favor of older g_hash_table_find()for better compatibility with RHEL5.
Signed-off-by: NODA, Kai <nodakai@gmail.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: add strict mode to input visitor
While QMP in general is designed so that it is possible to ignoreunknown arguments, in the case of the QMP server it is better toreject them to detect bad clients. In fact, we're already doingthis at the top level in the argument checker. To extend this to...
qapi: place outermost object on qiv stack
This is a slight change in the implementation of QMPInputVisitorthat helps when adding strict mode.
Const QObjects cannot be inc/decref-ed, and that's why QMPInputVisitorrelies heavily on weak references to inner objects. I'm not removing...
qapi: untangle next_list
Right now, the semantics of next_list are complicated. The caller must:
qapi: fix memory leak on error
QmpInputVisitor would leak the malloced struct if the stack wasoverflowed. This can be easily fixed using error_propagate.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
qapi: fail hard on stack imbalance
QmpOutputVisitor will segfault if an imbalanced end function iscalled. So we can abort in QmpInputVisitor too.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: allow sharing enum implementation across visitors
Most visitors will use the same code for enum parsing. Move it tothe core.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi: drop qmp_input_end_optional
This method is optional, do not implement it if it is empty.
qapi: protect against NULL QObject in qmp_input_get_object
A NULL qobj can occur when a parameter is fetched via qdict_get, butthe parameter is not in the command. By returning NULL, the caller canchoose whether to raise a missing parameter error, an invalid parameter...
qapi: modify visitor code generation for list iteration
Modify logic such that we never assign values to the list head argumentto progress through the list on subsequent iterations, instead rely onlyon having our return value passed back in as an argument on the next...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: add QMP input visitor
A type of Visiter class that is used to walk a qobject'sstructure and assign each entry to the corresponding native C type.Command marshaling function will use this to pull out QMP commandparameters recieved over the wire and pass them as native arguments...