Capture client init errors in qemu_driver without io_uring too #151

Open
koolkhel wants to merge 1 commits from koolkhel/vitastor:qemu-nouring-exit into master
Contributor

Description

qemu_driver passes client_exit_on_error=0 only when it creates the client with io_uring. When io_uring isn't available (seccomp profile, kernel.io_uring_disabled, old kernel) it falls back to vitastor_c_create_qemu(), which takes no options, so an initialization error (for example an unreachable etcd) still calls exit(1) and kills the whole QEMU process, for example on a disk hot-plug into a running VM.

This adds vitastor_c_create_qemu_json(), which takes the same option list as vitastor_c_create_uring_json(), and uses it in the fallback path (VITASTOR_C_API_VERSION 7). A driver built against an older library keeps calling vitastor_c_create_qemu().

One behaviour difference in the fallback path: it now gets its options from the same string list as the io_uring path. The vitastor: filename syntax stores use-rdma, rdma-gid-index and rdma-mtu as integers, and that list doesn't pick integers up (qdict_get_try_str), so in the fallback path they are no longer read. The io_uring path already ignores them the same way.

Tested: the same patch in our downstream tree, QEMU 8.2.2 running with io_uring_setup() failing with ENOSYS (seccomp filter). blockdev-add of a disk with an etcd address that refuses connections returns a QMP error and QEMU keeps running; the same image then opens with the right address, blockdev-del and quit work. Without the patch QEMU exits with code 1 on that blockdev-add.

Contributor Name

Yury Luneff (MIND Software LLC, https://mindsw.io)

CLA

### Description qemu_driver passes `client_exit_on_error=0` only when it creates the client with io_uring. When io_uring isn't available (seccomp profile, `kernel.io_uring_disabled`, old kernel) it falls back to `vitastor_c_create_qemu()`, which takes no options, so an initialization error (for example an unreachable etcd) still calls `exit(1)` and kills the whole QEMU process, for example on a disk hot-plug into a running VM. This adds `vitastor_c_create_qemu_json()`, which takes the same option list as `vitastor_c_create_uring_json()`, and uses it in the fallback path (`VITASTOR_C_API_VERSION` 7). A driver built against an older library keeps calling `vitastor_c_create_qemu()`. One behaviour difference in the fallback path: it now gets its options from the same string list as the io_uring path. The `vitastor:` filename syntax stores `use-rdma`, `rdma-gid-index` and `rdma-mtu` as integers, and that list doesn't pick integers up (`qdict_get_try_str`), so in the fallback path they are no longer read. The io_uring path already ignores them the same way. Tested: the same patch in our downstream tree, QEMU 8.2.2 running with `io_uring_setup()` failing with ENOSYS (seccomp filter). `blockdev-add` of a disk with an etcd address that refuses connections returns a QMP error and QEMU keeps running; the same image then opens with the right address, `blockdev-del` and `quit` work. Without the patch QEMU exits with code 1 on that `blockdev-add`. ### Contributor Name Yury Luneff (MIND Software LLC, https://mindsw.io) ### CLA - [x] I accept Vitastor CLA agreement: https://git.yourcmc.ru/vitalif/vitastor/src/branch/master/CLA-en.md
koolkhel added 1 commit 2026-11-22 20:32:30 +03:00
qemu_driver passes client_exit_on_error=0 only when it creates the
client with io_uring. When io_uring isn't available (seccomp profile,
kernel.io_uring_disabled, old kernel) it falls back to
vitastor_c_create_qemu(), which takes no options, so an initialization
error (for example an unreachable etcd) still calls exit(1) and kills
the whole QEMU process, for example on a disk hot-plug into a running
VM.

Add vitastor_c_create_qemu_json() which takes the same option list as
vitastor_c_create_uring_json() and use it in the fallback path
(VITASTOR_C_API_VERSION 7).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u qemu-nouring-exit:koolkhel-qemu-nouring-exit
git checkout koolkhel-qemu-nouring-exit
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vitalif/vitastor#151
No description provided.