Home
last modified time | relevance | path

Searched refs:bs (Results 1 – 25 of 76) sorted by relevance

1234

/illumos-kvm-cmd/
H A Dblock.c356 if (bs->sg || !bdrv_is_inserted(bs)) { in find_image_format()
670 bs->drv->bdrv_close(bs); in bdrv_close()
760 return bs->drv->bdrv_check(bs, res); in bdrv_check()
1402 return (bs->encrypted && !bs->valid_key); in bdrv_key_required()
1420 ret = bs->drv->bdrv_set_key(bs, key); in bdrv_set_key()
1492 if (bs->drv && bs->drv->bdrv_flush) { in bdrv_flush()
1493 return bs->drv->bdrv_flush(bs); in bdrv_flush()
1526 return bs->drv->bdrv_has_zero_init(bs); in bdrv_has_zero_init()
1883 while ((bs = bdrv_next(bs))) { in bdrv_snapshots()
2102 blkdata->bs = bs; in blk_dirty_cb_alloc()
[all …]
H A Dblock.h69 void bdrv_make_anon(BlockDriverState *bs);
70 void bdrv_delete(BlockDriverState *bs);
74 void bdrv_close(BlockDriverState *bs);
94 int bdrv_commit(BlockDriverState *bs);
146 int bdrv_flush(BlockDriverState *bs);
178 int bdrv_is_sg(BlockDriverState *bs);
180 int bdrv_is_inserted(BlockDriverState *bs);
182 int bdrv_is_locked(BlockDriverState *bs);
208 int bdrv_is_snapshot(BlockDriverState *bs);
246 int bdrv_in_use(BlockDriverState *bs);
[all …]
H A Dblock_int.h54 int (*bdrv_open)(BlockDriverState *bs, int flags);
60 void (*bdrv_close)(BlockDriverState *bs);
62 int (*bdrv_flush)(BlockDriverState *bs);
66 int (*bdrv_make_empty)(BlockDriverState *bs);
87 int64_t (*bdrv_getlength)(BlockDriverState *bs);
93 int (*bdrv_snapshot_goto)(BlockDriverState *bs,
96 int (*bdrv_snapshot_list)(BlockDriverState *bs,
111 int (*bdrv_is_inserted)(BlockDriverState *bs);
112 int (*bdrv_media_changed)(BlockDriverState *bs);
212 BlockDriverState *bs; member
[all …]
H A Dblockdev.c576 if (!bs) { in do_commit()
601 if (!bs) { in do_snapshot_blkdev()
632 bdrv_flush(bs); in do_snapshot_blkdev()
635 bdrv_close(bs); in do_snapshot_blkdev()
665 bdrv_close(bs); in eject_device()
676 if (!bs) { in do_eject()
690 if (!bs) { in do_block_set_passwd()
715 if (!bs) { in do_change_block()
744 if (!bs) { in do_drive_del()
755 bdrv_flush(bs); in do_drive_del()
[all …]
H A Dqemu-img.c247 return bs; in bdrv_new_open()
249 if (bs) { in bdrv_new_open()
390 if (!bs) { in img_check()
423 bdrv_delete(bs); in img_check()
469 if (!bs) { in img_commit()
924 if (bs) { in img_convert()
1020 if (!bs) { in img_info()
1129 if (!bs) { in img_snapshot()
1231 if (!bs) { in img_rebase()
1455 if (!bs) { in img_resize()
[all …]
H A Dblock-migration.c44 BlockDriverState *bs; member
182 BlockDriverState *bs = bmds->bs; in alloc_aio_bitmap() local
215 BlockDriverState *bs = bmds->bs; in mig_save_device_bulk() local
290 if (!bdrv_is_read_only(bs)) { in init_blk_migration_it()
297 bmds->bs = bs; in init_blk_migration_it()
304 bdrv_set_in_use(bs, 1); in init_blk_migration_it()
543 bdrv_set_in_use(bmds->bs, 0); in blk_mig_cleanup()
664 bs = bdrv_find(device_name); in block_load()
665 if (!bs) { in block_load()
671 if (bs != bs_prev) { in block_load()
[all …]
/illumos-kvm-cmd/block/
H A Draw.c6 static int raw_open(BlockDriverState *bs, int flags) in raw_open() argument
8 bs->sg = bs->file->sg; in raw_open()
38 static void raw_close(BlockDriverState *bs) in raw_close() argument
42 static int raw_flush(BlockDriverState *bs) in raw_flush() argument
44 return bdrv_flush(bs->file); in raw_flush()
55 return bdrv_getlength(bs->file); in raw_getlength()
60 return bdrv_truncate(bs->file, offset); in raw_truncate()
75 return bdrv_is_inserted(bs->file); in raw_is_inserted()
85 bdrv_set_locked(bs->file, locked); in raw_set_locked()
91 return bdrv_ioctl(bs->file, req, buf); in raw_ioctl()
[all …]
H A Dqcow2.c120 if (bdrv_pread(bs->file, offset , bs->backing_format, in qcow2_read_extensions()
190 bs->encrypted = 1; in qcow2_open()
285 qcow2_free_snapshots(bs); in qcow2_open()
427 BlockDriverState *bs = acb->common.bs; in qcow2_aio_read_cb() local
627 BlockDriverState *bs = acb->common.bs; in qcow2_aio_write_cb() local
935 BlockDriverState* bs; in qcow2_create2() local
981 bdrv_close(bs); in qcow2_create2()
1029 bdrv_delete(bs); in qcow2_create2()
1095 l2_cache_reset(bs); in qcow2_make_empty()
1300 bs->growable = 1; in qcow2_save_vmstate()
[all …]
H A Draw-posix.c261 ret = fd_open(bs); in raw_pread_aligned()
325 ret = fd_open(bs); in raw_pwrite_aligned()
547 if (fd_open(bs) < 0) in raw_aio_submit()
591 if (fd_open(bs) < 0) in raw_aio_flush()
644 ret = fd_open(bs); in raw_getlength()
675 ret = fd_open(bs); in raw_getlength()
724 ret = fd_open(bs); in raw_getlength()
947 bs->sg = 1; in hdev_open()
1018 if (fd_open(bs) < 0) in hdev_aio_ioctl()
1152 return fd_open(bs) >= 0; in floppy_is_inserted()
[all …]
H A Dqcow2-refcount.c40 BDRVQcowState *s = bs->opaque; in qcow2_refcount_init()
61 BDRVQcowState *s = bs->opaque; in qcow2_refcount_close()
70 BDRVQcowState *s = bs->opaque; in load_refcount_block()
87 BDRVQcowState *s = bs->opaque; in get_refcount()
158 BDRVQcowState *s = bs->opaque; in alloc_refcount_block()
240 bdrv_flush(bs->file); in alloc_refcount_block()
418 BDRVQcowState *s = bs->opaque; in update_refcount()
520 BDRVQcowState *s = bs->opaque; in update_cluster_refcount()
528 bdrv_flush(bs->file); in update_cluster_refcount()
630 bdrv_flush(bs->file); in qcow2_alloc_bytes()
[all …]
H A Dqcow2-cluster.c33 BDRVQcowState *s = bs->opaque; in qcow2_grow_l1_table()
118 BDRVQcowState *s = bs->opaque; in l2_load()
133 BDRVQcowState *s = bs->opaque; in write_l1_entry()
165 BDRVQcowState *s = bs->opaque; in l2_allocate()
296 BDRVQcowState *s = bs->opaque; in qcow2_read()
313 if (bs->backing_hd) { in qcow2_read()
353 BDRVQcowState *s = bs->opaque; in copy_sectors()
397 BDRVQcowState *s = bs->opaque; in qcow2_get_cluster_offset()
491 BDRVQcowState *s = bs->opaque; in get_cluster_table()
559 BDRVQcowState *s = bs->opaque; in qcow2_alloc_compressed_cluster_offset()
[all …]
H A Dqcow2-snapshot.c51 BDRVQcowState *s = bs->opaque; in qcow2_free_snapshots()
65 BDRVQcowState *s = bs->opaque; in qcow2_read_snapshots()
114 qcow2_free_snapshots(bs); in qcow2_read_snapshots()
121 BDRVQcowState *s = bs->opaque; in qcow2_write_snapshots()
141 bdrv_flush(bs->file); in qcow2_write_snapshots()
195 BDRVQcowState *s = bs->opaque; in find_new_snapshot_id()
210 BDRVQcowState *s = bs->opaque; in find_snapshot_by_id()
275 bdrv_flush(bs->file); in qcow2_snapshot_create()
306 qcow2_check_refcounts(bs); in qcow2_snapshot_create()
350 qcow2_check_refcounts(bs); in qcow2_snapshot_goto()
[all …]
H A Dqcow2.h177 int qcow2_refcount_init(BlockDriverState *bs);
178 void qcow2_refcount_close(BlockDriverState *bs);
181 int64_t qcow2_alloc_bytes(BlockDriverState *bs, int size);
182 void qcow2_free_clusters(BlockDriverState *bs,
184 void qcow2_free_any_clusters(BlockDriverState *bs,
189 int qcow2_update_snapshot_refcount(BlockDriverState *bs,
196 void qcow2_l2_cache_reset(BlockDriverState *bs);
222 void qcow2_free_snapshots(BlockDriverState *bs);
223 int qcow2_read_snapshots(BlockDriverState *bs);
228 int qcow2_cache_destroy(BlockDriverState* bs, Qcow2Cache *c);
[all …]
H A Dcow.c62 BDRVCowState *s = bs->opaque; in cow_open()
80 bs->total_sectors = size / 512; in cow_open()
82 pstrcpy(bs->backing_file, sizeof(bs->backing_file), in cow_open()
143 changed = is_bit_set(bs, sector_num); in cow_is_allocated()
175 BDRVCowState *s = bs->opaque; in cow_read()
180 ret = bdrv_pread(bs->file, in cow_read()
186 if (bs->backing_hd) { in cow_read()
205 BDRVCowState *s = bs->opaque; in cow_write()
216 static void cow_close(BlockDriverState *bs) in cow_close() argument
285 static int cow_flush(BlockDriverState *bs) in cow_flush() argument
[all …]
H A Dqcow2-cache.c48 BDRVQcowState *s = bs->opaque; in qcow2_cache_create()
83 ret = qcow2_cache_flush(bs, c->depends); in qcow2_cache_flush_dependency()
96 BDRVQcowState *s = bs->opaque; in qcow2_cache_entry_flush()
104 ret = qcow2_cache_flush_dependency(bs, c); in qcow2_cache_entry_flush()
106 ret = bdrv_flush(bs->file); in qcow2_cache_entry_flush()
119 BLKDBG_EVENT(bs->file, BLKDBG_L2_UPDATE); in qcow2_cache_entry_flush()
140 ret = qcow2_cache_entry_flush(bs, c, i); in qcow2_cache_flush()
147 ret = bdrv_flush(bs->file); in qcow2_cache_flush()
169 ret = qcow2_cache_flush_dependency(bs, c); in qcow2_cache_set_dependency()
217 BDRVQcowState *s = bs->opaque; in qcow2_cache_do_get()
[all …]
H A Dvmdk.c160 BDRVVmdkState *s = bs->opaque; in vmdk_is_cid_valid()
363 BDRVVmdkState *s = bs->opaque; in vmdk_open()
441 BDRVVmdkState *s = bs->opaque; in get_whole_cluster()
446 if (bs->backing_hd) { in get_whole_cluster()
470 BDRVVmdkState *s = bs->opaque; in vmdk_L2update()
490 BDRVVmdkState *s = bs->opaque; in get_cluster_offset()
572 BDRVVmdkState *s = bs->opaque; in vmdk_is_allocated()
588 BDRVVmdkState *s = bs->opaque; in vmdk_read()
600 if (bs->backing_hd) { in vmdk_read()
623 BDRVVmdkState *s = bs->opaque; in vmdk_write()
[all …]
H A Dqcow.c94 BDRVQcowState *s = bs->opaque; in qcow_open()
117 bs->encrypted = 1; in qcow_open()
157 if (bdrv_pread(bs->file, header.backing_file_offset, bs->backing_file, len) != len) in qcow_open()
173 BDRVQcowState *s = bs->opaque; in qcow_set_key()
256 BDRVQcowState *s = bs->opaque; in get_cluster_offset()
381 BDRVQcowState *s = bs->opaque; in qcow_is_allocated()
459 if (bs->backing_hd) {
544 BlockDriverState *bs = acb->common.bs; in qcow_aio_read_cb() local
585 if (bs->backing_hd) { in qcow_aio_read_cb()
649 BlockDriverState *bs = acb->common.bs; in qcow_aio_write_cb() local
[all …]
H A Ddmg.c77 BDRVDMGState *s = bs->opaque; in dmg_open()
83 bs->read_only = 1; in dmg_open()
88 offset = bdrv_getlength(bs->file); in dmg_open()
94 info_begin = read_off(bs, offset); in dmg_open()
116 count = read_uint32(bs, offset); in dmg_open()
121 type = read_uint32(bs, offset); in dmg_open()
137 s->types[i] = read_uint32(bs, offset); in dmg_open()
160 s->lengths[i] = read_off(bs, offset); in dmg_open()
213 BDRVDMGState *s = bs->opaque; in dmg_read_chunk()
270 BDRVDMGState *s = bs->opaque; in dmg_read()
[all …]
H A Dqed.c301 s->bs = bs; in bdrv_qed_open()
367 pstrcpy(bs->backing_format, sizeof(bs->backing_format), "raw"); in bdrv_qed_open()
387 bdrv_flush(bs->file); in bdrv_qed_open()
432 bdrv_flush(bs->file); in bdrv_qed_close()
446 return bdrv_flush(bs->file); in bdrv_qed_flush()
467 BlockDriverState *bs = NULL; in qed_create() local
480 ret = bdrv_truncate(bs, 0); in qed_create()
515 bdrv_delete(bs); in qed_create()
639 if (s->bs->backing_hd) { in qed_read_backing_file()
992 if (s->bs->backing_hd) { in qed_should_set_need_check()
[all …]
H A Dblkdebug.c279 BDRVBlkdebugState *s = bs->opaque; in blkdebug_open()
333 BDRVBlkdebugState *s = bs->opaque; in inject_error()
360 BDRVBlkdebugState *s = bs->opaque; in blkdebug_aio_readv()
363 return inject_error(bs, cb, opaque); in blkdebug_aio_readv()
375 BDRVBlkdebugState *s = bs->opaque; in blkdebug_aio_writev()
378 return inject_error(bs, cb, opaque); in blkdebug_aio_writev()
388 BDRVBlkdebugState *s = bs->opaque; in blkdebug_close()
402 return bdrv_flush(bs->file); in blkdebug_flush()
414 BDRVBlkdebugState *s = bs->opaque; in process_rule()
438 BDRVBlkdebugState *s = bs->opaque; in blkdebug_debug_event()
[all …]
H A Dparallels.c70 static int parallels_open(BlockDriverState *bs, int flags) in parallels_open() argument
72 BDRVParallelsState *s = bs->opaque; in parallels_open()
76 bs->read_only = 1; // no write support yet in parallels_open()
78 if (bdrv_pread(bs->file, 0, &ph, sizeof(ph)) != sizeof(ph)) in parallels_open()
86 bs->total_sectors = le32_to_cpu(ph.nb_sectors); in parallels_open()
107 BDRVParallelsState *s = bs->opaque; in seek_to_sector()
119 static int parallels_read(BlockDriverState *bs, int64_t sector_num, in parallels_read() argument
123 int64_t position = seek_to_sector(bs, sector_num); in parallels_read()
125 if (bdrv_pread(bs->file, position, buf, 512) != 512) in parallels_read()
137 static void parallels_close(BlockDriverState *bs) in parallels_close() argument
[all …]
H A Dvpc.c153 BDRVVPCState *s = bs->opaque; in vpc_open()
171 "incorrect.\n", bs->filename); in vpc_open()
176 bs->total_sectors = (int64_t) in vpc_open()
238 BDRVVPCState *s = bs->opaque; in get_sector_offset()
309 BDRVVPCState *s = bs->opaque; in rewrite_footer()
328 BDRVVPCState *s = bs->opaque; in alloc_block()
352 ret = rewrite_footer(bs); in alloc_block()
373 BDRVVPCState *s = bs->opaque; in vpc_read()
407 BDRVVPCState *s = bs->opaque; in vpc_write()
442 return bdrv_flush(bs->file); in vpc_flush()
[all …]
H A Draw-win32.c78 BDRVRawState *s = bs->opaque; in raw_open()
111 BDRVRawState *s = bs->opaque; in raw_read()
132 BDRVRawState *s = bs->opaque; in raw_write()
150 static int raw_flush(BlockDriverState *bs) in raw_flush() argument
152 BDRVRawState *s = bs->opaque; in raw_flush()
163 static void raw_close(BlockDriverState *bs) in raw_close() argument
165 BDRVRawState *s = bs->opaque; in raw_close()
171 BDRVRawState *s = bs->opaque; in raw_truncate()
185 BDRVRawState *s = bs->opaque; in raw_getlength()
289 BDRVRawState *s = bs->opaque; in find_device_type()
[all …]
H A Dcloop.c53 static int cloop_open(BlockDriverState *bs, int flags) in cloop_open() argument
55 BDRVCloopState *s = bs->opaque; in cloop_open()
58 bs->read_only = 1; in cloop_open()
61 if (bdrv_pread(bs->file, 128, &s->block_size, 4) < 4) { in cloop_open()
66 if (bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4) < 4) { in cloop_open()
95 bs->total_sectors = s->n_blocks*s->sectors_per_block; in cloop_open()
104 BDRVCloopState *s = bs->opaque; in cloop_read_block()
134 BDRVCloopState *s = bs->opaque; in cloop_read()
140 if(cloop_read_block(bs, block_num) != 0) in cloop_read()
147 static void cloop_close(BlockDriverState *bs) in cloop_close() argument
[all …]
H A Dbochs.c110 static int bochs_open(BlockDriverState *bs, int flags) in bochs_open() argument
112 BDRVBochsState *s = bs->opaque; in bochs_open()
117 bs->read_only = 1; // no write support yet in bochs_open()
135 bs->total_sectors = le64_to_cpu(bochs.extra.redolog.disk) / 512; in bochs_open()
160 BDRVBochsState *s = bs->opaque; in seek_to_sector()
177 if (bdrv_pread(bs->file, bitmap_offset + (extent_offset / 8), in seek_to_sector()
189 static int bochs_read(BlockDriverState *bs, int64_t sector_num, in bochs_read() argument
195 int64_t block_offset = seek_to_sector(bs, sector_num); in bochs_read()
197 ret = bdrv_pread(bs->file, block_offset, buf, 512); in bochs_read()
210 static void bochs_close(BlockDriverState *bs) in bochs_close() argument
[all …]

Completed in 52 milliseconds

1234