mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
aio: remove aio_disable_external() API
All callers now pass is_external=false to aio_set_fd_handler() and aio_set_event_notifier(). The aio_disable_external() API that temporarily disables fd handlers that were registered is_external=true is therefore dead code. Remove aio_disable_external(), aio_enable_external(), and the is_external arguments to aio_set_fd_handler() and aio_set_event_notifier(). The entire test-fdmon-epoll test is removed because its sole purpose was testing aio_disable_external(). Parts of this patch were generated using the following coccinelle (https://coccinelle.lip6.fr/) semantic patch: @@ expression ctx, fd, is_external, io_read, io_write, io_poll, io_poll_ready, opaque; @@ - aio_set_fd_handler(ctx, fd, is_external, io_read, io_write, io_poll, io_poll_ready, opaque) + aio_set_fd_handler(ctx, fd, io_read, io_write, io_poll, io_poll_ready, opaque) @@ expression ctx, notifier, is_external, io_read, io_poll, io_poll_ready; @@ - aio_set_event_notifier(ctx, notifier, is_external, io_read, io_poll, io_poll_ready) + aio_set_event_notifier(ctx, notifier, io_read, io_poll, io_poll_ready) Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20230516190238.8401-21-stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
03d7162a21
commit
60f782b6b7
36 changed files with 80 additions and 298 deletions
|
@ -84,7 +84,7 @@ static void fuse_export_drained_begin(void *opaque)
|
|||
FuseExport *exp = opaque;
|
||||
|
||||
aio_set_fd_handler(exp->common.ctx,
|
||||
fuse_session_fd(exp->fuse_session), false,
|
||||
fuse_session_fd(exp->fuse_session),
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
exp->fd_handler_set_up = false;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ static void fuse_export_drained_end(void *opaque)
|
|||
exp->common.ctx = blk_get_aio_context(exp->common.blk);
|
||||
|
||||
aio_set_fd_handler(exp->common.ctx,
|
||||
fuse_session_fd(exp->fuse_session), false,
|
||||
fuse_session_fd(exp->fuse_session),
|
||||
read_from_fuse_export, NULL, NULL, NULL, exp);
|
||||
exp->fd_handler_set_up = true;
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ static int setup_fuse_export(FuseExport *exp, const char *mountpoint,
|
|||
g_hash_table_insert(exports, g_strdup(mountpoint), NULL);
|
||||
|
||||
aio_set_fd_handler(exp->common.ctx,
|
||||
fuse_session_fd(exp->fuse_session), false,
|
||||
fuse_session_fd(exp->fuse_session),
|
||||
read_from_fuse_export, NULL, NULL, NULL, exp);
|
||||
exp->fd_handler_set_up = true;
|
||||
|
||||
|
@ -320,7 +320,7 @@ static void fuse_export_shutdown(BlockExport *blk_exp)
|
|||
|
||||
if (exp->fd_handler_set_up) {
|
||||
aio_set_fd_handler(exp->common.ctx,
|
||||
fuse_session_fd(exp->fuse_session), false,
|
||||
fuse_session_fd(exp->fuse_session),
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
exp->fd_handler_set_up = false;
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ static void vduse_blk_enable_queue(VduseDev *dev, VduseVirtq *vq)
|
|||
}
|
||||
|
||||
aio_set_fd_handler(vblk_exp->export.ctx, vduse_queue_get_fd(vq),
|
||||
false, on_vduse_vq_kick, NULL, NULL, NULL, vq);
|
||||
on_vduse_vq_kick, NULL, NULL, NULL, vq);
|
||||
/* Make sure we don't miss any kick afer reconnecting */
|
||||
eventfd_write(vduse_queue_get_fd(vq), 1);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ static void vduse_blk_disable_queue(VduseDev *dev, VduseVirtq *vq)
|
|||
return;
|
||||
}
|
||||
|
||||
aio_set_fd_handler(vblk_exp->export.ctx, fd, false,
|
||||
aio_set_fd_handler(vblk_exp->export.ctx, fd,
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ static void on_vduse_dev_kick(void *opaque)
|
|||
static void vduse_blk_attach_ctx(VduseBlkExport *vblk_exp, AioContext *ctx)
|
||||
{
|
||||
aio_set_fd_handler(vblk_exp->export.ctx, vduse_dev_get_fd(vblk_exp->dev),
|
||||
false, on_vduse_dev_kick, NULL, NULL, NULL,
|
||||
on_vduse_dev_kick, NULL, NULL, NULL,
|
||||
vblk_exp->dev);
|
||||
|
||||
/* Virtqueues are handled by vduse_blk_drained_end() */
|
||||
|
@ -179,7 +179,7 @@ static void vduse_blk_attach_ctx(VduseBlkExport *vblk_exp, AioContext *ctx)
|
|||
static void vduse_blk_detach_ctx(VduseBlkExport *vblk_exp)
|
||||
{
|
||||
aio_set_fd_handler(vblk_exp->export.ctx, vduse_dev_get_fd(vblk_exp->dev),
|
||||
false, NULL, NULL, NULL, NULL, NULL);
|
||||
NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
/* Virtqueues are handled by vduse_blk_drained_begin() */
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ static int vduse_blk_exp_create(BlockExport *exp, BlockExportOptions *opts,
|
|||
vduse_dev_setup_queue(vblk_exp->dev, i, queue_size);
|
||||
}
|
||||
|
||||
aio_set_fd_handler(exp->ctx, vduse_dev_get_fd(vblk_exp->dev), false,
|
||||
aio_set_fd_handler(exp->ctx, vduse_dev_get_fd(vblk_exp->dev),
|
||||
on_vduse_dev_kick, NULL, NULL, NULL, vblk_exp->dev);
|
||||
|
||||
blk_add_aio_context_notifier(exp->blk, blk_aio_attached, blk_aio_detach,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue