Details
-
Improvement
-
Resolution: Fixed
-
Minor
-
None
-
None
-
9223372036854775807
Description
As discussed on gerrit comments, llapi_getname() is hard to use.
v2_12_0-RC3-2-gcd294a1255 added this comment that explains the problem:
/* * We want to turn testfs-clilov-ffff88002738bc00 into * testfs-ffff88002738bc00 in a portable way that doesn't depend * on what is after "-clilov-" as it may change in the future. * Unfortunately, the "fsname" part may contain a dash, so we * can't just skip to the first dash, and the "instance" may be a * UUID in the future, so we can't necessarily go to the last dash. */
so the string returned by llapi_getname() can contain dashes in the fsname now and might contain dashes in the instance part later on, meaning that users who need either just the fsname or just the instance will be troubled to split the string again if necessary.
I had misread Andreas' comment as that llapi_getname() was new with v2_12_53-6-g2a4821b836 and its API could be changed but llapi_getname() itself is fairly old and we probably do not want to change it, so I assume we should at least fix print_instance to use strrchr instead of strchr for now.
Ideally I'd want some version of llapi_getname where we could add an argument saying we want either one, the other or both informations in the returned string, or maybe have it also return the position of the beginning of the instance so the user could split it themselves if required? But I do not see how to change that cleanly without adding yet another hardly used function, so I do not think this is a good idea anymore.
Happy to provide a patch either way if you tell me where we want to go, this also is fairly simple.
Thanks,
–
Dominique
Attachments
Issue Links
- is related to
-
LU-11803 sanity test 255c fails with 'Ladvise test 12, bad lock count, returned 1, actual 0'
- Resolved
-
LU-12473 pool_list by path incorrectly prints path as pool prefix
- Resolved
-
LU-13118 change client instance to respect ASLR
- Open
-
LU-12159 allow lfs getname to only print fsname
- Resolved