Better logging + runVM impl
This commit is contained in:
parent
b905244626
commit
a63030fd00
7 changed files with 192 additions and 74 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"unicode"
|
||||
)
|
||||
|
|
@ -13,3 +14,12 @@ func ClearUnprintableChars(s string) string {
|
|||
return -1
|
||||
}, s)
|
||||
}
|
||||
|
||||
var devNameRegexp = regexp.MustCompile("^[0-9a-z_-]+$")
|
||||
|
||||
func ValidateDevName(s string) bool {
|
||||
// Allow mapped devices.
|
||||
s = strings.TrimPrefix(s, "mapper/")
|
||||
|
||||
return devNameRegexp.MatchString(s)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue