diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-08-28 17:08:13 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-08-28 17:08:13 +0100 |
commit | a6aebb38ba4682951ab04fe6d6e6b169bd9e4dca (patch) | |
tree | 7431ca40c5bc6882e9122326c7a2d6b140c5ba56 /hw/ide | |
parent | 38a01e55d268aeba68c84eea425252e7f810feaf (diff) | |
parent | d1dd32af6f37e5bb8e6b2024d07fce74f510a668 (diff) | |
download | qemu-a6aebb38ba4682951ab04fe6d6e6b169bd9e4dca.zip |
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
SCSI patches include bug fixes from Fam and Peter, improved error
reporting from Fam and a fix for DPRINTF bitrot. Memory patches try
again to initialize name from the QOM name.
# gpg: Signature made Thu 28 Aug 2014 15:10:31 BST using RSA key ID 9B4D86F2
# gpg: Good signature from "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: aka "Paolo Bonzini <bonzini@gnu.org>"
* remotes/bonzini/tags/for-upstream:
memory: Lazy init name from QOM name as needed
xen: hvm: Abstract away memory region name ref
xen-hvm: Constify string
virtio-scsi: Report error if num_queues is 0 or too large
scsi-generic: remove superfluous DPRINTF avoid to break compiling
block/iscsi: fix memory corruption on iscsi resize
scsi-bus: Convert DeviceClass init to realize
block: Pass errp in blkconf_geometry
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/ide')
-rw-r--r-- | hw/ide/qdev.c | 11 |
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, |