aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/qdev.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-08-12 10:12:54 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-08-26 13:20:44 +0200
commit5ff5efb46c4526f111e14c2247609f1c56f0f8f3 (patch)
tree9c3a6652abe1500ea0f79818241c6a806ad508d7 /hw/ide/qdev.c
parent2656eb7c599e306b95bad82b1372fc49ba3088f6 (diff)
block: Pass errp in blkconf_geometry
This allows us to pass error information to caller. Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ide/qdev.c')
-rw-r--r--hw/ide/qdev.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c
index 6e475e6970..b4a467116e 100644
--- a/hw/ide/qdev.c
+++ b/hw/ide/qdev.c
@@ -151,6 +151,7 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
{
IDEBus *bus = DO_UPCAST(IDEBus, qbus, dev->qdev.parent_bus);
IDEState *s = bus->ifs + dev->unit;
+ Error *err = NULL;
if (dev->conf.discard_granularity == -1) {
dev->conf.discard_granularity = 512;
@@ -161,9 +162,13 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
}
blkconf_serial(&dev->conf, &dev->serial);
- if (kind != IDE_CD
- && blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255) < 0) {
- return -1;
+ if (kind != IDE_CD) {
+ blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err);
+ if (err) {
+ error_report("%s", error_get_pretty(err));
+ error_free(err);
+ return -1;
+ }
}
if (ide_init_drive(s, dev->conf.bs, kind,