fix: use enable-patchelf to fix libvirt_iohelper missing shared libra…#180
Merged
hemanthnakkina merged 1 commit intoApr 29, 2026
Conversation
…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>
gboutry
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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