History | View | Annotate | Download (33.4 kB)
qapi: Add human mode to StringOutputVisitor
This will be used by "info qtree". For numbers it prints both thedecimal and hex values. For sizes it rounds to the nearest powerof 2^10. For strings, it puts quotes around the string and separatesNULL and empty string....
misc: Use g_assert_not_reached for code which is expected to be unreachable
The macro g_assert_not_reached is a better self documenting replacementfor assert(0) or assert(false).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qapi: fix visitor serialization tests for numbers/doubles
We never actually stored the stringified double values into the stringsbefore we did the comparisons. This left number/double values completelyuncovered in test-visitor-serialization tests.
Fixing this exposed a bug in our handling of large whole number values...
qapi: add native list coverage for visitor serialization tests
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: fix leak in unit tests
qmp_output_get_qobject() increments the qobject's reference count. Sincewe currently pass this straight into qobject_to_json() so we can feedthe data into a QMP input visitor, we never actually free the underlyingqobject when qmp_output_visitor_cleanup() is called. This causes leaks...
test-visitor-serialization: Fix some memory leaks
This patch fixes some of the memory leaks in test-visitor-serialization but not all of them.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qapi: move include files to include/qobject/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qapi: move inclusions of qemu-common.h from headers to .c files
qapi: Unit tests for visitor-based serialization
Currently we test our visitors individually, and seperately for inputvs. output. This is useful for validating internal representationsagainst the native C types and vice-versa, and other visitor-specific...
qapi: Add String visitor coverage to serialization unit tests
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>