- Check if 'slice' argument was given.
- Check if disk isn't already the mirror component.
This commit is contained in:
parent
f251dfbf5d
commit
ff9160f5f3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132908
@ -121,6 +121,10 @@ g_mirror_ctl_configure(struct gctl_req *req, struct g_class *mp)
|
||||
balance = balance_id(balancep);
|
||||
}
|
||||
slicep = gctl_get_paraml(req, "slice", sizeof(*slicep));
|
||||
if (slicep == NULL) {
|
||||
gctl_error(req, "No '%s' argument.", "slice");
|
||||
return;
|
||||
}
|
||||
if (*slicep == -1)
|
||||
slice = sc->sc_slice;
|
||||
else
|
||||
@ -298,6 +302,10 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_class *mp)
|
||||
}
|
||||
if (strncmp(name, "/dev/", strlen("/dev/")) == 0)
|
||||
name += strlen("/dev/");
|
||||
if (g_mirror_find_disk(sc, name) != NULL) {
|
||||
gctl_error(req, "Provider %s already inserted.", name);
|
||||
continue;
|
||||
}
|
||||
pp = g_provider_by_name(name);
|
||||
if (pp == NULL) {
|
||||
gctl_error(req, "Unknown provider %s.", name);
|
||||
|
Loading…
Reference in New Issue
Block a user