qemu-patch-raspberry4/backends
Markus Armbruster 658ae5a7b9 Revert "hostmem: fix QEMU crash by 'info memdev'"
This reverts commit 1454d33f05.

The string input visitor regression fixed in the previous commit made
visit_type_uint16List() fail on empty input.  query_memdev() calls it
via object_property_get_uint16List().  Because it doesn't expect it to
fail, it passes &error_abort, and duly crashes.

Commit 1454d33 "fixes" this crash by making
host_memory_backend_get_host_nodes() return a list containing just
MAX_NODES instead of the empty list.  Papers over the regression, and
leads to bogus "info memdev" output, as shown below; revert.

I suspect that if we had bisected the crash back then, we would have
found and fixed the actual bug instead of papering over it.

To reproduce, run HMP command "info memdev" with

    $ qemu-system-x86_64 --nodefaults -S -display none -monitor stdio -object memory-backend-ram,id=mem1,size=4k

With this commit, "info memdev" prints

    memory backend: mem1
      size:  4096
      merge: true
      dump: true
      prealloc: false
      policy: default
      host nodes:

exactly like before commit 74f24cb.

Between commit 1454d33 and this commit, it prints

    memory backend: mem1
      size:  4096
      merge: true
      dump: true
      prealloc: false
      policy: default
      host nodes: 128

The last line is bogus.

Between commit 74f24cb and 1454d33, it crashes like this:

    Unexpected error in parse_str() at /work/armbru/tmp/qemu/qapi/string-input-visitor.c:126:
    Parameter 'null' expects an int64 value or range
    Aborted (core dumped)

Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1490026424-11330-3-git-send-email-armbru@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-21 10:43:28 +01:00
..
baum.c char: remove class kind field 2017-01-31 13:03:42 +04:00
cryptodev-builtin.c cryptodev: wrap the ready flag 2017-01-10 07:02:52 +02:00
cryptodev.c cryptodev: wrap the ready flag 2017-01-10 07:02:52 +02:00
hostmem-file.c hostmem-file: Register TYPE_MEMORY_BACKEND_FILE properties as class properties 2016-10-17 15:48:40 -02:00
hostmem-ram.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
hostmem.c Revert "hostmem: fix QEMU crash by 'info memdev'" 2017-03-21 10:43:28 +01:00
Makefile.objs Add wctablet device 2017-02-20 11:26:28 +01:00
msmouse.c char: remove class kind field 2017-01-31 13:03:42 +04:00
rng-egd.c char: rename CharDriverState Chardev 2017-01-27 18:07:59 +01:00
rng-random.c rng-random: rename RndRandom to RngRandom 2016-05-23 12:18:43 +05:30
rng.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
testdev.c char: remove class kind field 2017-01-31 13:03:42 +04:00
tpm.c include/qemu/osdep.h: Don't include qapi/error.h 2016-03-22 22:20:15 +01:00
trace-events Add wctablet device 2017-02-20 11:26:28 +01:00
wctablet.c Add wctablet device 2017-02-20 11:26:28 +01:00