From: "Andreas Färber" <afaerber@suse.de>
To: Igor Mammedov <imammedo@redhat.com>,
Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/1] target-i386: Clean up misuse of qdev_init() in realize method
Date: Thu, 05 Feb 2015 19:28:50 +0100 [thread overview]
Message-ID: <54D3B662.5080303@suse.de> (raw)
In-Reply-To: <20150205135114.36582c1f@nial.brq.redhat.com>
Am 05.02.2015 um 13:51 schrieb Igor Mammedov:
> On Thu, 5 Feb 2015 10:29:15 +0100
> Markus Armbruster <armbru@redhat.com> wrote:
>
>> x86_cpu_apic_realize() calls qdev_init() to realize the APIC.
>> qdev_init()'s error handling has unwanted side effects: it unparents
>> the device, and it calls qerror_report_err().
>>
>> qerror_report_err() is always inappropriate in realize methods,
>> because it doesn't return the Error object. It either reports the
>> error to stderr or the human monitor, or it stores it in the QMP
>> monitor, where it makes the QMP command fail even though the realize
>> method succeeded.
>>
>> Fortunately, qdev_init() can't actually fail here, because realize
>> can't fail for any of the three possible APIC device models.
>>
>> Clean up by cutting out the qdev_init() middle-man: set property
>> "realized" directly.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Thanks, applied to qom-cpu:
https://github.com/afaerber/qemu-cpu/commits/qom-cpu
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
prev parent reply other threads:[~2015-02-05 18:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 9:29 [Qemu-devel] [PATCH 1/1] target-i386: Clean up misuse of qdev_init() in realize method Markus Armbruster
2015-02-05 12:51 ` Igor Mammedov
2015-02-05 18:28 ` Andreas Färber [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D3B662.5080303@suse.de \
--to=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.