diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/io.c | 12 | ||||
-rw-r--r-- | block/nfs.c | 1 | ||||
-rw-r--r-- | block/sheepdog.c | 3 |
3 files changed, 16 insertions, 0 deletions
diff --git a/block/io.c b/block/io.c index 6fc0145864..be0d862ca6 100644 --- a/block/io.c +++ b/block/io.c @@ -474,9 +474,21 @@ void bdrv_inc_in_flight(BlockDriverState *bs) atomic_inc(&bs->in_flight); } +static void dummy_bh_cb(void *opaque) +{ +} + +void bdrv_wakeup(BlockDriverState *bs) +{ + if (bs->wakeup) { + aio_bh_schedule_oneshot(qemu_get_aio_context(), dummy_bh_cb, NULL); + } +} + void bdrv_dec_in_flight(BlockDriverState *bs) { atomic_dec(&bs->in_flight); + bdrv_wakeup(bs); } static bool coroutine_fn wait_serialising_requests(BdrvTrackedRequest *self) diff --git a/block/nfs.c b/block/nfs.c index 7474fbc7cc..88c60a9118 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -505,6 +505,7 @@ nfs_get_allocated_file_size_cb(int ret, struct nfs_context *nfs, void *data, error_report("NFS Error: %s", nfs_get_error(nfs)); } task->complete = 1; + bdrv_wakeup(task->bs); } static int64_t nfs_get_allocated_file_size(BlockDriverState *bs) diff --git a/block/sheepdog.c b/block/sheepdog.c index 16a5c1c28d..1fb917343a 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -702,6 +702,9 @@ out: srco->ret = ret; srco->finished = true; + if (srco->bs) { + bdrv_wakeup(srco->bs); + } } /* |