[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] PPC: Clean up misuse of qdev_init() in kvm-
From: |
Scott Wood |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] PPC: Clean up misuse of qdev_init() in kvm-openpic creation |
Date: |
Tue, 24 Feb 2015 18:04:26 -0600 |
On Wed, 2015-02-18 at 15:43 +0100, Markus Armbruster wrote:
> Scott, can you review?
>
> Markus Armbruster <address@hidden> writes:
>
> > 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().
I'm OK with this if setting the realized property directly is considered
good practice, but if we're not supposed to call qdev_init() in cases
where it could legitimately fail, why is it distinct from
qdev_init_nofail()?
-Scott