qemu-e2k/backends
Igor Mammedov 15160ab72c 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 <imammedo@redhat.com>
Message-Id: <20190214105733.25643-1-imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-03-06 11:51:08 -03:00
..
cryptodev-builtin.c
cryptodev-vhost-user.c
cryptodev-vhost.c
cryptodev.c
hostmem-file.c
hostmem-memfd.c
hostmem-ram.c
hostmem.c hostmem: fix crash when querying empty host-nodes property via QMP 2019-03-06 11:51:08 -03:00
Makefile.objs
rng-egd.c
rng-random.c
rng.c
tpm.c