qemu-e2k/qapi
Markus Armbruster 54addb01d8 string-output-visitor: Fix to use sufficient precision
The string output visitor should serialize numbers so that the string
input visitor deserializes them back to the same number.  It fails to
do so.

print_type_number() uses format %f.  This is prone to nasty rounding
errors.  For instance, numbers between 0 and 0.0000005 get flushed to
zero.

We currently use this visitor only for HMP info migrate, info network,
info qtree, and info memdev.  No double values occur there as far as I
can tell.

Fix anyway by formatting with %.17g.  17 decimal digits always suffice
for IEEE double.

See also recent commit "qobject: Fix qnum_to_string() to use
sufficient precision".

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201210161452.2813491-9-armbru@redhat.com>
2020-12-19 10:37:16 +01:00
..
acpi.json qapi: Extract ACPI commands to 'acpi.json' 2020-09-29 15:41:36 +02:00
audio.json qapi: Fix missing headers in QMP Reference Manual 2020-11-09 09:14:17 +01:00
authz.json qapi: Fix missing headers in QMP Reference Manual 2020-11-09 09:14:17 +01:00
block-core.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
block-export.json fuse: Allow growable exports 2020-12-11 17:52:40 +01:00
block.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
char.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
common.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
control.json monitor: allow quitting while in preconfig state 2020-12-15 12:51:57 -05:00
crypto.json qapi/: fix some comment spelling errors 2020-09-17 20:41:08 +02:00
dump.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
error.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
introspect.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
job.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
machine-target.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
machine.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
meson.build qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
migration.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
misc-target.json sev: add sev-inject-launch-secret 2020-12-10 17:33:17 -05:00
misc.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
net.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
opts-visitor.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
pci.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
pragma.json qapi: Create 'pragma' module 2020-03-06 17:21:28 +01:00
qapi-clone-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qapi-dealloc-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qapi-schema.json qapi: introduce replay.json for record/replay-related stuff 2020-10-06 08:34:49 +02:00
qapi-util.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
qapi-visit-core.c qapi: Purge error_propagate() from QAPI core 2020-07-10 15:18:08 +02:00
qdev.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00
qmp-dispatch.c remove preconfig state 2020-12-15 12:51:48 -05:00
qmp-event.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qmp-registry.c qmp: Move dispatcher to a coroutine 2020-10-09 07:08:20 +02:00
qobject-input-visitor.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
qobject-output-visitor.c qapi: Make visitor functions taking Error ** return bool, not void 2020-07-10 15:18:08 +02:00
qom.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
rdma.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
replay.json replay: implement replay-seek command 2020-10-06 08:34:49 +02:00
rocker.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
run-state.json vl: Add option to avoid stopping VM upon guest panic 2020-12-15 12:51:58 -05:00
sockets.json sockets: Make abstract UnixSocketAddress depend on CONFIG_LINUX 2020-11-03 13:17:25 +00:00
string-input-visitor.c qapi, qemu-options: make all parsing visitors parse boolean options the same 2020-11-04 12:00:40 -05:00
string-output-visitor.c string-output-visitor: Fix to use sufficient precision 2020-12-19 10:37:16 +01:00
tpm.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
trace.json qapi: Add blank lines before bulleted lists 2020-02-15 11:41:50 +01:00
transaction.json schemas: Add vim modeline 2020-08-03 08:28:08 +02:00
ui.json qapi: Normalize version references x.y.0 to just x.y 2020-12-10 17:16:44 +01:00