Use the epoll-based client in qemu_driver when io_uring isn't available #151
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:qemu-nouring-exit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Without io_uring (seccomp profile,
kernel.io_uring_disabled, old kernel) qemu_driver falls back tovitastor_c_create_qemu(), which registers every OSD socket in QEMU's AioContext. Two problems come from that:client_exit_on_error=0. A client start error (for example an unreachable etcd) callsexit(1)and ends the whole QEMU process, for example on a disk hot-plug into a running VM.This makes the fallback create the client with
vitastor_c_create_epoll_json()from the same option list as the io_uring path, and register only its epoll descriptor (vitastor_c_epoll_get_fd()) in the AioContext, withvitastor_c_epoll_handle_events(proxy, 0)as the read handler. The descriptor goes through the code the io_uring eventfd already uses: registration, close and attach/detach of the AioContext. There is no change in the C API.Details:
VITASTOR_C_API_VERSION3 keeps callingvitastor_c_create_qemu(). The function stays in the library.cluster_client_t::flush()waits for the flush only when it has a ring loop.vitastor:filename syntax storesuse-rdma,rdma-gid-indexandrdma-mtuas integers, and that list doesn't pick integers up (qdict_get_try_str), so in the fallback they are no longer read. The io_uring path already ignores them the same way.Tested: the same driver change in our downstream tree (library with
e4a7e9bfandb88e2ea6), QEMU 8.2.2 running withio_uring_setup()failing with ENOSYS (seccomp filter), old fallback and new fallback on the same library:qemu-io)blockdev-addwith an etcd address that refuses connectionsx-blockdev-set-iothreadto an iothread and back, with I/O before, between and afterContributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
ebd9122190to6b28914352Capture client init errors in qemu_driver without io_uring tooto Use the epoll-based client in qemu_driver when io_uring isn't available