Use serial instead of SCSI ID for USB devices#784
Open
Wescoeur wants to merge 1 commit intoxapi-project:masterfrom
Open
Use serial instead of SCSI ID for USB devices#784Wescoeur wants to merge 1 commit intoxapi-project:masterfrom
Wescoeur wants to merge 1 commit intoxapi-project:masterfrom
Conversation
Adding SRs on multiple usb devices may fail because /usr/lib/udev/scsi_id returns the same device id for all the usb devices. This change fixes this by checking the drive type and using the device serial number if correctly read. Signed-off-by: Frederic Bor <frederic.bor@wanadoo.fr> Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
95b214b to
578f7ff
Compare
MarkSymsCtx
requested changes
Jan 21, 2026
Contributor
MarkSymsCtx
left a comment
There was a problem hiding this comment.
There should be some unit test coverage of this code , both positive and ngative, to ensure that it remains working in the future. This is a use case more likely to be important to xcp-ng and so the system testing performed by XenServer may not detect regressions here.
|
|
||
|
|
||
| def is_usb_device(device): | ||
| cmd = ["udevadm", "info", "-q", "path", "-n", device] |
Contributor
There was a problem hiding this comment.
It is preferred to use absolute paths to system commands.
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.
Adding SRs on multiple usb devices may fail because /usr/lib/udev/scsi_id returns the same device id for all the usb devices.
This change fixes this by checking the drive type and using the device serial number if correctly read.