qdev: show name of device that fails init

When initialising a device fails, show the name of the failing device.

The current behaviour is to silently exit on such errors.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Amit Shah 2009-09-29 15:51:03 +05:30 committed by Anthony Liguori
parent fa0cfdf24a
commit c8cd1fcd66
1 changed files with 1 additions and 0 deletions

View File

@ -215,6 +215,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)
return NULL;
}
if (qdev_init(qdev) != 0) {
qemu_error("Error initializing device %s\n", driver);
qdev_free(qdev);
return NULL;
}