summaryrefslogtreecommitdiffstats
path: root/hw/block/virtio-blk.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-08-28 17:08:13 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-08-28 17:08:13 +0100
commita6aebb38ba4682951ab04fe6d6e6b169bd9e4dca (patch)
tree7431ca40c5bc6882e9122326c7a2d6b140c5ba56 /hw/block/virtio-blk.c
parent38a01e55d268aeba68c84eea425252e7f810feaf (diff)
parentd1dd32af6f37e5bb8e6b2024d07fce74f510a668 (diff)
downloadhqemu-a6aebb38ba4682951ab04fe6d6e6b169bd9e4dca.zip
hqemu-a6aebb38ba4682951ab04fe6d6e6b169bd9e4dca.tar.gz
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/block/virtio-blk.c')
-rw-r--r--hw/block/virtio-blk.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index d9167ce..a7f2827 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -729,9 +729,7 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
VirtIOBlock *s = VIRTIO_BLK(dev);
VirtIOBlkConf *blk = &(s->blk);
-#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE
Error *err = NULL;
-#endif
static int virtio_blk_id;
if (!blk->conf.bs) {
@@ -745,8 +743,9 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
blkconf_serial(&blk->conf, &blk->serial);
s->original_wce = bdrv_enable_write_cache(blk->conf.bs);
- if (blkconf_geometry(&blk->conf, NULL, 65535, 255, 255) < 0) {
- error_setg(errp, "Error setting geometry");
+ blkconf_geometry(&blk->conf, NULL, 65535, 255, 255, &err);
+ if (err) {
+ error_propagate(errp, err);
return;
}
OpenPOWER on IntegriCloud