/openbmc/qemu/util/ |
H A D | iov.c | 286 void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint) in qemu_iovec_init() argument 288 qiov->iov = g_new(struct iovec, alloc_hint); in qemu_iovec_init() 289 qiov->niov = 0; in qemu_iovec_init() 290 qiov->nalloc = alloc_hint; in qemu_iovec_init() 291 qiov->size = 0; in qemu_iovec_init() 294 void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov) in qemu_iovec_init_external() argument 298 qiov->iov = iov; in qemu_iovec_init_external() 299 qiov->niov = niov; in qemu_iovec_init_external() 300 qiov->nalloc = -1; in qemu_iovec_init_external() 301 qiov->size = 0; in qemu_iovec_init_external() [all …]
|
/openbmc/qemu/include/qemu/ |
H A D | iov.h | 236 static inline void qemu_iovec_init_buf(QEMUIOVector *qiov, in qemu_iovec_init_buf() argument 239 *qiov = (QEMUIOVector) QEMU_IOVEC_INIT_BUF(*qiov, buf, len); in qemu_iovec_init_buf() 242 static inline void *qemu_iovec_buf(QEMUIOVector *qiov) in qemu_iovec_buf() argument 245 assert(qiov->nalloc == -1 && qiov->iov == &qiov->local_iov); in qemu_iovec_buf() 247 return qiov->local_iov.iov_base; in qemu_iovec_buf() 250 void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint); 251 void qemu_iovec_init_external(QEMUIOVector *qiov, struct iovec *iov, int niov); 252 void qemu_iovec_init_slice(QEMUIOVector *qiov, QEMUIOVector *source, 254 struct iovec *qemu_iovec_slice(QEMUIOVector *qiov, 257 int qemu_iovec_subvec_niov(QEMUIOVector *qiov, size_t offset, size_t len); [all …]
|
/openbmc/qemu/block/ |
H A D | win32-aio.c | 53 QEMUIOVector *qiov; member 75 qemu_iovec_memset(waiocb->qiov, count, 0, in win32_aio_process_completion() 76 waiocb->qiov->size - count); in win32_aio_process_completion() 85 QEMUIOVector *qiov = waiocb->qiov; in win32_aio_process_completion() local 86 iov_from_buf(qiov->iov, qiov->niov, 0, waiocb->buf, qiov->size); in win32_aio_process_completion() 116 uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, in win32_aio_submit() argument 124 waiocb->qiov = qiov; in win32_aio_submit() 127 if (qiov->niov > 1) { in win32_aio_submit() 128 waiocb->buf = qemu_try_blockalign(bs, qiov->size); in win32_aio_submit() 133 iov_to_buf(qiov->iov, qiov->niov, 0, waiocb->buf, qiov->size); in win32_aio_submit() [all …]
|
H A D | io_uring.c | 33 QEMUIOVector *qiov; member 91 remaining = luringcb->qiov->size - luringcb->total_read; in luring_resubmit_short_read() 96 qemu_iovec_init(resubmit_qiov, luringcb->qiov->niov); in luring_resubmit_short_read() 100 qemu_iovec_concat(resubmit_qiov, luringcb->qiov, luringcb->total_read, in luring_resubmit_short_read() 187 } else if (!luringcb->qiov) { in luring_process_completions() 189 } else if (total_bytes == luringcb->qiov->size) { in luring_process_completions() 200 qemu_iovec_memset(luringcb->qiov, total_bytes, 0, in luring_process_completions() 201 luringcb->qiov->size - total_bytes); in luring_process_completions() 345 io_uring_prep_writev(sqes, fd, luringcb->qiov->iov, in luring_do_submit() 346 luringcb->qiov->niov, offset); in luring_do_submit() [all …]
|
H A D | blklogwrites.c | 336 QEMUIOVector *qiov, BdrvRequestFlags flags) in blk_log_writes_co_preadv() argument 338 return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); in blk_log_writes_co_preadv() 346 QEMUIOVector *qiov; member 353 QEMUIOVector *qiov; member 376 const uint64_t qiov_aligned_size = ROUND_UP(lr->qiov->size, s->sectorsize); in blk_log_writes_co_do_log() 391 lr->log_ret = bdrv_co_pwritev(s->log_file, entry_offset, lr->qiov->size, in blk_log_writes_co_do_log() 392 lr->qiov, 0); in blk_log_writes_co_do_log() 413 QEMUIOVector qiov; in blk_log_writes_co_do_log() local 442 qemu_iovec_init(&qiov, 2); in blk_log_writes_co_do_log() 443 qemu_iovec_add(&qiov, &super, sizeof(super)); in blk_log_writes_co_do_log() [all …]
|
H A D | blkverify.c | 44 QEMUIOVector *qiov; /* user I/O vector */ member 174 r->ret = r->request_fn(s->test_file, r->offset, r->bytes, r->qiov, in blkverify_do_test_req() 197 uint64_t bytes, QEMUIOVector *qiov, QEMUIOVector *raw_qiov, in blkverify_co_prwv() argument 207 .qiov = qiov, in blkverify_co_prwv() 233 QEMUIOVector *qiov, BdrvRequestFlags flags) in blkverify_co_preadv() argument 241 buf = qemu_blockalign(bs->file->bs, qiov->size); in blkverify_co_preadv() 242 qemu_iovec_init(&raw_qiov, qiov->niov); in blkverify_co_preadv() 243 qemu_iovec_clone(&raw_qiov, qiov, buf); in blkverify_co_preadv() 245 ret = blkverify_co_prwv(bs, &r, offset, bytes, qiov, &raw_qiov, in blkverify_co_preadv() 248 cmp_offset = qemu_iovec_compare(qiov, &raw_qiov); in blkverify_co_preadv() [all …]
|
H A D | linux-aio.c | 45 QEMUIOVector *qiov; member 91 qemu_iovec_memset(laiocb->qiov, ret, 0, in qemu_laio_process_completion() 92 laiocb->qiov->size - ret); in qemu_laio_process_completion() 375 QEMUIOVector *qiov = laiocb->qiov; in laio_do_submit() local 379 io_prep_pwritev(iocbs, fd, qiov->iov, qiov->niov, offset); in laio_do_submit() 382 io_prep_pwritev(iocbs, fd, qiov->iov, qiov->niov, offset); in laio_do_submit() 385 io_prep_preadv(iocbs, fd, qiov->iov, qiov->niov, offset); in laio_do_submit() 411 int coroutine_fn laio_co_submit(int fd, uint64_t offset, QEMUIOVector *qiov, in laio_co_submit() argument 418 .nbytes = qiov ? qiov->size : 0, in laio_co_submit() 422 .qiov = qiov, in laio_co_submit()
|
H A D | io.c | 812 QEMUIOVector *qiov, size_t qiov_offset, in bdrv_check_qiov_request() argument 848 if (!qiov) { in bdrv_check_qiov_request() 856 if (qiov_offset > qiov->size) { in bdrv_check_qiov_request() 858 qiov_offset, qiov->size); in bdrv_check_qiov_request() 862 if (bytes > qiov->size - qiov_offset) { in bdrv_check_qiov_request() 864 "vector size(%zu)", bytes, qiov_offset, qiov->size); in bdrv_check_qiov_request() 877 QEMUIOVector *qiov, size_t qiov_offset) in bdrv_check_request32() argument 879 int ret = bdrv_check_qiov_request(offset, bytes, qiov, qiov_offset, NULL); in bdrv_check_request32() 975 QEMUIOVector *qiov, size_t qiov_offset, int flags) in bdrv_driver_preadv() argument 984 bdrv_check_qiov_request(offset, bytes, qiov, qiov_offset, &error_abort); in bdrv_driver_preadv() [all …]
|
H A D | quorum.c | 106 QEMUIOVector qiov; member 126 QEMUIOVector *qiov; /* calling IOV */ member 165 QEMUIOVector *qiov, in quorum_aio_get() argument 179 .qiov = qiov, in quorum_aio_get() 288 acb->qiov, acb->flags & ~BDRV_REQ_WRITE_UNCHANGED); in quorum_rewrite_entry() 389 QEMUIOVector *qiov = &acb->qcrs[i].qiov; in quorum_compute_hash() local 397 qiov->iov, qiov->niov, in quorum_compute_hash() 526 quorum = quorum_compare(acb, &acb->qcrs[i].qiov, &acb->qcrs[j].qiov); in quorum_vote() 534 quorum_copy_qiov(acb->qiov, &acb->qcrs[i].qiov); in quorum_vote() 563 quorum_copy_qiov(acb->qiov, &acb->qcrs[winner->index].qiov); in quorum_vote() [all …]
|
H A D | copy-on-read.c | 136 QEMUIOVector *qiov, size_t qiov_offset, in cor_co_preadv_part() argument 145 return bdrv_co_preadv_part(bs->file, offset, bytes, qiov, qiov_offset, in cor_co_preadv_part() 170 ret = bdrv_co_preadv_part(bs->file, offset, n, qiov, qiov_offset, in cor_co_preadv_part() 188 QEMUIOVector *qiov, size_t qiov_offset, in cor_co_pwritev_part() argument 191 return bdrv_co_pwritev_part(bs->file, offset, bytes, qiov, qiov_offset, in cor_co_pwritev_part() 213 QEMUIOVector *qiov) in cor_co_pwritev_compressed() argument 215 return bdrv_co_pwritev(bs->file, offset, bytes, qiov, in cor_co_pwritev_compressed()
|
H A D | nvme.c | 1038 QEMUIOVector *qiov) in nvme_cmd_unmap_qiov() argument 1043 s->dma_map_count -= qiov->size; in nvme_cmd_unmap_qiov() 1055 NVMeRequest *req, QEMUIOVector *qiov) in nvme_cmd_map_qiov() argument 1063 assert(qiov->size); in nvme_cmd_map_qiov() 1064 assert(QEMU_IS_ALIGNED(qiov->size, s->page_size)); in nvme_cmd_map_qiov() 1065 assert(qiov->size / s->page_size <= s->page_size / sizeof(uint64_t)); in nvme_cmd_map_qiov() 1066 for (i = 0; i < qiov->niov; ++i) { in nvme_cmd_map_qiov() 1069 size_t len = QEMU_ALIGN_UP(qiov->iov[i].iov_len, in nvme_cmd_map_qiov() 1073 qiov->iov[i].iov_base, in nvme_cmd_map_qiov() 1117 for (j = 0; j < qiov->iov[i].iov_len / s->page_size; j++) { in nvme_cmd_map_qiov() [all …]
|
H A D | qed.c | 891 qed_read_backing_file(BDRVQEDState *s, uint64_t pos, QEMUIOVector *qiov) in qed_read_backing_file() argument 895 return bdrv_co_preadv(s->bs->backing, pos, qiov->size, qiov, 0); in qed_read_backing_file() 897 qemu_iovec_memset(qiov, 0, 0, qiov->size); in qed_read_backing_file() 913 QEMUIOVector qiov; in qed_copy_from_backing_file() local 921 qemu_iovec_init_buf(&qiov, qemu_blockalign(s->bs, len), len); in qed_copy_from_backing_file() 923 ret = qed_read_backing_file(s, pos, &qiov); in qed_copy_from_backing_file() 930 ret = bdrv_co_pwritev(s->bs->file, offset, qiov.size, &qiov, 0); in qed_copy_from_backing_file() 936 qemu_vfree(qemu_iovec_buf(&qiov)); in qed_copy_from_backing_file() 979 qemu_vfree(acb->qiov->iov[0].iov_base); in qed_aio_complete() 980 acb->qiov->iov[0].iov_base = NULL; in qed_aio_complete() [all …]
|
H A D | block-backend.c | 1317 QEMUIOVector *qiov, size_t qiov_offset, in blk_co_do_preadv_part() argument 1344 ret = bdrv_co_preadv_part(blk->root, offset, bytes, qiov, qiov_offset, in blk_co_do_preadv_part() 1353 QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); in blk_co_pread() local 1358 return blk_co_preadv(blk, offset, bytes, &qiov, flags); in blk_co_pread() 1362 int64_t bytes, QEMUIOVector *qiov, in blk_co_preadv() argument 1369 ret = blk_co_do_preadv_part(blk, offset, bytes, qiov, 0, flags); in blk_co_preadv() 1376 int64_t bytes, QEMUIOVector *qiov, in blk_co_preadv_part() argument 1383 ret = blk_co_do_preadv_part(blk, offset, bytes, qiov, qiov_offset, flags); in blk_co_preadv_part() 1392 QEMUIOVector *qiov, size_t qiov_offset, in blk_co_do_pwritev_part() argument 1422 ret = bdrv_co_pwritev_part(blk->root, offset, bytes, qiov, qiov_offset, in blk_co_do_pwritev_part() [all …]
|
H A D | nbd.c | 492 QEMUIOVector *qiov) in nbd_co_send_request() argument 533 if (qiov) { in nbd_co_send_request() 536 if (rc >= 0 && qio_channel_writev_all(s->ioc, qiov->iov, qiov->niov, in nbd_co_send_request() 581 QEMUIOVector *qiov, Error **errp) in nbd_parse_offset_hole_payload() argument 595 if (!hole_size || offset < orig_offset || hole_size > qiov->size || in nbd_parse_offset_hole_payload() 596 offset > orig_offset + qiov->size - hole_size) { in nbd_parse_offset_hole_payload() 606 qemu_iovec_memset(qiov, offset - orig_offset, 0, hole_size); in nbd_parse_offset_hole_payload() 758 QEMUIOVector *qiov, Error **errp) in nbd_co_receive_offset_data_payload() argument 781 if (offset < orig_offset || data_size > qiov->size || in nbd_co_receive_offset_data_payload() 782 offset > orig_offset + qiov->size - data_size) { in nbd_co_receive_offset_data_payload() [all …]
|
H A D | raw-format.c | 211 QEMUIOVector *qiov, BdrvRequestFlags flags) in raw_co_preadv() argument 221 return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); in raw_co_preadv() 226 QEMUIOVector *qiov, BdrvRequestFlags flags) in raw_co_pwritev() argument 247 ret = qemu_iovec_to_buf(qiov, 0, buf, 512); in raw_co_pwritev() 261 qemu_iovec_init(&local_qiov, qiov->niov + 1); in raw_co_pwritev() 263 qemu_iovec_concat(&local_qiov, qiov, 512, qiov->size - 512); in raw_co_pwritev() 264 qiov = &local_qiov; in raw_co_pwritev() 275 ret = bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags); in raw_co_pwritev() 278 if (qiov == &local_qiov) { in raw_co_pwritev() 338 raw_co_zone_append(BlockDriverState *bs,int64_t *offset, QEMUIOVector *qiov, in raw_co_zone_append() argument [all …]
|
H A D | throttle.c | 120 QEMUIOVector *qiov, BdrvRequestFlags flags) in throttle_co_preadv() argument 126 return bdrv_co_preadv(bs->file, offset, bytes, qiov, flags); in throttle_co_preadv() 131 QEMUIOVector *qiov, BdrvRequestFlags flags) in throttle_co_pwritev() argument 136 return bdrv_co_pwritev(bs->file, offset, bytes, qiov, flags); in throttle_co_pwritev() 160 int64_t bytes, QEMUIOVector *qiov) in throttle_co_pwritev_compressed() argument 162 return throttle_co_pwritev(bs, offset, bytes, qiov, in throttle_co_pwritev_compressed()
|
H A D | filter-compress.c | 69 QEMUIOVector *qiov, size_t qiov_offset, in compress_co_preadv_part() argument 72 return bdrv_co_preadv_part(bs->file, offset, bytes, qiov, qiov_offset, in compress_co_preadv_part() 79 QEMUIOVector *qiov, size_t qiov_offset, in compress_co_pwritev_part() argument 82 return bdrv_co_pwritev_part(bs->file, offset, bytes, qiov, qiov_offset, in compress_co_pwritev_part()
|
/openbmc/qemu/migration/ |
H A D | channel-block.c | 60 QEMUIOVector qiov; in qio_channel_block_readv() local 63 qemu_iovec_init_external(&qiov, (struct iovec *)iov, niov); in qio_channel_block_readv() 64 ret = bdrv_readv_vmstate(bioc->bs, &qiov, bioc->offset); in qio_channel_block_readv() 70 bioc->offset += qiov.size; in qio_channel_block_readv() 71 return qiov.size; in qio_channel_block_readv() 85 QEMUIOVector qiov; in qio_channel_block_writev() local 88 qemu_iovec_init_external(&qiov, (struct iovec *)iov, niov); in qio_channel_block_writev() 89 ret = bdrv_writev_vmstate(bioc->bs, &qiov, bioc->offset); in qio_channel_block_writev() 95 bioc->offset += qiov.size; in qio_channel_block_writev() 96 return qiov.size; in qio_channel_block_writev()
|
/openbmc/qemu/include/block/ |
H A D | block_int-io.h | 39 int64_t offset, int64_t bytes, QEMUIOVector *qiov, size_t qiov_offset); 48 int64_t offset, int64_t bytes, QEMUIOVector *qiov, 52 QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags); 54 int64_t offset, int64_t bytes, QEMUIOVector *qiov, 58 QEMUIOVector *qiov, size_t qiov_offset, BdrvRequestFlags flags); 63 QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); in bdrv_co_pread() local 67 return bdrv_co_preadv(child, offset, bytes, &qiov, flags); in bdrv_co_pread() 73 QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); in bdrv_co_pwrite() local 77 return bdrv_co_pwritev(child, offset, bytes, &qiov, flags); in bdrv_co_pwrite()
|
H A D | block_int-common.h | 499 int64_t offset, int64_t bytes, QEMUIOVector *qiov, 503 int64_t offset, int64_t bytes, QEMUIOVector *qiov, 514 int64_t sector_num, int nb_sectors, QEMUIOVector *qiov); 532 int64_t offset, int64_t bytes, QEMUIOVector *qiov, 537 QEMUIOVector *qiov, size_t qiov_offset, 541 int64_t sector_num, int nb_sectors, QEMUIOVector *qiov, 559 BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, 562 BlockDriverState *bs, int64_t offset, int64_t bytes, QEMUIOVector *qiov, 653 QEMUIOVector *qiov, size_t qiov_offset); 722 QEMUIOVector *qiov); [all …]
|
/openbmc/qemu/include/sysemu/ |
H A D | block-backend-io.h | 42 QEMUIOVector *qiov, BdrvRequestFlags flags, 45 QEMUIOVector *qiov, BdrvRequestFlags flags, 57 QEMUIOVector *qiov, BdrvRequestFlags flags, 145 int64_t bytes, QEMUIOVector *qiov, 148 int64_t bytes, QEMUIOVector *qiov, 152 int64_t bytes, QEMUIOVector *qiov, 156 int64_t bytes, QEMUIOVector *qiov, 166 int64_t bytes, QEMUIOVector *qiov, 169 int64_t bytes, QEMUIOVector *qiov, 173 int64_t bytes, QEMUIOVector *qiov, [all …]
|
/openbmc/qemu/block/export/ |
H A D | virtio-blk-handler.c | 173 QEMUIOVector qiov; in virtio_blk_process_req() local 185 qemu_iovec_init_external(&qiov, out_iov, out_num); in virtio_blk_process_req() 187 qemu_iovec_init_external(&qiov, in_iov, in_num); in virtio_blk_process_req() 192 sector_num, qiov.size))) { 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()
|
/openbmc/qemu/ |
H A D | qemu-io-cmds.c | 496 create_iovec(BlockBackend *blk, QEMUIOVector *qiov, char **argv, int nr_iov, in create_iovec() argument 531 qemu_iovec_init(qiov, nr_iov); in create_iovec() 536 qemu_iovec_add(qiov, p, sizes[i]); in create_iovec() 644 static int do_aio_readv(BlockBackend *blk, QEMUIOVector *qiov, in do_aio_readv() argument 649 blk_aio_preadv(blk, offset, qiov, flags, aio_rw_done, &async_ret); in do_aio_readv() 654 *total = qiov->size; in do_aio_readv() 658 static int do_aio_writev(BlockBackend *blk, QEMUIOVector *qiov, in do_aio_writev() argument 663 blk_aio_pwritev(blk, offset, qiov, flags, aio_rw_done, &async_ret); in do_aio_writev() 668 *total = qiov->size; in do_aio_writev() 915 QEMUIOVector qiov; in readv_f() local [all …]
|
/openbmc/qemu/tests/unit/ |
H A D | test-replication.c | 57 QEMUIOVector qiov; in test_blk_read() local 73 qemu_iovec_init(&qiov, 1); in test_blk_read() 74 qemu_iovec_add(&qiov, pattern_buf, count); in test_blk_read() 76 blk_aio_preadv(blk, offset, &qiov, 0, blk_rw_done, &async_ret); in test_blk_read() 93 qemu_iovec_destroy(&qiov); in test_blk_read() 100 QEMUIOVector qiov; in test_blk_write() local 110 qemu_iovec_init(&qiov, 1); in test_blk_write() 111 qemu_iovec_add(&qiov, pattern_buf, count); in test_blk_write() 113 blk_aio_pwritev(blk, offset, &qiov, 0, blk_rw_done, &async_ret); in test_blk_write() 125 qemu_iovec_destroy(&qiov); in test_blk_write()
|
H A D | test-block-iothread.c | 37 QEMUIOVector *qiov, in bdrv_test_co_preadv() argument 45 QEMUIOVector *qiov, in bdrv_test_co_pwritev() argument 145 QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, sizeof(buf)); in test_sync_op_blk_preadv() local 149 ret = blk_preadv(blk, 0, sizeof(buf), &qiov, 0); in test_sync_op_blk_preadv() 153 ret = blk_preadv(blk, -2, sizeof(buf), &qiov, 0); in test_sync_op_blk_preadv() 160 QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, sizeof(buf)); in test_sync_op_blk_pwritev() local 164 ret = blk_pwritev(blk, 0, sizeof(buf), &qiov, 0); in test_sync_op_blk_pwritev() 168 ret = blk_pwritev(blk, -2, sizeof(buf), &qiov, 0); in test_sync_op_blk_pwritev() 175 QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, sizeof(buf)); in test_sync_op_blk_preadv_part() local 179 ret = blk_preadv_part(blk, 0, sizeof(buf), &qiov, 0, 0); in test_sync_op_blk_preadv_part() [all …]
|