aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2025-11-11 00:41:52 +0000
committerWarner Losh <imp@FreeBSD.org>2025-11-11 00:56:11 +0000
commitd18ed8e19c3cb264340987bdc191615108d8413a (patch)
tree4d4bee0df9d83f16b5404515dd4c0919749ebb01 /stand
parent3deb21f1afd5c4abfd9cb93ca120097a841536c5 (diff)
Diffstat (limited to 'stand')
-rw-r--r--stand/common/disk.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/stand/common/disk.c b/stand/common/disk.c
index c1650f0fa1ec..47f882d5a532 100644
--- a/stand/common/disk.c
+++ b/stand/common/disk.c
@@ -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