mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-21 23:24:48 +00:00
Fix #1417: make sure the target storage allows disk images before importing
This was fixed in c46366fd49
for 'qm create', but 'qm importdisk' has the same issue
This commit is contained in:
parent
c83ad58681
commit
c7db1e40c4
@ -420,9 +420,15 @@ __PACKAGE__->register_method ({
|
|||||||
my $vm_conf = PVE::QemuConfig->load_config($vmid);
|
my $vm_conf = PVE::QemuConfig->load_config($vmid);
|
||||||
PVE::QemuConfig->check_lock($vm_conf);
|
PVE::QemuConfig->check_lock($vm_conf);
|
||||||
die "$source: non-existent or non-regular file\n" if (! -f $source);
|
die "$source: non-existent or non-regular file\n" if (! -f $source);
|
||||||
|
|
||||||
my $storecfg = PVE::Storage::config();
|
my $storecfg = PVE::Storage::config();
|
||||||
PVE::Storage::storage_check_enabled($storecfg, $storeid);
|
PVE::Storage::storage_check_enabled($storecfg, $storeid);
|
||||||
|
|
||||||
|
my $target_storage_config =
|
||||||
|
PVE::Storage::storage_config($storecfg, $storeid);
|
||||||
|
die "storage $storeid does not support vm images\n"
|
||||||
|
if !$target_storage_config->{content}->{images};
|
||||||
|
|
||||||
PVE::QemuServer::ImportDisk::do_import($source, $vmid, $storeid, { format => $format });
|
PVE::QemuServer::ImportDisk::do_import($source, $vmid, $storeid, { format => $format });
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
|
Loading…
Reference in New Issue
Block a user