qemu-patch-raspberry4/include/block
Vladimir Sementsov-Ogievskiy e75abedab7 block: use int64_t instead of uint64_t in driver write handlers
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.

Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.

We chose signed type, to be consistent with off_t (which is signed) and
with possibility for signed return type (where negative value means
error).

So, convert driver write handlers parameters which are already 64bit to
signed type.

While being here, convert also flags parameter to be BdrvRequestFlags.

Now let's consider all callers. Simple

  git grep '\->bdrv_\(aio\|co\)_pwritev\(_part\)\?'

shows that's there three callers of driver function:

 bdrv_driver_pwritev() and bdrv_driver_pwritev_compressed() in
 block/io.c, both pass int64_t, checked by bdrv_check_qiov_request() to
 be non-negative.

 qcow2_save_vmstate() does bdrv_check_qiov_request().

Still, the functions may be called directly, not only by drv->...
Let's check:

git grep '\.bdrv_\(aio\|co\)_pwritev\(_part\)\?\s*=' | \
awk '{print $4}' | sed 's/,//' | sed 's/&//' | sort | uniq | \
while read func; do git grep "$func(" | \
grep -v "$func(BlockDriverState"; done

shows several callers:

qcow2:
  qcow2_co_truncate() write at most up to @offset, which is checked in
    generic qcow2_co_truncate() by bdrv_check_request().
  qcow2_co_pwritev_compressed_task() pass the request (or part of the
    request) that already went through normal write path, so it should
    be OK

qcow:
  qcow_co_pwritev_compressed() pass int64_t, it's updated by this patch

quorum:
  quorum_co_pwrite_zeroes() pass int64_t and int - OK

throttle:
  throttle_co_pwritev_compressed() pass int64_t, it's updated by this
  patch

vmdk:
  vmdk_co_pwritev_compressed() pass int64_t, it's updated by this
  patch

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210903102807.27127-5-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2021-09-29 13:46:31 -05:00
..
accounting.h block: add empty account cookie type 2019-10-10 10:56:18 +02:00
aio-wait.h qemu/atomic.h: rename atomic_ to qatomic_ 2020-09-23 16:07:44 +01:00
aio.h iothread: add aio-max-batch parameter 2021-07-21 13:47:50 +01:00
aio_task.h block: introduce aio task pool 2019-10-10 10:56:17 +02:00
block-copy.h block/block-copy: block_copy_state_new(): drop extra arguments 2021-09-01 14:38:08 +02:00
block-hmp-cmds.h monitor/hmp: move hmp_info_block* to block-hmp-cmds.c 2020-03-09 18:20:21 +00:00
block.h block: introduce bdrv_replace_child_bs() 2021-09-01 12:57:31 +02:00
block_backup.h block/backup: drop unused synchronization interface 2018-12-14 11:52:40 +01:00
block_int.h block: use int64_t instead of uint64_t in driver write handlers 2021-09-29 13:46:31 -05:00
blockjob.h blockjob: return status from block_job_set_speed() 2021-03-08 15:14:15 -06:00
blockjob_int.h blockjob: add set_speed to BlockJobDriver 2021-01-26 14:36:37 +01:00
dirty-bitmap.h block: remove dirty bitmaps 'status' field 2021-03-18 09:22:55 +00:00
export.h block/export: Move blk to BlockExport 2020-10-02 15:46:40 +02:00
fuse.h fuse: Allow exporting BDSs via FUSE 2020-12-11 17:52:39 +01:00
nbd.h nbd/client-connection: add option for non-blocking connection attempt 2021-06-18 12:21:22 -05:00
nvme.h hw/nvme: fix verification of select field in namespace attachment 2021-09-24 08:43:52 +02:00
qapi.h qapi: Allow getting flat output from 'query-named-block-nodes' 2020-02-20 16:43:42 +01:00
qdict.h vl: plumb keyval-based options into -readconfig 2021-06-04 13:50:04 +02:00
raw-aio.h block/io_uring: implements interfaces for io_uring 2020-01-30 20:59:41 +00:00
replication.h replication: move include out of root directory 2021-05-26 14:49:46 +02:00
snapshot.h block: rename and alter bdrv_all_find_snapshot semantics 2021-02-08 11:19:51 +00:00
thread-pool.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
throttle-groups.h block/throttle-groups: throttle_group_co_io_limits_intercept(): 64bit bytes 2021-02-03 08:14:00 -06:00
write-threshold.h write-threshold: deal with includes 2021-05-14 16:14:10 +02:00