5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-25 06:03:52 +03:00

fix CDROM hotplug

This commit is contained in:
Dietmar Maurer 2015-02-12 08:00:14 +01:00
parent 996635e58d
commit 4de1bb2523

View File

@ -4062,25 +4062,23 @@ sub vmconfig_update_disk {
return 1;
}
} else { # cdrom
if ($drive->{file} eq 'none') {
vm_mon_cmd($vmid, "eject",force => JSON::true,device => "drive-$opt");
} else {
my $path = get_iso_path($storecfg, $vmid, $drive->{file});
vm_mon_cmd($vmid, "eject", force => JSON::true,device => "drive-$opt"); # force eject if locked
vm_mon_cmd($vmid, "change", device => "drive-$opt",target => "$path") if $path;
}
}
}
}
if (drive_is_cdrom($drive)) { # cdrom
if ($drive->{file} eq 'none') {
vm_mon_cmd($vmid, "eject",force => JSON::true,device => "drive-$opt");
} else {
my $path = get_iso_path($storecfg, $vmid, $drive->{file});
vm_mon_cmd($vmid, "eject", force => JSON::true,device => "drive-$opt"); # force eject if locked
vm_mon_cmd($vmid, "change", device => "drive-$opt",target => "$path") if $path;
}
} else {
die "skip\n" if !$hotplug || $opt =~ m/(ide|sata)(\d+)/;
# hotplug new disks
vm_deviceplug($storecfg, $conf, $vmid, $opt, $drive);
}
die "skip\n" if !$hotplug || $opt =~ m/(ide|sata)(\d+)/;
# hotplug new disks
vm_deviceplug($storecfg, $conf, $vmid, $opt, $drive);
}
sub vm_start {