qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 05/20] qobject: Change qobject_to_json()'s value to GString


From: Thomas Huth
Subject: Re: [PATCH 05/20] qobject: Change qobject_to_json()'s value to GString
Date: Wed, 24 Mar 2021 08:16:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

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 <armbru@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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]