diff options
author | Thomas Huth <thuth@redhat.com> | 2017-08-24 09:41:33 +0200 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2017-09-08 09:30:55 +1000 |
commit | 280503ee9d7833a793770d732dda5358659825e9 (patch) | |
tree | 81b9078c2aad54d0e3439df6c8517952168c286d /hw/nvram/spapr_nvram.c | |
parent | 2363d5ee231bf047479422d56d3b85b7d37a7c23 (diff) | |
download | qemu-280503ee9d7833a793770d732dda5358659825e9.zip |
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>
Diffstat (limited to 'hw/nvram/spapr_nvram.c')
-rw-r--r-- | hw/nvram/spapr_nvram.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/nvram/spapr_nvram.c b/hw/nvram/spapr_nvram.c index bc355a4348..4a0aec8e1d 100644 --- a/hw/nvram/spapr_nvram.c +++ b/hw/nvram/spapr_nvram.c @@ -264,6 +264,8 @@ static void spapr_nvram_class_init(ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->props = spapr_nvram_properties; dc->vmsd = &vmstate_spapr_nvram; + /* Reason: Internal device only, uses spapr_rtas_register() in realize() */ + dc->user_creatable = false; } static const TypeInfo spapr_nvram_type_info = { |