PPC: Clean up misuse of qdev_init() in kvm-openpic creation
authorMarkus Armbruster <armbru@redhat.com>
Thu, 5 Feb 2015 09:34:47 +0000 (10:34 +0100)
committerAlexander Graf <agraf@suse.de>
Mon, 9 Mar 2015 14:00:01 +0000 (15:00 +0100)
commitfe656ebd4e4339972bae771a692109fd43ff5737
tree496e5812d562bd37a7a5e68294349c0ff1a67ca7
parent74e5ae284b1c8ac36a77e57ab9a49178173c666f
PPC: Clean up misuse of qdev_init() in kvm-openpic creation

We call ppce500_init_mpic_kvm() to create a "kvm-openpic".  If it
fails, we call ppce500_init_mpic_qemu() to fall back to plain
"openpic".

ppce500_init_mpic_kvm() uses qdev_init().  qdev_init()'s error
handling has an unwanted side effect: it calls qerror_report_err(),
which prints to stderr.  Looks like an error, but isn't.

In QMP context, it would stash the error in the monitor instead,
making the QMP command fail.  Fortunately, it's only called from board
initialization, never in QMP context.

Clean up by cutting out the qdev_init() middle-man: set property
"realized" directly.

While there, improve the error message when we can't satisfy an
explicit user request for "kvm-openpic", and exit(1) instead of
abort().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/e500.c