when a vm is configured to use a physical cd rom drive but there is no
such drive a cryptic "uninitialized value" error is thrown. this is
due to `$path` being undefined in `sub print_drive_commandline_full`.
warn that no cd rom drive is available instead.
note that the error was cosmetic as the vm would start just fine.
forum thread: https://forum.proxmox.com/threads/119592/
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
my $cdrom_path;
sub get_cdrom_path {
- return $cdrom_path if $cdrom_path;
+ return $cdrom_path if defined($cdrom_path);
return $cdrom_path = "/dev/cdrom" if -l "/dev/cdrom";
return $cdrom_path = "/dev/cdrom1" if -l "/dev/cdrom1";
return $cdrom_path = "/dev/cdrom2" if -l "/dev/cdrom2";
+
+ log_warn("no physical CD-ROM available, ignoring");
+ $cdrom_path = '';
+
+ return $cdrom_path;
}
sub get_iso_path {