On 11/12/2020 18.11, Markus Armbruster wrote:
qobject_to_json() and qobject_to_json_pretty() build a GString, then
covert it to QString. Just one of the callers actually needs a
QString: qemu_rbd_parse_filename(). A few others need a string they
can modify: qmp_send_response(), qga's send_response(), to_json_str(),
and qmp_fd_vsend_fds(). The remainder just need a string.
Change qobject_to_json() and qobject_to_json_pretty() to return the
GString.
qemu_rbd_parse_filename() now has to convert to QString. All others
save a QString temporary. to_json_str() actually becomes a bit
simpler, because GString provides more convenient modification
functions.
Signed-off-by: Markus Armbruster <arm...@redhat.com>
Hi Markus!
This patch broke the output of default values in the device help. With
commit eab3a4678b07267c39e72:
$ ./qemu-system-x86_64 -device pvpanic,help
pvpanic options:
events=<uint8> - (default: (null))
ioport=<uint16> - (default: (null))
pvpanic[0]=<child<qemu:memory-region>>
With the commit right before that one:
$ ./qemu-system-x86_64 -device pvpanic,help
pvpanic options:
events=<uint8> - (default: 3)
ioport=<uint16> - (default: 1285)
pvpanic[0]=<child<qemu:memory-region>>
Any ideas how to fix that?
Thomas