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: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2010-05-27 21:23:08 +02:00 committed by Kevin Wolf
parent b47b35250f
commit bd6c9a617d

View File

@ -326,8 +326,10 @@ void qdev_init_nofail(DeviceState *dev)
{ {
DeviceInfo *info = dev->info; DeviceInfo *info = dev->info;
if (qdev_init(dev) < 0) if (qdev_init(dev) < 0) {
hw_error("Initialization of device %s failed\n", info->name); error_report("Initialization of device %s failed\n", info->name);
exit(1);
}
} }
/* Unlink device from bus and free the structure. */ /* Unlink device from bus and free the structure. */