[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/17] ide: Improve error messages
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 12/17] ide: Improve error messages |
Date: |
Tue, 6 Jul 2010 17:33:21 +0200 |
From: Markus Armbruster <address@hidden>
Use error_report(), because it points to the error location.
Reword "tried to assign twice" messages to make it clear that we're
complaining about the unit property.
Report invalid unit property instead of failing silently.
Signed-off-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
hw/ide/qdev.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 2977a16..221f387 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);
--
1.6.6.1
- [Qemu-devel] [PATCH 01/17] qemu-img check: Distinguish different kinds of errors, (continued)
- [Qemu-devel] [PATCH 01/17] qemu-img check: Distinguish different kinds of errors, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 03/17] Add virtio disk identification support, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 04/17] blockdev: Clean up how readonly persists across virtual media change, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 02/17] qcow2/vdi: Change check to distinguish error cases, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 05/17] block migration: Fix test for read-only drive, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 06/17] raw-posix: Fix test for host CD-ROM, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 07/17] fdc: Reject unimplemented error actions, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 09/17] scsi: Reject unimplemented error actions, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 08/17] qdev: Don't hw_error() in qdev_init_nofail(), Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 10/17] error: New qemu_opts_loc_restore(), Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 12/17] ide: Improve error messages,
Kevin Wolf <=
- [Qemu-devel] [PATCH 11/17] scsi: Error locations for -drive if=scsi device initialization, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 13/17] ide: Replace IDEState members is_cdrom, is_cf by drive_kind, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 14/17] ide: Make ide_init_drive() return success, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 15/17] ide: Reject readonly drives unless CD-ROM, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 16/17] ide: Reject invalid CHS geometry, Kevin Wolf, 2010/07/06
- [Qemu-devel] [PATCH 17/17] block: add sheepdog driver for distributed storage support, Kevin Wolf, 2010/07/06
- Re: [Qemu-devel] [PULL 00/17] Block patches, Anthony Liguori, 2010/07/06