修复了一些已知问题

This commit is contained in:
MengMengCode
2026-07-18 21:16:29 +08:00
parent 2324494dd7
commit f28117bc5e
6 changed files with 200 additions and 45 deletions
+15
View File
@@ -223,6 +223,13 @@ func normalizeStoragePools() bool {
if pool.MountPoint == "." {
pool.MountPoint = ""
}
if pool.MountPoint != "" {
managedPath := managedStoragePoolPath(pool.MountPoint)
if pool.Path != managedPath {
pool.Path = managedPath
changed = true
}
}
if pool.ID == "" {
pool.ID = storagePoolIDFromName(pool.Name, pool.Path)
changed = true
@@ -264,6 +271,14 @@ func normalizeStoragePools() bool {
return changed
}
func managedStoragePoolPath(mountPoint string) string {
mountPoint = filepath.Clean(strings.TrimSpace(mountPoint))
if mountPoint == string(os.PathSeparator) {
return filepath.Join(string(os.PathSeparator), "var", "lib", "clicd")
}
return filepath.Join(mountPoint, "clicd")
}
func storagePoolIDFromName(name, path string) string {
base := strings.ToLower(strings.TrimSpace(name))
if base == "" {