hw/nvram/spapr_nvram: Device can not be created by the users
commit280503ee9d7833a793770d732dda5358659825e9
authorThomas Huth <thuth@redhat.com>
Thu, 24 Aug 2017 07:41:33 +0000 (24 09:41 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 7 Sep 2017 23:30:55 +0000 (8 09:30 +1000)
tree81b9078c2aad54d0e3439df6c8517952168c286d
parent2363d5ee231bf047479422d56d3b85b7d37a7c23
hw/nvram/spapr_nvram: Device can not be created by the users

Trying to add a spapr-nvram device currently aborts QEMU like this:

$ ppc64-softmmu/qemu-system-ppc64  -device spapr-nvram
qemu-system-ppc64: hw/ppc/spapr_rtas.c:407: spapr_rtas_register:
 Assertion `!rtas_table[token].name' failed.
Aborted (core dumped)

This NVRAM device registers RTAS calls during its realize function
and thus can only be used once - and that's internally from spapr.c.
So let's mark the device with user_creatable = false to avoid that
the users can crash their QEMU this way.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/nvram/spapr_nvram.c