block.c (3b35d4542c8537a9269f6372df531ced6c960084) block.c (a9262f551eba44d4d0f9e396d7124c059a93e204)
1/*
2 * Common code for block device models
3 *
4 * Copyright (C) 2012 Red Hat, Inc.
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or
7 * later. See the COPYING file in the top-level directory.
8 */

--- 39 unchanged lines hidden (view full) ---

48
49 /*
50 * We could loop for @size > BDRV_REQUEST_MAX_BYTES, but if we
51 * ever get to the point we want to read *gigabytes* here, we
52 * should probably rework the device to be more like an actual
53 * block device and read only on demand.
54 */
55 assert(size <= BDRV_REQUEST_MAX_BYTES);
1/*
2 * Common code for block device models
3 *
4 * Copyright (C) 2012 Red Hat, Inc.
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or
7 * later. See the COPYING file in the top-level directory.
8 */

--- 39 unchanged lines hidden (view full) ---

48
49 /*
50 * We could loop for @size > BDRV_REQUEST_MAX_BYTES, but if we
51 * ever get to the point we want to read *gigabytes* here, we
52 * should probably rework the device to be more like an actual
53 * block device and read only on demand.
54 */
55 assert(size <= BDRV_REQUEST_MAX_BYTES);
56 ret = blk_pread(blk, 0, buf, size, 0);
56 ret = blk_pread(blk, 0, size, buf, 0);
57 if (ret < 0) {
58 error_setg_errno(errp, -ret, "can't read block backend");
59 return false;
60 }
61 return true;
62}
63
64bool blkconf_blocksizes(BlockConf *conf, Error **errp)

--- 173 unchanged lines hidden ---
57 if (ret < 0) {
58 error_setg_errno(errp, -ret, "can't read block backend");
59 return false;
60 }
61 return true;
62}
63
64bool blkconf_blocksizes(BlockConf *conf, Error **errp)

--- 173 unchanged lines hidden ---