runtime: unify generated config

We don't need to maintain two generated config.go and even have
duplicates between them.

Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao
2021-09-14 13:47:17 +08:00
parent 4f7cc18622
commit e7c42fbc76
16 changed files with 114 additions and 131 deletions

View File

@@ -1343,7 +1343,7 @@ func checkHypervisorConfig(config vc.HypervisorConfig) error {
func GetDefaultConfigFilePaths() []string {
return []string{
// normally below "/etc"
defaultSysConfRuntimeConfiguration,
DEFAULTSYSCONFRUNTIMECONFIGURATION,
// normally below "/usr/share"
defaultRuntimeConfiguration,
@@ -1371,7 +1371,7 @@ func getDefaultConfigFile() (string, error) {
// SetConfigOptions will override some of the defaults settings.
func SetConfigOptions(n, runtimeConfig, sysRuntimeConfig string) {
if n != "" {
name = n
NAME = n
}
if runtimeConfig != "" {
@@ -1379,6 +1379,6 @@ func SetConfigOptions(n, runtimeConfig, sysRuntimeConfig string) {
}
if sysRuntimeConfig != "" {
defaultSysConfRuntimeConfiguration = sysRuntimeConfig
DEFAULTSYSCONFRUNTIMECONFIGURATION = sysRuntimeConfig
}
}