提交 bd6c9a61 编写于 作者: M Markus Armbruster 提交者: Kevin Wolf

qdev: Don't hw_error() in qdev_init_nofail()

Some of the failures are internal errors, and hw_error() is okay then.
But the common way to fail is bad user input, e.g. -global
isa-fdc.driveA=foo where drive foo has an unsupported rerror value.

exit(1) instead.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 b47b3525
......@@ -326,8 +326,10 @@ void qdev_init_nofail(DeviceState *dev)
{
DeviceInfo *info = dev->info;
if (qdev_init(dev) < 0)
hw_error("Initialization of device %s failed\n", info->name);
if (qdev_init(dev) < 0) {
error_report("Initialization of device %s failed\n", info->name);
exit(1);
}
}
/* Unlink device from bus and free the structure. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册