qemu_monitor_json: Properly check "return" type
My commit 2e0d6cde claimed qemuMonitorJSONCheckError guarantees "return" object exists in the JSON reply. But it only makes sure the key is there, while the type of the value is not checked. A lot of callers do not care since they only want to see whether their QMP command failed or not, but any caller which needs to read some data from the reply wants to make sure the correct data type was returned. This patch adds a new API called qemuMonitorJSONCheckReply which calls qemuMonitorJSONCheckError and checks "return" contains a value of the specified type. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Showing
想要评论请 注册 或 登录