diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2021-02-12 22:27:47 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2021-02-12 22:27:47 +0000 |
commit | abb8b29aff352f226bf91cb59e5ac7e3e6082ce8 (patch) | |
tree | 6128f8abe8437d1870dba2bf1eb048460887dd25 /include | |
parent | eac92d316351b855ba79eb374dd21cc367f1f9c1 (diff) | |
parent | 594427fc56758cb944a85914eefe722cc2c667b8 (diff) |
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2021-02-12' into staging
nbd patches for 2021-02-12
- let qemu-nbd handle larger backlog of connecting clients
- fix a few NBD-related iotest failures
- add block cancellation hook for faster response to NBD failures
# gpg: Signature made Fri 12 Feb 2021 19:57:56 GMT
# gpg: using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg: aka "[jpeg image of size 6874]" [full]
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A
* remotes/ericb/tags/pull-nbd-2021-02-12:
iotests/264: add backup-cancel test-case
block/backup: implement .cancel job handler
iotests/264: add mirror-cancel test-case
iotests.py: qemu_nbd_popen: remove pid file after use
iotests/264: move to python unittest
block/mirror: implement .cancel job handler
job: add .cancel handler for the driver
block/raw-format: implement .bdrv_cancel_in_flight handler
block/nbd: implement .bdrv_cancel_in_flight
block: add new BlockDriver handler: bdrv_cancel_in_flight
io: error_prepend() in qio_channel_readv_full_all() causes segfault
iotests/210: Fix reference output
qemu-nbd: Permit --shared=0 for unlimited clients
qemu-nbd: Use SOMAXCONN for socket listen() backlog
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block.h | 3 | ||||
-rw-r--r-- | include/block/block_int.h | 9 | ||||
-rw-r--r-- | include/qemu/job.h | 5 |
3 files changed, 17 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h index 0a9f2c187c..2f2698074e 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -849,4 +849,7 @@ int coroutine_fn bdrv_co_copy_range(BdrvChild *src, int64_t src_offset, BdrvChild *dst, int64_t dst_offset, int64_t bytes, BdrvRequestFlags read_flags, BdrvRequestFlags write_flags); + +void bdrv_cancel_in_flight(BlockDriverState *bs); + #endif diff --git a/include/block/block_int.h b/include/block/block_int.h index 22a2789d35..88e4111939 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -353,6 +353,15 @@ struct BlockDriver { int64_t *map, BlockDriverState **file); /* + * This informs the driver that we are no longer interested in the result + * of in-flight requests, so don't waste the time if possible. + * + * One example usage is to avoid waiting for an nbd target node reconnect + * timeout during job-cancel. + */ + void (*bdrv_cancel_in_flight)(BlockDriverState *bs); + + /* * Invalidate any cached meta-data. */ void coroutine_fn (*bdrv_co_invalidate_cache)(BlockDriverState *bs, diff --git a/include/qemu/job.h b/include/qemu/job.h index 32aabb1c60..efc6fa7544 100644 --- a/include/qemu/job.h +++ b/include/qemu/job.h @@ -251,6 +251,11 @@ struct JobDriver { */ void (*clean)(Job *job); + /** + * If the callback is not NULL, it will be invoked in job_cancel_async + */ + void (*cancel)(Job *job); + /** Called when the job is freed */ void (*free)(Job *job); |