This patch adds to the QObject system a method to encode JSON objects. It also adds printf-like capabilities where you can write %{a.b} in a format string and the method will walk a QDict to find the "a" first and "b" in a QDict inside that one (and then print what's found).
Since QEMU does not have (or I could not find...) a variable-length string buffer object, I added that to QString, thus making it mutable. I talked to Luiz and he mentioned that QString were immutable not by design, but rather due to not having the need so far. Paolo Bonzini (7): add qemu_memdup allow passing NULL to qobject_type forward declare all QObject subclasses in qobject.h add mutable qstring functions add json encoder for qobjects add testsuite for qobject json encoder add formatted printing of QObjects