]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virjson: Change virJSONValueObjectHasKey() signature
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 28 Jul 2022 10:36:19 +0000 (12:36 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 1 Aug 2022 08:24:34 +0000 (10:24 +0200)
commit42ca6d6f33bfa4ed6cd7044da8f1d9e84c3d2708
tree34059626b1fb1577be677d6de83b6d476dffa1bf
parente5c34c983c2b3477b0b8a99de20c27c87966937c
virjson: Change virJSONValueObjectHasKey() signature

Currently, virJSONValueObjectHasKey() can return one of three
values:

  -1 if passed object type is not VIR_JSON_TYPE_OBJECT,
   0 if the key is not present, and finally
   1 if the key is present.

But, neither of callers is interested in the -1 case. In fact,
some callers call this function treating -1 and 1 cases the same.
Therefore, make the function return just true/false and fix few
callers that explicitly checked for == 1 case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_agent.c
src/qemu/qemu_monitor_json.c
src/util/virjson.c
src/util/virjson.h
tests/testutilsqemuschema.c