Skip to content

libvirt: Set LC_ALL=C for virsh commands#286

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
tnk4on:fix/virsh-locale
Jun 23, 2026
Merged

libvirt: Set LC_ALL=C for virsh commands#286
cgwalters merged 1 commit into
bootc-dev:mainfrom
tnk4on:fix/virsh-locale

Conversation

@tnk4on

@tnk4on tnk4on commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Add LC_ALL=C to all virsh_command() helper functions so that virsh output is always in English regardless of system locale. Without this, state comparisons like state == "running" fail in non-English locales (e.g. Japanese returns "実行中").

Integration tests that call virsh dominfo directly are also updated to use LC_ALL=C.

Fixes: #285

The virsh_command() helpers did not set a locale, so virsh output was
localized in non-English environments. State comparisons like
`state == "running"` would fail because virsh returned the translated
string instead.

Set LC_ALL=C on all three virsh_command() functions and update the
integration tests that call virsh dominfo directly.

Assisted-by: Claude Code (Claude Opus 4.6)
Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
@tnk4on tnk4on changed the title fix(libvirt): force C locale for virsh commands to fix non-English locale failures libvirt: Set LC_ALL=C for virsh commands Jun 22, 2026

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I did a Poc of using libvirt via API bindings, would still make sense to do.

@cgwalters cgwalters enabled auto-merge (rebase) June 22, 2026 18:46
@cgwalters cgwalters merged commit f303938 into bootc-dev:main Jun 23, 2026
33 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libvirt commands fail in non-English locales due to localized virsh output

2 participants