0.11.0: VM configuration editor (cpu, memory, loader, graphics, switch, autostart)
This commit is contained in:
1 parent
f4160054ab
commit
02cb6b1079
7 files changed
+201
-2
No files matched your search
@@ -147,6 +147,26 @@ if (!function_exists('vmm_register_boot')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
function vmm_autostart_names(): array
|
||||
{
|
||||
$list = trim(vmm_rc_param('vm_list'));
|
||||
if ($list === '') {
|
||||
return [];
|
||||
}
|
||||
return preg_split('/\s+/', $list) ?: [];
|
||||
}
|
||||
|
||||
function vmm_autostart_set(string $name, bool $on): bool
|
||||
{
|
||||
$names = vmm_autostart_names();
|
||||
$names = array_values(array_filter($names, static fn($n) => $n !== $name));
|
||||
if ($on) {
|
||||
$names[] = $name;
|
||||
}
|
||||
vmm_set_rc_param('vm_list', implode(' ', $names));
|
||||
return true;
|
||||
}
|
||||
|
||||
function vmm_boot_state(): array
|
||||
{
|
||||
global $config;
|
||||
|
||||
Reference in new issue
Block a user