mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 22:53:08 +00:00
cd rom handling: refactor cd rom path helper function
to stop returning results of assignments Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
This commit is contained in:
parent
259470ee41
commit
490b730854
@ -1289,12 +1289,16 @@ sub get_cdrom_path {
|
|||||||
|
|
||||||
return $cdrom_path if defined($cdrom_path);
|
return $cdrom_path if defined($cdrom_path);
|
||||||
|
|
||||||
return $cdrom_path = "/dev/cdrom" if -l "/dev/cdrom";
|
if (-l "/dev/cdrom") {
|
||||||
return $cdrom_path = "/dev/cdrom1" if -l "/dev/cdrom1";
|
$cdrom_path = "/dev/cdrom";
|
||||||
return $cdrom_path = "/dev/cdrom2" if -l "/dev/cdrom2";
|
} elsif (-l "/dev/cdrom1") {
|
||||||
|
$cdrom_path = "/dev/cdrom1";
|
||||||
|
} elsif (-l "/dev/cdrom2") {
|
||||||
|
$cdrom_path = "/dev/cdrom2";
|
||||||
|
} else {
|
||||||
log_warn("no physical CD-ROM available, ignoring");
|
log_warn("no physical CD-ROM available, ignoring");
|
||||||
$cdrom_path = '';
|
$cdrom_path = '';
|
||||||
|
}
|
||||||
|
|
||||||
return $cdrom_path;
|
return $cdrom_path;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user