]> git.proxmox.com Git - qemu.git/blobdiff - block/qcow2.c
block: expect errors from bdrv_co_is_allocated
[qemu.git] / block / qcow2.c
index 3376901bd7b274c944ed88ec26873c6fc3ad61c6..7f7282e0c40a88de0b1d14d204ca2164dc94ea94 100644 (file)
@@ -648,13 +648,11 @@ static int coroutine_fn qcow2_co_is_allocated(BlockDriverState *bs,
     int ret;
 
     *pnum = nb_sectors;
-    /* FIXME We can get errors here, but the bdrv_co_is_allocated interface
-     * can't pass them on today */
     qemu_co_mutex_lock(&s->lock);
     ret = qcow2_get_cluster_offset(bs, sector_num << 9, pnum, &cluster_offset);
     qemu_co_mutex_unlock(&s->lock);
     if (ret < 0) {
-        *pnum = 0;
+        return ret;
     }
 
     return (cluster_offset != 0) || (ret == QCOW2_CLUSTER_ZERO);