Delete functions that no product code calls, and fold "simple plus WithOptions" pairs into the one signature callers actually use. Rename the live macOS lifecycle functions that were labelled Legacy. The architecture tests now share one source loader and reject functions without a product caller and catalog messages nobody reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
740 B
Go
34 lines
740 B
Go
package datamigrate
|
|
|
|
import (
|
|
"github.com/Nwflower/reims-go/internal/driver"
|
|
"github.com/Nwflower/reims-go/internal/plugin"
|
|
)
|
|
|
|
func migrateVMRefSettingsState(st *plugin.StateFile) bool {
|
|
changed := false
|
|
for _, rec := range st.Plugins {
|
|
if rec == nil {
|
|
continue
|
|
}
|
|
for key, values := range rec.VMSettings {
|
|
if _, ok := driver.ParseVMRef(key); ok {
|
|
continue
|
|
}
|
|
newKey := driver.NewVMRef(driver.BuiltinReimsMacOSDriverID, key).Key()
|
|
if current, ok := rec.VMSettings[newKey]; ok {
|
|
for k, v := range values {
|
|
if _, exists := current[k]; !exists {
|
|
current[k] = v
|
|
}
|
|
}
|
|
} else {
|
|
rec.VMSettings[newKey] = values
|
|
}
|
|
delete(rec.VMSettings, key)
|
|
changed = true
|
|
}
|
|
}
|
|
return changed
|
|
}
|