vm start: add warning about deprecated machine version

While there already is a warning from QEMU proper, that one is not
visible as a task warning and it's not straightforward to make it be
one, because QEMU is started inside a run_fork(). It's also more
future-proof to have the detection explicit on our side and the
documentation can be referenced.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2023-11-10 14:24:51 +01:00 committed by Thomas Lamprecht
parent e13a66c8f7
commit dec371d96c

View File

@ -6021,6 +6021,15 @@ sub vm_start_nolock {
PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'post-start'); PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'post-start');
my ($current_machine, $is_deprecated) =
PVE::QemuServer::Machine::get_current_qemu_machine($vmid);
if ($is_deprecated) {
log_warn(
"current machine version '$current_machine' is deprecated - see the documentation and ".
"change to a newer one",
);
}
return $res; return $res;
} }