Skip to content

fix: use enable-patchelf to fix libvirt_iohelper missing shared libra…#180

Merged
hemanthnakkina merged 1 commit into
canonical:stable/2024.1from
hemanthnakkina:server-suspend-stable/2024.1
Apr 29, 2026
Merged

fix: use enable-patchelf to fix libvirt_iohelper missing shared libra…#180
hemanthnakkina merged 1 commit into
canonical:stable/2024.1from
hemanthnakkina:server-suspend-stable/2024.1

Conversation

@hemanthnakkina
Copy link
Copy Markdown
Collaborator

@hemanthnakkina hemanthnakkina commented Apr 29, 2026

…ries

libvirt_iohelper is spawned by virFileWrapperFdNew() with a minimal environment containing only LIBVIRT_LOG_OUTPUTS=1:stderr. The parent libvirtd's LD_LIBRARY_PATH is never propagated to the child, so staged shared libraries (libxml2, libyajl, libicuuc, etc.) in usr/lib/x86_64-linux-gnu/ are not found, causing server suspend to fail:

operation failed: .../libvirt_iohelper: error while loading shared
libraries: libxml2.so.2: cannot open shared object file: No such
file or directory

Fix by adding build-attributes: [enable-patchelf] to the libvirt part. Snapcraft sets RPATH (old DT_RPATH tag, not RUNPATH) with $ORIGIN on libvirt-built ELF files, enabling the dynamic linker to locate staged libraries transitively — without requiring a build-time patchelf script.

Fixes: https://bugs.launchpad.net/snap-openstack/+bug/2150555

Assisted-by: Claude:claude-4.6-sonnet

…ries

libvirt_iohelper is spawned by virFileWrapperFdNew() with a minimal
environment containing only LIBVIRT_LOG_OUTPUTS=1:stderr. The parent
libvirtd's LD_LIBRARY_PATH is never propagated to the child, so staged
shared libraries (libxml2, libyajl, libicuuc, etc.) in
usr/lib/x86_64-linux-gnu/ are not found, causing server suspend to fail:

   operation failed: .../libvirt_iohelper: error while loading shared
   libraries: libxml2.so.2: cannot open shared object file: No such
   file or directory

Fix by adding build-attributes: [enable-patchelf] to the libvirt part.
Snapcraft sets RPATH (old DT_RPATH tag, not RUNPATH) with $ORIGIN on
libvirt-built ELF files, enabling the dynamic linker to locate staged
libraries transitively — without requiring a build-time patchelf script.

Tested: suspend, resume, pause, unpause, snapshot, shelve, unshelve,
resize, cold migrate, live-migrate all pass.

Fixes: https://bugs.launchpad.net/snap-openstack/+bug/2150555

Assisted-by: Claude:claude-4.6-sonnet
Signed-off-by: Hemanth Nakkina <hemanth.nakkina@canonical.com>
@hemanthnakkina hemanthnakkina requested a review from gboutry April 29, 2026 09:46
@hemanthnakkina hemanthnakkina merged commit 293bdab into canonical:stable/2024.1 Apr 29, 2026
3 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.

2 participants