mirror of
https://git.freebsd.org/src.git
synced 2026-01-16 23:02:24 +00:00
stand: Try to parse vdisk correctly
PR: 289306 Sponsored by: Netflix Reviewed by: dab MFC After: 5 days Differential Revision: https://reviews.freebsd.org/D52500
This commit is contained in:
parent
3deb21f1af
commit
d18ed8e19c
1 changed files with 12 additions and 1 deletions
|
|
@ -417,7 +417,18 @@ disk_parsedev(struct devdesc **idev, const char *devspec, const char **path)
|
|||
char *cp;
|
||||
struct disk_devdesc *dev;
|
||||
|
||||
np = devspec + 4; /* Skip the leading 'disk' */
|
||||
/*
|
||||
* disk names look approximately like:
|
||||
* v?disk([0-9]+(p[0-9]+|s[a-z])?)?:
|
||||
* so skip over the initial bit. We don't have access to the devsw
|
||||
* to check the name.
|
||||
*/
|
||||
if (strncmp(devspec, "disk", 4) == 0)
|
||||
np = devspec + 4;
|
||||
else if (strncmp(devspec, "vdisk", 5) == 0)
|
||||
np = devspec + 5;
|
||||
else
|
||||
return (EINVAL);
|
||||
unit = -1;
|
||||
/*
|
||||
* If there is path/file info after the device info, then any missing
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue