]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/API2/Qemu.pm
api: fix conditional variable declaration
[qemu-server.git] / PVE / API2 / Qemu.pm
index fdf1947d234b15c712cf63c66427eae8dde9571b..2418b7c3cd7a0c34c6bf170b14cb2e37c6527980 100644 (file)
@@ -1191,10 +1191,11 @@ my $update_vm_api  = sub {
 
            my $modified = {}; # record what $option we modify
 
-           my $bootcfg = PVE::JSONSchema::parse_property_string('pve-qm-boot', $conf->{boot})
-               if $conf->{boot};
-           my @bootorder = PVE::Tools::split_list($bootcfg->{order})
-               if $bootcfg && $bootcfg->{order};
+           my @bootorder;
+           if (my $boot = $conf->{boot}) {
+               my $bootcfg = PVE::JSONSchema::parse_property_string('pve-qm-boot', $boot);
+               @bootorder = PVE::Tools::split_list($bootcfg->{order}) if $bootcfg && $bootcfg->{order};
+           }
            my $bootorder_deleted = grep {$_ eq 'bootorder'} @delete;
 
            foreach my $opt (@delete) {