Lines Matching refs:bs
100 static int bochs_open(BlockDriverState *bs, QDict *options, int flags, in bochs_open() argument
103 BDRVBochsState *s = bs->opaque; in bochs_open()
112 ret = bdrv_apply_auto_read_only(bs, NULL, errp); in bochs_open()
118 ret = bdrv_open_file_child(NULL, options, "file", bs, errp); in bochs_open()
125 ret = bdrv_pread(bs->file, 0, sizeof(bochs), &bochs, 0); in bochs_open()
140 bs->total_sectors = le64_to_cpu(bochs.extra.redolog_v1.disk) / 512; in bochs_open()
142 bs->total_sectors = le64_to_cpu(bochs.extra.redolog.disk) / 512; in bochs_open()
159 ret = bdrv_pread(bs->file, le32_to_cpu(bochs.header), s->catalog_size * 4, in bochs_open()
191 if (s->catalog_size < DIV_ROUND_UP(bs->total_sectors, in bochs_open()
207 static void bochs_refresh_limits(BlockDriverState *bs, Error **errp) in bochs_refresh_limits() argument
209 bs->bl.request_alignment = BDRV_SECTOR_SIZE; /* No sub-sector I/O */ in bochs_refresh_limits()
213 seek_to_sector(BlockDriverState *bs, int64_t sector_num) in seek_to_sector() argument
215 BDRVBochsState *s = bs->opaque; in seek_to_sector()
234 ret = bdrv_co_pread(bs->file, bitmap_offset + (extent_offset / 8), 1, in seek_to_sector()
248 bochs_co_preadv(BlockDriverState *bs, int64_t offset, int64_t bytes, in bochs_co_preadv() argument
251 BDRVBochsState *s = bs->opaque; in bochs_co_preadv()
265 int64_t block_offset = seek_to_sector(bs, sector_num); in bochs_co_preadv()
275 ret = bdrv_co_preadv(bs->file, block_offset, 512, in bochs_co_preadv()
296 static void bochs_close(BlockDriverState *bs) in bochs_close() argument
298 BDRVBochsState *s = bs->opaque; in bochs_close()