qdev: show name of device that fails init
authorAmit Shah <amit.shah@redhat.com>
Tue, 29 Sep 2009 10:21:03 +0000 (15:51 +0530)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 5 Oct 2009 14:32:52 +0000 (09:32 -0500)
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>
hw/qdev.c

index 86cf81b..b2d11ce 100644 (file)
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -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;
     }