-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CA-402814: rationalise canonicalisation of device path #202
base: release/xs8
Are you sure you want to change the base?
Conversation
Signed-off-by: Mark Syms <mark.syms@cloud.com>
BST has been successfully completed in XenRT. It didn't address the original issue that popped this up as that turned out to be a configuration issue on a host in XenRT claiming to have disks that it did not have. That was resulting in errors like this
which is hardly surprising given the mangling in the path. |
I think this patch is fixing a problem, introducing another. |
If I remember, there are some devices (ccsis ??) that have a slash inside the path, something like |
That name came from the answerfile supplied by XenRT, in the particular failure case the device, and symlink, didn't actually exist and so we got this garbage. Using realpath should be resolving this to "physical". We can add the replace back in after that is completed and before we take basename is we think there are devices with these characteristics. |
I found some reference in # /dev/cciss : c[0-7]d[0-15]: Compaq Next Generation Drive Array
# /dev/ida : c[0-7]d[0-15]: Compaq Intelligent Drive Array
# /dev/rd : c[0-7]d[0-31]: Mylex DAC960 PCI RAID controller We could possibly find some of these arrays in the lab to have a test. What do you mean by
I mean, your code with |
I mean that on the host that was misconfigured, so that the answerfile said the guest SR device was
that disk wasn't installed so the symlink didn't exist. The code didn't check that it existed or use realpath to resolve it. It would probably be a good idea to add an
in this (and related parts). |
Rationalise how the dev path is canonicalized to the /sys/ path using realpath and basename.
The if was redundant as the first line of the method prepends /dev/ if it missing.
(this is same as #201 but targeting the release/xs8 branch)