diff options
author | Kevin Wolf <kwolf@redhat.com> | 2017-06-26 14:57:27 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-06-26 14:57:27 +0200 |
commit | 704e41ba789ad88158f051eee648d7087beffac7 (patch) | |
tree | eb0666929a0bb50eec2b6c6e69151919691ff3f7 /include | |
parent | c5f1ad429cdf26023cf331075a7d327708e3db6d (diff) | |
parent | 2a245709099e98bca638694c182f1e5627567df7 (diff) | |
download | qemu-704e41ba789ad88158f051eee648d7087beffac7.zip qemu-704e41ba789ad88158f051eee648d7087beffac7.tar.gz qemu-704e41ba789ad88158f051eee648d7087beffac7.tar.bz2 |
Merge remote-tracking branch 'mreitz/tags/pull-block-2017-06-26' into queue-block
Block patches for the block queue
# gpg: Signature made Mon Jun 26 14:56:24 2017 CEST
# gpg: using RSA key 0xF407DB0061D5CF40
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40
* mreitz/tags/pull-block-2017-06-26:
qemu-img: don't shadow opts variable in img_dd()
block: Do not strcmp() with NULL uri->scheme
blkverify: Catch bs->exact_filename overflow
blkdebug: Catch bs->exact_filename overflow
fix: avoid an infinite loop or a dangling pointer problem in img_commit
block: change variable names in BlockDriverState
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block.h | 8 | ||||
-rw-r--r-- | include/block/block_int.h | 6 | ||||
-rw-r--r-- | include/block/blockjob.h | 18 | ||||
-rw-r--r-- | include/sysemu/block-backend.h | 20 |
4 files changed, 35 insertions, 17 deletions
diff --git a/include/block/block.h b/include/block/block.h index 623e7fc..85e4be7 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -276,7 +276,7 @@ int bdrv_read(BdrvChild *child, int64_t sector_num, int bdrv_write(BdrvChild *child, int64_t sector_num, const uint8_t *buf, int nb_sectors); int bdrv_pwrite_zeroes(BdrvChild *child, int64_t offset, - int count, BdrvRequestFlags flags); + int bytes, BdrvRequestFlags flags); int bdrv_make_zero(BdrvChild *child, BdrvRequestFlags flags); int bdrv_pread(BdrvChild *child, int64_t offset, void *buf, int bytes); int bdrv_preadv(BdrvChild *child, int64_t offset, QEMUIOVector *qiov); @@ -295,7 +295,7 @@ int coroutine_fn bdrv_co_writev(BdrvChild *child, int64_t sector_num, * because it may allocate memory for the entire region. */ int coroutine_fn bdrv_co_pwrite_zeroes(BdrvChild *child, int64_t offset, - int count, BdrvRequestFlags flags); + int bytes, BdrvRequestFlags flags); BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, const char *backing_file); int bdrv_get_backing_file_depth(BlockDriverState *bs); @@ -411,8 +411,8 @@ void bdrv_drain_all(void); } \ waited_; }) -int bdrv_pdiscard(BlockDriverState *bs, int64_t offset, int count); -int bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, int count); +int bdrv_pdiscard(BlockDriverState *bs, int64_t offset, int bytes); +int bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, int bytes); int bdrv_has_zero_init_1(BlockDriverState *bs); int bdrv_has_zero_init(BlockDriverState *bs); bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs); diff --git a/include/block/block_int.h b/include/block/block_int.h index 7489700..15fa602 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -142,7 +142,7 @@ struct BlockDriver { BlockAIOCB *(*bdrv_aio_flush)(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *(*bdrv_aio_pdiscard)(BlockDriverState *bs, - int64_t offset, int count, + int64_t offset, int bytes, BlockCompletionFunc *cb, void *opaque); int coroutine_fn (*bdrv_co_readv)(BlockDriverState *bs, @@ -163,9 +163,9 @@ struct BlockDriver { * will be called instead. */ int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs, - int64_t offset, int count, BdrvRequestFlags flags); + int64_t offset, int bytes, BdrvRequestFlags flags); int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs, - int64_t offset, int count); + int64_t offset, int bytes); /* * Building block for bdrv_block_status[_above]. The driver should diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 09c7c69..67c0968 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -321,6 +321,24 @@ void block_job_iostatus_reset(BlockJob *job); BlockJobTxn *block_job_txn_new(void); /** + * block_job_ref: + * + * Add a reference to BlockJob refcnt, it will be decreased with + * block_job_unref, and then be freed if it comes to be the last + * reference. + */ +void block_job_ref(BlockJob *job); + +/** + * block_job_unref: + * + * Release a reference that was previously acquired with block_job_ref + * or block_job_create. If it's the last reference to the object, it will be + * freed. + */ +void block_job_unref(BlockJob *job); + +/** * block_job_txn_unref: * * Release a reference that was previously acquired with block_job_txn_add_job diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index 999eb23..1e05281 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -130,7 +130,7 @@ BlockBackend *blk_by_dev(void *dev); BlockBackend *blk_by_qdev_id(const char *id, Error **errp); void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaque); int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *buf, - int count); + int bytes); int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); @@ -138,13 +138,13 @@ int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); int blk_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int count, BdrvRequestFlags flags); + int bytes, BdrvRequestFlags flags); BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int count, BdrvRequestFlags flags, + int bytes, BdrvRequestFlags flags, BlockCompletionFunc *cb, void *opaque); int blk_make_zero(BlockBackend *blk, BdrvRequestFlags flags); -int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int count); -int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int count, +int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int bytes); +int blk_pwrite(BlockBackend *blk, int64_t offset, const void *buf, int bytes, BdrvRequestFlags flags); int64_t blk_getlength(BlockBackend *blk); void blk_get_geometry(BlockBackend *blk, uint64_t *nb_sectors_ptr); @@ -157,7 +157,7 @@ BlockAIOCB *blk_aio_pwritev(BlockBackend *blk, int64_t offset, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *blk_aio_flush(BlockBackend *blk, BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int count, +BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int bytes, BlockCompletionFunc *cb, void *opaque); void blk_aio_cancel(BlockAIOCB *acb); void blk_aio_cancel_async(BlockAIOCB *acb); @@ -165,7 +165,7 @@ int blk_co_ioctl(BlockBackend *blk, unsigned long int req, void *buf); int blk_ioctl(BlockBackend *blk, unsigned long int req, void *buf); BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned long int req, void *buf, BlockCompletionFunc *cb, void *opaque); -int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int count); +int blk_co_pdiscard(BlockBackend *blk, int64_t offset, int bytes); int blk_co_flush(BlockBackend *blk); int blk_flush(BlockBackend *blk); int blk_commit_all(void); @@ -220,11 +220,11 @@ int blk_get_open_flags_from_root_state(BlockBackend *blk); void *blk_aio_get(const AIOCBInfo *aiocb_info, BlockBackend *blk, BlockCompletionFunc *cb, void *opaque); int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, - int count, BdrvRequestFlags flags); + int bytes, BdrvRequestFlags flags); int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, - int count); + int bytes); int blk_truncate(BlockBackend *blk, int64_t offset, Error **errp); -int blk_pdiscard(BlockBackend *blk, int64_t offset, int count); +int blk_pdiscard(BlockBackend *blk, int64_t offset, int bytes); int blk_save_vmstate(BlockBackend *blk, const uint8_t *buf, int64_t pos, int size); int blk_load_vmstate(BlockBackend *blk, uint8_t *buf, int64_t pos, int size); |