fix(core): add libvirt patch for USB startupPolicy in containers#2432
Merged
Conversation
8724900 to
bf557f9
Compare
fd65c11 to
56064f3
Compare
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
e1b3a01 to
c772e3c
Compare
diafour
reviewed
Jun 2, 2026
diafour
reviewed
Jun 2, 2026
diafour
previously approved these changes
Jun 3, 2026
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
Signed-off-by: Yaroslav Borbat <yaroslav.borbat@flant.com>
e4ac9e2 to
cdb4025
Compare
diafour
approved these changes
Jun 3, 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.
Description
Add a libvirt patch (
005-usb-startup-policy-in-containers.patch) that fixesstartupPolicy='optional'for USB hostdev in containerized environments.The patch adds a
virFileExistscheck on the device node path invirUSBDeviceSearchafter sysfs discovery. If the/dev/bus/usb/node is missing, the device is skipped so that callers see an empty result and handle the absence gracefully.See also:
Why do we need it, and what problem does it solve?
In containers, sysfs (
/sys/bus/usb/devices/) is mounted from the host kernel and exposes all USB devices regardless of mount namespace isolation. This causes libvirt'svirUSBDeviceSearchto report a device as available even when the corresponding/dev/bus/usb/node is not present in the container's mount namespace.As a result,
startupPolicy='optional'does not remove the missing USB hostdev from the domain XML during incoming migration, and QEMU fails to start with:This breaks VM live migration when USB devices are attached via hotplug and the target node does not yet have the device node mounted into the virt-launcher pod.
What is the expected result?
startupPolicy='optional'.Checklist
Changelog entries