diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2010-07-06 10:48:01 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-07-06 10:48:01 -0500 |
commit | 5efb397f877fc3002c8bc764f4656f4761bd965d (patch) | |
tree | 4ef1809f16a7f30f237840cdbfc5521afd4e8316 /hw/ide/qdev.c | |
parent | fb787f81e749fde8c74548f9db1472eb321b9a0c (diff) | |
parent | 33b1db1c8888b77e06c720ebef0482ed598eb384 (diff) |
Merge remote branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'hw/ide/qdev.c')
-rw-r--r-- | hw/ide/qdev.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 2977a168e5..53468edcbc 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -18,7 +18,7 @@ */ #include <hw/hw.h> #include "dma.h" - +#include "qemu-error.h" #include <hw/ide/internal.h> /* --------------------------------- */ @@ -40,7 +40,7 @@ static int ide_qdev_init(DeviceState *qdev, DeviceInfo *base) IDEBus *bus = DO_UPCAST(IDEBus, qbus, qdev->parent_bus); if (!dev->conf.bs) { - fprintf(stderr, "%s: no drive specified\n", qdev->info->name); + error_report("No drive specified"); goto err; } if (dev->unit == -1) { @@ -49,19 +49,20 @@ static int ide_qdev_init(DeviceState *qdev, DeviceInfo *base) switch (dev->unit) { case 0: if (bus->master) { - fprintf(stderr, "ide: tried to assign master twice\n"); + error_report("IDE unit %d is in use", dev->unit); goto err; } bus->master = dev; break; case 1: if (bus->slave) { - fprintf(stderr, "ide: tried to assign slave twice\n"); + error_report("IDE unit %d is in use", dev->unit); goto err; } bus->slave = dev; break; default: + error_report("Invalid IDE unit %d", dev->unit); goto err; } return info->init(dev); @@ -117,7 +118,9 @@ static int ide_drive_initfn(IDEDevice *dev) } } - ide_init_drive(s, dev->conf.bs, dev->version, serial); + if (ide_init_drive(s, dev->conf.bs, dev->version, serial) < 0) { + return -1; + } if (!dev->version) { dev->version = qemu_strdup(s->version); |