Home
last modified time | relevance | path

Searched refs:blk (Results 1 – 25 of 222) sorted by relevance

123456789

/qemu/block/
H A Dblock-backend.c177 blk_set_perm(blk, blk->perm, blk->shared_perm, &local_err); in blk_vm_state_changed()
230 blk_set_perm_locked(blk, blk->perm, blk->shared_perm, &local_err); in blk_root_activate()
247 if (blk->dev || blk_name(blk)[0]) { in blk_can_inactivate()
516 return blk ? blk->refcnt : 0; in blk_get_refcnt()
1533 acb->blk = blk; in blk_abort_aio_request()
1580 .blk = blk, in blk_aio_prwv()
1887 .blk = blk, in blk_aio_zone_report()
1928 .blk = blk, in blk_aio_zone_mgmt()
1968 .blk = blk, in blk_aio_zone_append()
2466 BlockBackend *blk = s->blk; in blk_root_set_aio_ctx_commit() local
[all …]
H A Dqapi-sysemu.c45 BlockBackend *blk; in qmp_get_blk() local
62 return blk; in qmp_get_blk()
79 BlockBackend *blk; in do_open_tray() local
84 if (!blk) { in do_open_tray()
147 if (!blk) { in qmp_blockdev_close_tray()
182 if (!blk) { in blockdev_remove_medium()
201 bs = blk_bs(blk); in blockdev_remove_medium()
283 if (!blk) { in blockdev_insert_medium()
325 if (!blk) { in qmp_blockdev_change_medium()
428 if (!blk) { in qmp_block_set_io_throttle()
[all …]
H A Dqapi.c70 .writeback = blk ? blk_enable_write_cache(blk) : true, in bdrv_block_device_info()
91 if (blk && blk_get_public(blk)->throttle_group_member.throttle_state) { in bdrv_block_device_info()
424 BlockDriverState *bs = blk_bs(blk); in bdrv_query_info()
442 if (blk_dev_has_tray(blk)) { in bdrv_query_info()
447 if (blk_iostatus_is_enabled(blk)) { in bdrv_query_info()
666 BlockBackend *blk; in qmp_query_block() local
671 for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) { in qmp_query_block()
674 if (!*blk_name(blk) && !blk_get_attached_dev(blk)) { in qmp_query_block()
699 BlockBackend *blk; in qmp_query_blockstats() local
710 for (blk = blk_all_next(NULL); blk; blk = blk_all_next(blk)) { in qmp_query_blockstats()
[all …]
/qemu/include/sysemu/
H A Dblock-backend-global-state.h43 int blk_get_refcnt(BlockBackend *blk);
44 void blk_ref(BlockBackend *blk);
51 BlockBackend *blk_next(BlockBackend *blk);
54 void monitor_remove_blk(BlockBackend *blk);
59 void blk_remove_bs(BlockBackend *blk);
68 void blk_iostatus_enable(BlockBackend *blk);
71 void blk_iostatus_reset(BlockBackend *blk);
84 bool blk_in_drain(BlockBackend *blk);
85 void blk_drain(BlockBackend *blk);
90 bool blk_is_sg(BlockBackend *blk);
[all …]
H A Dblock-backend-io.h26 const char *blk_name(const BlockBackend *blk);
28 BlockDriverState *blk_bs(BlockBackend *blk);
35 char *blk_get_attached_dev_id(BlockBackend *blk);
47 BlockAIOCB *blk_aio_flush(BlockBackend *blk,
65 void blk_inc_in_flight(BlockBackend *blk);
66 void blk_dec_in_flight(BlockBackend *blk);
88 int64_t blk_nb_sectors(BlockBackend *blk);
92 bool blk_is_writable(BlockBackend *blk);
93 bool blk_enable_write_cache(BlockBackend *blk);
100 int blk_get_max_iov(BlockBackend *blk);
[all …]
/qemu/tests/unit/
H A Dtest-blockjob.c88 return blk; in create_blk()
98 blk_remove_bs(blk); in destroy_blk()
99 blk_unref(blk); in destroy_blk()
104 BlockBackend *blk[3]; in test_job_ids() local
156 destroy_blk(blk[0]); in test_job_ids()
157 destroy_blk(blk[1]); in test_job_ids()
163 BlockBackend *blk; member
205 BlockBackend *blk; in create_common() local
220 s->blk = blk; in create_common()
229 BlockBackend *blk = s->blk; in cancel_common() local
[all …]
H A Dtest-block-iothread.c470 BlockBackend *blk; in test_sync_op() local
490 t->blkfn(blk); in test_sync_op()
495 blk_unref(blk); in test_sync_op()
553 BlockBackend *blk; in test_attach_blockjob() local
597 blk_unref(blk); in test_attach_blockjob()
617 BlockBackend *blk; in test_propagate_basic() local
660 blk_unref(blk); in test_propagate_basic()
734 blk_unref(blk); in test_propagate_diamond()
807 blk_unref(blk); in test_propagate_mirror()
842 blk_unref(blk); in test_attach_second_node()
[all …]
H A Dtest-replication.c190 g_assert(blk); in start_primary()
196 return blk; in start_primary()
205 assert(blk); in teardown_primary()
208 blk_unref(blk); in teardown_primary()
306 assert(blk); in start_secondary()
332 assert(blk); in start_secondary()
337 return blk; in start_secondary()
347 assert(blk); in teardown_secondary()
350 blk_unref(blk); in teardown_secondary()
354 assert(blk); in teardown_secondary()
[all …]
H A Dtest-crypto-block.c275 QCryptoBlock *blk; in test_block() local
288 g_assert(blk); in test_block()
298 qcrypto_block_free(blk); in test_block()
308 g_assert(blk == NULL); in test_block()
321 qcrypto_block_free(blk); in test_block()
332 g_assert(blk); in test_block()
336 qcrypto_block_free(blk); in test_block()
351 QCryptoBlock *blk; in test_luks_bad_header() local
368 g_assert(blk); in test_luks_bad_header()
370 qcrypto_block_free(blk); in test_luks_bad_header()
[all …]
H A Dtest-bdrv-drain.c201 return blk; in test_setup()
268 blk_unref(blk); in test_drv_cb_drain_all()
275 blk_unref(blk); in test_drv_cb_drain()
288 blk_unref(blk); in test_drv_cb_co_drain_all()
301 blk_unref(blk); in test_drv_cb_co_drain()
338 blk_unref(blk); in test_quiesce_drain_all()
345 blk_unref(blk); in test_quiesce_drain()
358 blk_unref(blk); in test_quiesce_co_drain_all()
371 blk_unref(blk); in test_quiesce_co_drain()
988 BlockBackend *blk = dbdd->blk; in test_co_delete_by_drain() local
[all …]
H A Dtest-block-backend.c41 BlockBackend *blk = blk_new(qemu_get_aio_context(), in test_drain_aio_error() local
46 acb = blk_aio_flush(blk, test_drain_aio_error_flush_cb, &completed); in test_drain_aio_error()
50 blk_drain(blk); in test_drain_aio_error()
53 blk_unref(blk); in test_drain_aio_error()
58 BlockBackend *blk = blk_new(qemu_get_aio_context(), in test_drain_all_aio_error() local
63 acb = blk_aio_flush(blk, test_drain_aio_error_flush_cb, &completed); in test_drain_all_aio_error()
70 blk_unref(blk); in test_drain_all_aio_error()
/qemu/hw/block/
H A Dblock.c30 BlockDriverState *bs = blk_bs(blk); in blk_pread_nonzeroes()
69 blk_len = blk_getlength(blk); in blk_check_size_and_read_all()
80 blk_name(blk), blk_len); in blk_check_size_and_read_all()
91 ret = blk_pread_nonzeroes(blk, size, buf); in blk_check_size_and_read_all()
105 BlockBackend *blk = conf->blk; in blkconf_blocksizes() local
119 bs = blk_bs(blk); in blkconf_blocksizes()
202 BlockBackend *blk = conf->blk; in blkconf_apply_backend_options() local
236 rerror = blk_get_on_error(blk, true); in blkconf_apply_backend_options()
244 blk_set_enable_write_cache(blk, wce); in blkconf_apply_backend_options()
245 blk_set_on_error(blk, rerror, werror); in blkconf_apply_backend_options()
[all …]
H A Dhd-geometry.c55 static int guess_disk_lchs(BlockBackend *blk, in guess_disk_lchs() argument
64 blk_get_geometry(blk, &nb_sectors); in guess_disk_lchs()
66 if (blk_pread(blk, 0, BDRV_SECTOR_SIZE, buf, 0) < 0) { in guess_disk_lchs()
98 static void guess_chs_for_size(BlockBackend *blk, in guess_chs_for_size() argument
104 blk_get_geometry(blk, &nb_sectors); in guess_chs_for_size()
117 void hd_geometry_guess(BlockBackend *blk, in hd_geometry_guess() argument
126 if (blk_probe_geometry(blk, &geo) == 0) { in hd_geometry_guess()
131 } else if (guess_disk_lchs(blk, &cylinders, &heads, &secs) < 0) { in hd_geometry_guess()
133 guess_chs_for_size(blk, pcyls, pheads, psecs); in hd_geometry_guess()
139 guess_chs_for_size(blk, pcyls, pheads, psecs); in hd_geometry_guess()
[all …]
/qemu/
H A Dqemu-io-cmds.c75 if (!init_check_command(blk, ct)) { in command()
108 assert(blk || !ct->perm); in command()
129 return ct->cfunc(blk, argc, argv); in command()
349 buf = blk_blockalign(blk, len); in qemu_io_alloc()
1346 BlockBackend *blk; member
1481 ctx->blk = blk; in aio_read_f()
1595 ctx->blk = blk; in aio_write_f()
1723 return blk_flush(blk); in flush_f()
2011 size = blk_getlength(blk); in length_f()
2274 bytes = blk_getlength(blk); in map_f()
[all …]
/qemu/pc-bios/s390-ccw/
H A Dvirtio-blkdev.c125 vdev->config.blk.blk_size = VIRTIO_ISO_BLOCK_SIZE; in virtio_assume_iso9660()
126 vdev->config.blk.physical_block_exp = 0; in virtio_assume_iso9660()
141 vdev->config.blk.physical_block_exp = 0; in virtio_assume_eckd()
150 vdev->config.blk.geometry.heads = 15; in virtio_assume_eckd()
151 vdev->config.blk.geometry.sectors = in virtio_assume_eckd()
176 return vdev->config.blk.blk_size; in virtio_get_block_size()
189 return vdev->config.blk.geometry.heads; in virtio_get_heads()
192 ? vdev->config.blk.geometry.heads : 255; in virtio_get_heads()
203 return vdev->config.blk.geometry.sectors; in virtio_get_sectors()
206 ? vdev->config.blk.geometry.sectors : 63; in virtio_get_sectors()
[all …]
/qemu/hw/intc/
H A Dpnv_xive.c77 uint8_t blk = xive->chip->chip_id; in pnv_xive_block_id() local
84 return blk; in pnv_xive_block_id()
209 info->name, blk, idx); in pnv_xive_vst_addr_remote()
232 if (blk >= info->max_blocks) { in pnv_xive_vst_addr()
234 blk, info->name, idx); in pnv_xive_vst_addr()
238 vsd = xive->vsds[type][blk]; in pnv_xive_vst_addr()
722 xive_table = xive->blk; in pnv_xive_table_set_data()
800 xive->vsds[type][blk] = vsd; in pnv_xive_vst_set_exclusive()
893 xive->vsds[type][blk] = vsd; in pnv_xive_vst_set_data()
1443 uint8_t blk; in pnv_xive_ic_hw_trigger() local
[all …]
H A Dpnv_xive2.c84 uint8_t blk = xive->chip->chip_id; in pnv_xive2_block_id() local
91 return blk; in pnv_xive2_block_id()
216 if (blk >= info->max_blocks) { in pnv_xive2_vst_addr()
218 blk, info->name, idx); in pnv_xive2_vst_addr()
222 vsd = xive->vsds[type][blk]; in pnv_xive2_vst_addr()
226 xive = pnv_xive2_get_remote(blk); in pnv_xive2_vst_addr()
297 if (pnv_xive2_block_id(xive) != blk) { in pnv_xive2_get_pq()
630 xive->vsds[type][blk] = vsd; in pnv_xive2_vst_set_exclusive()
712 xive->vsds[type][blk] = vsd; in pnv_xive2_vst_set_data()
1450 uint8_t blk; in pnv_xive2_ic_hw_trigger() local
[all …]
/qemu/hw/misc/
H A Dsifive_u_otp.c64 if (s->blk) { in sifive_u_otp_read()
168 if (s->blk) { in sifive_u_otp_write()
199 DEFINE_PROP_DRIVE("drive", SiFiveUOTPState, blk),
217 BlockBackend *blk; in sifive_u_otp_realize() local
219 blk = blk_by_legacy_dinfo(dinfo); in sifive_u_otp_realize()
221 if (blk_getlength(blk) < filesize) { in sifive_u_otp_realize()
226 qdev_prop_set_drive_err(dev, "drive", blk, errp); in sifive_u_otp_realize()
228 if (s->blk) { in sifive_u_otp_realize()
231 ret = blk_set_perm(s->blk, perm, BLK_PERM_ALL, errp); in sifive_u_otp_realize()
250 if (s->blk) { in sifive_u_otp_realize()
[all …]
/qemu/block/export/
H A Dvirtio-blk-handler.c26 virtio_blk_sect_range_ok(BlockBackend *blk, uint32_t block_size, in virtio_blk_sect_range_ok() argument
45 blk_co_get_geometry(blk, &total_sectors); in virtio_blk_sect_range_ok()
56 BlockBackend *blk = handler->blk; in virtio_blk_discard_write_zeroes() local
90 if (unlikely(!virtio_blk_sect_range_ok(blk, handler->logical_block_size, in virtio_blk_discard_write_zeroes()
110 if (blk_co_pwrite_zeroes(blk, sector << VIRTIO_BLK_SECTOR_BITS, in virtio_blk_discard_write_zeroes()
123 if (blk_co_pdiscard(blk, sector << VIRTIO_BLK_SECTOR_BITS, in virtio_blk_discard_write_zeroes()
138 BlockBackend *blk = handler->blk; in virtio_blk_process_req() local
190 if (unlikely(!virtio_blk_sect_range_ok(blk, in virtio_blk_process_req()
200 ret = blk_co_pwritev(blk, offset, qiov.size, &qiov, 0); in virtio_blk_process_req()
202 ret = blk_co_preadv(blk, offset, qiov.size, &qiov, 0); in virtio_blk_process_req()
[all …]
H A Dexport.c81 BlockBackend *blk = NULL; in blk_exp_add() local
156 blk = blk_new(ctx, perm, BLK_PERM_ALL); in blk_exp_add()
159 blk_set_allow_aio_context_change(blk, true); in blk_exp_add()
162 ret = blk_insert_bs(blk, bs, errp); in blk_exp_add()
180 .blk = blk, in blk_exp_add()
188 assert(exp->blk != NULL); in blk_exp_add()
194 if (blk) { in blk_exp_add()
195 blk_set_dev_ops(blk, NULL, NULL); in blk_exp_add()
196 blk_unref(blk); in blk_exp_add()
219 blk_set_dev_ops(exp->blk, NULL, NULL); in blk_exp_delete_bh()
[all …]
H A Dfuse.c97 exp->common.ctx = blk_get_aio_context(exp->common.blk); in fuse_export_drained_end()
148 blk_set_disable_request_queuing(exp->common.blk, true); in fuse_export_create()
414 length = blk_getlength(exp->common.blk); in fuse_getattr()
480 ret_check = blk_set_perm(exp->common.blk, blk_perm, in fuse_do_truncate()
594 length = blk_getlength(exp->common.blk); in fuse_read()
610 ret = blk_pread(exp->common.blk, offset, size, buf, 0); in fuse_read()
645 length = blk_getlength(exp->common.blk); in fuse_write()
687 blk_len = blk_getlength(exp->common.blk); in fuse_fallocate()
758 ret = blk_pwrite_zeroes(exp->common.blk, in fuse_fallocate()
781 ret = blk_flush(exp->common.blk); in fuse_fsync()
[all …]
/qemu/hw/char/
H A Dipoctal232.c121 SCC2698Block blk[N_BLOCKS]; member
196 SCC2698Block *blk = &dev->blk[channel / 2]; in write_cr() local
270 SCC2698Block *blk = &dev->blk[block]; in io_read() local
271 uint8_t old_isr = blk->isr; in io_read()
309 ret = blk->isr; in io_read()
317 if (old_isr != blk->isr) { in io_read()
336 SCC2698Block *blk = &dev->blk[block]; in io_write() local
337 uint8_t old_isr = blk->isr; in io_write()
338 uint8_t old_imr = blk->imr; in io_write()
380 blk->imr = reg; in io_write()
[all …]
/qemu/hw/ppc/
H A Dpnv_pnor.c39 if (!s->blk || !blk_is_writable(s->blk)) { in pnv_pnor_update()
47 ret = blk_pwrite(s->blk, offset, offset_end - offset, s->storage + offset, in pnv_pnor_update()
86 if (s->blk) { in pnv_pnor_realize()
88 (blk_supports_write_perm(s->blk) ? BLK_PERM_WRITE : 0); in pnv_pnor_realize()
89 ret = blk_set_perm(s->blk, perm, BLK_PERM_ALL, errp); in pnv_pnor_realize()
94 s->size = blk_getlength(s->blk); in pnv_pnor_realize()
100 s->storage = blk_blockalign(s->blk, s->size); in pnv_pnor_realize()
102 if (blk_pread(s->blk, 0, s->size, s->storage, 0) < 0) { in pnv_pnor_realize()
117 DEFINE_PROP_DRIVE("drive", PnvPnor, blk),
/qemu/hw/ufs/
H A Dlu.c285 BlockBackend *blk = lu->conf.blk; in ufs_add_lu() local
286 int64_t brdv_len = blk_getlength(blk); in ufs_add_lu()
315 BlockBackend *blk = lu->conf.blk; in ufs_init_lu() local
332 if (!lu->conf.blk) { in ufs_lu_check_constraints()
351 blk_ref(blk); in ufs_init_scsi_device()
352 blk_detach_dev(blk, DEVICE(lu)); in ufs_init_scsi_device()
353 lu->conf.blk = NULL; in ufs_init_scsi_device()
376 blk_unref(blk); in ufs_init_scsi_device()
385 BlockBackend *blk = lu->conf.blk; in ufs_lu_realize() local
391 if (!blk) { in ufs_lu_realize()
[all …]
/qemu/hw/usb/
H A Ddev-storage-classic.c33 BlockBackend *blk = s->conf.blk; in usb_msd_storage_realize() local
36 if (!blk) { in usb_msd_storage_realize()
51 blk_ref(blk); in usb_msd_storage_realize()
52 blk_detach_dev(blk, DEVICE(s)); in usb_msd_storage_realize()
53 s->conf.blk = NULL; in usb_msd_storage_realize()
60 scsi_dev = scsi_bus_legacy_add_drive(&s->bus, blk, 0, !!s->removable, in usb_msd_storage_realize()
62 blk_unref(blk); in usb_msd_storage_realize()

123456789