]> Git Repo - qemu.git/commit
hostmem: fix crash when querying empty host-nodes property via QMP
authorIgor Mammedov <[email protected]>
Thu, 14 Feb 2019 10:57:33 +0000 (05:57 -0500)
committerEduardo Habkost <[email protected]>
Wed, 6 Mar 2019 14:51:08 +0000 (11:51 -0300)
commit15160ab72ca48c86800b9227dfe806f27f7caf08
tree9aac391fff195b5dedda9f2edcbdb9eaf8f236a4
parent12b2e9f30f978f26f35f9df5c2ef96fbc019bab6
hostmem: fix crash when querying empty host-nodes property via QMP

QEMU will crashes with
 qapi/qobject-output-visitor.c:210: qobject_output_complete: Assertion `qov->root && ((&qov->stack)->slh_first == ((void *)0))' failed
when trying to get value of not set hostmem's "host-nodes"
property, HostMemoryBackend::host_nodes bitmap doesn't have
any bits set in it, which leads to find_first_bit() returning
MAX_NODES and consequently to an early return from
host_memory_backend_get_host_nodes() without calling visitor.

Fix it by calling visitor even if "host-nodes" property wasn't
set before exiting from property getter to return valid empty
list.

Signed-off-by: Igor Mammedov <[email protected]>
Message-Id: <20190214105733[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Stefano Garzarella <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
backends/hostmem.c
This page took 0.033118 seconds and 4 git commands to generate.