On 06.10.20 15:32, Stefan Reiter wrote:
> @@ -3213,17 +3210,30 @@ sub config_to_command {
>       push @$devices, '-device', $kbd if defined($kbd);
>      }
>  
> +    my $bootorder = {};
> +    my $boot = parse_property_string($boot_fmt, $conf->{boot}) if 
> $conf->{boot};

Seeing just now, never declare a variable conditionally, this is dangerous in 
perl,
like a lot! If the check above fails, the variable will operate with the value 
it was
last set too, and not be undef.

You added this pattern also when doing the RNG stuff, so it's clearly something
you're not aware off but like to use. Please stop doing so, as this led us 
already
once to a long bug hunt, which I'd like to avoid again.


> +    if (!defined($boot) || $boot->{legacy}) {
> +     $bootorder = bootorder_from_legacy($conf, $boot);
> +    } elsif ($boot->{order}) {
> +     # start at 100 to allow user to insert devices before us with -args
> +     my $i = 100;
> +     for my $dev (PVE::Tools::split_list($boot->{order})) {
> +         $bootorder->{$dev} = $i++;
> +     }
> +    }
> +



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to