Skip to content

Fix MacOS runtime failure of qobject_from_jsonf()

Eric Blake qemu-devel 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 9 repliesIn review
  2. v13 patches 16 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4qmp-event: Avoid qobject_from_jsonf("%"PRId64)qapi/qmp-event.c+4 -132 replies
2/4test-qga: Avoid qobject_from_jsonv("%"PRId64)tests/test-qga.c+5 -20 replies
3/4tests: Avoid qobject_from_jsonf("%"PRId64)tests/check-qjson.c tests/test-qobject-input-visitor.c+5 -41 reply
4/4RFC: qapi: Drop support for qobject_from_jsonf("%"PRId64)qobject/json-lexer.c qobject/json-parser.c+4 -220 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 for-2.8 0/4] Fix MacOS runtime failure of qobject_from_jsonf()

[email protected][*] reported a runtime failure on a 32-bit Mac OS compilation, where "%"PRId64 expands to "%qd". Fortunately, we had very few spots that were relying on our pseudo-printf JSON parsing of int64_t numbers, so it was easier to just convert callers to stick to safer %lld.

The remaining uses of pseudo-printf handling are more complex; there are only 3 users in the released codebased, but LOTS of users in the testsuite (via wrapper functions like qmp()); I will be posting a followup series that rips out the remaining uses of dynamic JSON, but it will be 2.9 material, while these (first three) patches qualify for 2.8. The fourth patch is RFC; not intended to be applied now, but shows how I tested patch 3/4; it will probably reappear in the later 2.9 series.

[*] git log shows the name John, but the particular email that sparked this only stated the non-descript name 'G 3', which makes it a bit hard for me to know which form is preferred when lending credit.

Eric Blake (4):
qmp-event: Avoid qobject_from_jsonf("%"PRId64)
test-qga: Avoid qobject_from_jsonv("%"PRId64)
tests: Avoid qobject_from_jsonf("%"PRId64)
RFC: qapi: Drop support for qobject_from_jsonf("%"PRId64)

 qapi/qmp-event.c                   | 17 ++++-------------
 qobject/json-lexer.c               | 17 -----------------
 qobject/json-parser.c              |  9 ++++-----
 tests/check-qjson.c                |  4 ++--
 tests/test-qga.c                   |  7 +++++--
 tests/test-qobject-input-visitor.c |  5 +++--
 6 files changed, 18 insertions(+), 41 deletions(-)
Signature · 1 line
2.7.4