[pve-devel] [PATCH qemu-server] cfg2cmd: turn smm off when SeaBIOS and serial display are used

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Nov 5 14:12:16 CET 2021


On 05.11.21 14:06, Fabian Ebner wrote:
> Since commit 277d33454f77ec1d1e0bc04e37621e4dd2424b67 in pve-qemu,
> smm=off is no longer the default, but with SeaBIOS and serial display,
> this can lead to a boot loop.
> 
> Reported in the community forum [0] and reproduced with a Debian 10
> VM.
> 
> [0]: https://forum.proxmox.com/threads/pve-7-0-all-vms-with-cloud-init-seabios-fail-during-boot-process-bootloop-disk-not-found.97310/post-427129
> 
> Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
> ---
>  PVE/QemuServer.pm                    | 12 ++++++++++
>  test/cfg2cmd/seabios_serial.conf     | 16 ++++++++++++++
>  test/cfg2cmd/seabios_serial.conf.cmd | 33 ++++++++++++++++++++++++++++
>  3 files changed, 61 insertions(+)
>  create mode 100644 test/cfg2cmd/seabios_serial.conf
>  create mode 100644 test/cfg2cmd/seabios_serial.conf.cmd
> 
> diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
> index 763c412..9b76512 100644
> --- a/PVE/QemuServer.pm
> +++ b/PVE/QemuServer.pm
> @@ -3403,6 +3403,16 @@ my sub get_cpuunits {
>      my ($conf) = @_;
>      return $conf->{cpuunits} // (PVE::CGroup::cgroup_mode() == 2 ? 100 : 1024);
>  }
> +
> +# Since commit 277d33454f77ec1d1e0bc04e37621e4dd2424b67 in pve-qemu, smm is not off by default
> +# anymore. But smm=off seems to be required when using SeaBIOS and serial display.
> +my sub should_disable_smm {
> +    my ($conf, $vga) = @_;
> +
> +    return (!defined($conf->{bios}) || $conf->{bios} eq 'seabios') &&
> +	$vga->{type} && $vga->{type} =~ m/^serial\d+$/;
> +}
> +
>  sub config_to_command {
>      my ($storecfg, $vmid, $conf, $defaults, $forcemachine, $forcecpu,
>          $pbs_backing) = @_;
> @@ -4002,6 +4012,8 @@ sub config_to_command {
>  	push @$machineFlags, 'accel=tcg';
>      }
>  
> +    push @$machineFlags, 'smm=off' if should_disable_smm($conf, $vga);

doesn't that breaks live migration or do we know that it could never work with smm=on
under seabios + display=serial, so that there can no running VM that could be live
migrated?





More information about the pve-devel mailing list