Skip to content

bootc-host-setup: Keep the libvirt session daemon for the whole job - #3

Closed
cgwalters-bot wants to merge 1 commit into
mainfrom
bot/libvirt-session-daemon
Closed

cgwalters-bot wants to merge 1 commit into
mainfrom
bot/libvirt-session-daemon

Conversation

@cgwalters-bot

@cgwalters-bot cgwalters-bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

The libvirt client auto-spawns the qemu:///session daemon with --timeout=120, and a client that connects while that daemon exits on idle can fail with Failed to connect socket to '/run/user/1001/libvirt/libvirt-sock': No such file or directory (bootc-dev/bootc#1843). bcvk now retries in that case (bootc-dev/bcvk#394), but the pinned bcvk 0.19.0 doesn't.

This keeps one session daemon for the whole job: at the end of the Ubuntu host workarounds, bootc-host-setup (and so the deprecated bootc-ubuntu-setup) connects once, which spawns the daemon or reuses a running one, and turns off its idle timeout with virt-admin daemon-timeout --timeout 0. It runs after the QEMU install and the /dev/kvm permission change so the daemon probes the final capabilities. If virt-admin fails, setup only warns, since that just brings the race back. Note the daemon now keeps the environment of the setup step instead of the step that first used libvirt, and ps still shows its original --timeout=120. RHEL (virtqemud under dbus-run-session) is unchanged.

Testing, with a new check in Test virtualization setup that records the daemon's PID after setup and, at least 150s later with no libvirt calls in between, requires the same process and runs bcvk libvirt list (virsh list where bcvk isn't installed):

Generated-by: https://github.com/cgwalters/#llms


Review draft in cgwalters-forge, not upstream yet. This section is removed when the PR is opened upstream.

  • Upstream: bootc-dev/actions, base main
  • Board item: PVTI_lADOE9oHIs4BlJLczg9zlXk
  • Fork CI: only test-virtualization.yml, opted in on this fork

To review:

  • Approve, or comment /promote on a line of its own, to open it upstream, ready for review. Either covers only the commits pushed so far.
  • If upstream requires DCO, approving also signs off: promote adds Signed-off-by: Colin Walters <walters@verbum.org> to the commits lacking it (the bot's and yours; anyone else's only if you ask), with you as committer.
  • Add a /draft line (in the same comment or before) to open it upstream as a draft (/ready undoes that).
  • Close to drop it.
  • Edit the title and description freely: they become the upstream PR's. Review comments are squashed into the commits they concern, with a reply here.

bcvk and bootc CI intermittently fail with "Failed to connect socket
to '/run/user/1001/libvirt/libvirt-sock': No such file or directory"
(bootc-dev/bootc#1843). The libvirt client auto-spawns the session
daemon with --timeout=120; when it exits on idle it removes its socket
before it releases its pidfile, and a client connecting in between
spawns a daemon that exits at once and then gives up after five
seconds. It shows up right after test steps that went two minutes
without touching libvirt.

bcvk now retries in that case (bootc-dev/bcvk#394), but a daemon that
never idles out avoids the window entirely, including for the pinned
bcvk release. Rather than starting a daemon by hand, connect once (which
spawns it, or reuses one that is already running) and turn off its idle
timeout with virt-admin, so this works whichever daemon the client
picked and is safe to run twice.

The test workflow now checks that the daemon is still the same process
well past 120 idle seconds and that bcvk can talk to it.

Generated-by: AI
@cgwalters-bot
cgwalters-bot force-pushed the bot/libvirt-session-daemon branch from 344ac7e to 0f46eed Compare October 2, 2026 12:22
@cgwalters-bot cgwalters-bot changed the title bootc-ubuntu-setup: Start the libvirt session daemon without idle timeout bootc-host-setup: Keep the libvirt session daemon for the whole job Oct 2, 2026
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

Two calls for you before promoting:

  1. If virt-admin fails, setup now only warns (the race just comes back) instead of failing every consumer; the test workflow here still fails in that case. Say if you would rather it fail hard.
  2. RHEL is left out: its virsh runs under dbus-run-session, and a daemon kept alive from inside one would hold a dead bus address. It needs its own design if wanted (bcvk#394 covers it client-side meanwhile).

Generated-by: https://github.com/cgwalters/#llms

@cgwalters

Copy link
Copy Markdown

Nah let's just get the bcvk released which fixes this then ensure we prioritize bumping to that version

@cgwalters cgwalters closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants