aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-07-03 10:53:54 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-07-03 23:18:56 +0200
commitcd499d2058adb657b034023e9e7428c94b0f212d (patch)
tree6da918f2e987646bfc7ed55455331e761853694a /qapi
parent62e93be286626839ef2597da81f70a3ba4a31fff (diff)
qmp: Switch timestamp_put() to qdict_from_jsonf_nofail()
There's just one use of qobject_from_jsonf() to parse a JSON object left: timestamp_put(). Switch it to qdict_from_jsonf_nofail(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180703085358.13941-29-armbru@redhat.com>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/qmp-event.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/qapi/qmp-event.c b/qapi/qmp-event.c
index 9d7e88e84a..5b8854043e 100644
--- a/qapi/qmp-event.c
+++ b/qapi/qmp-event.c
@@ -34,15 +34,15 @@ QMPEventFuncEmit qmp_event_get_func_emit(void)
static void timestamp_put(QDict *qdict)
{
int err;
- QObject *obj;
+ QDict *ts;
qemu_timeval tv;
err = qemu_gettimeofday(&tv);
/* Put -1 to indicate failure of getting host time */
- obj = qobject_from_jsonf("{ 'seconds': %lld, 'microseconds': %lld }",
- err < 0 ? -1LL : (long long)tv.tv_sec,
- err < 0 ? -1LL : (long long)tv.tv_usec);
- qdict_put_obj(qdict, "timestamp", obj);
+ ts = qdict_from_jsonf_nofail("{ 'seconds': %lld, 'microseconds': %lld }",
+ err < 0 ? -1LL : (long long)tv.tv_sec,
+ err < 0 ? -1LL : (long long)tv.tv_usec);
+ qdict_put(qdict, "timestamp", ts);
}
/*