]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuMonitorJSONGetCPUDefinitions: Avoid double lookup of object
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Dec 2022 15:13:41 +0000 (16:13 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 2 Dec 2022 15:18:37 +0000 (16:18 +0100)
commit6b3bc1cb2cb05c636046dc90b9072d4acf2c2b85
tree4b09573660b7a56ef9c4f13c898dc51e152eeba7
parent662ec854d240c47f9b28ba41c8a26aa83d1759a9
qemuMonitorJSONGetCPUDefinitions: Avoid double lookup of object

Using 'virJSONValueObjectHasKey' when we want to access the value
afterwards is wasteful. Fetch the JSON value right away.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_monitor_json.c