]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: agent: use GetArray to remove a check
authorJán Tomko <jtomko@redhat.com>
Mon, 5 Oct 2020 20:09:08 +0000 (22:09 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 8 Oct 2020 09:16:08 +0000 (11:16 +0200)
commit9e48b028403119d19a0b9633278b5a29f060a6d6
tree77cb695c15f27d19f4e031745ea4935ed7c2732f
parent67e744cb578e072bfa4871732eeb966be3aa5d2e
qemu: agent: use GetArray to remove a check

The error check for ValueObjectGet("return") is redundant,
qemuAgentCommand already checked for us that the reply contains
a "return" object.

It does not guarantee, that it is an array.

Use virJSONValueObjectGetArray that combines getting the object
with checking for its type and return the more helpful of
the two error messages.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
src/qemu/qemu_agent.c