Patchwork [1/2] qdev: show name of device that fails init

login
register
mail settings
Submitter Amit Shah
Date Sept. 29, 2009, 10:21 a.m.
Message ID <1254219664-7437-1-git-send-email-amit.shah@redhat.com>
Download mbox | patch
Permalink /patch/34416/
State Superseded
Headers show

Comments

Amit Shah - Sept. 29, 2009, 10:21 a.m.
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>
---
 hw/qdev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/qdev.c b/hw/qdev.c
index a589d72..a04fdb3 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -203,6 +203,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;
     }