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>
This commit is contained in:
Fam Zheng 2014-08-12 10:12:54 +08:00 committed by Paolo Bonzini
parent 2656eb7c59
commit 5ff5efb46c
5 changed files with 32 additions and 21 deletions

View file

@ -728,9 +728,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) {
@ -744,8 +742,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;
}