mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-05 08:41:39 +00:00
qm importdisk: tell user to what VM disk we actually imported
as else one has no idea what the imported disk is, especially if multiple unused disks are already present.. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
5600c5b22f
commit
c75bf16117
@ -483,12 +483,13 @@ __PACKAGE__->register_method ({
|
||||
my $storecfg = PVE::Storage::config();
|
||||
PVE::Storage::storage_check_enabled($storecfg, $storeid);
|
||||
|
||||
my $target_storage_config =
|
||||
PVE::Storage::storage_config($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 });
|
||||
print "importing disk '$source' to VM $vmid ...\n";
|
||||
my ($drive_id, $volid) = PVE::QemuServer::ImportDisk::do_import($source, $vmid, $storeid, { format => $format });
|
||||
print "Successfully imported disk as '$drive_id:$volid'\n";
|
||||
|
||||
return undef;
|
||||
}});
|
||||
|
@ -55,7 +55,7 @@ sub do_import {
|
||||
PVE::QemuServer::vmconfig_apply_pending($vmid, $vm_conf, $storecfg);
|
||||
}
|
||||
} else {
|
||||
PVE::QemuConfig->add_unused_volume($vm_conf, $dst_volid);
|
||||
$drive_name = PVE::QemuConfig->add_unused_volume($vm_conf, $dst_volid);
|
||||
PVE::QemuConfig->write_config($vmid, $vm_conf);
|
||||
}
|
||||
};
|
||||
@ -78,6 +78,8 @@ sub do_import {
|
||||
warn "cleanup of $dst_volid failed: $@\n" if $@;
|
||||
die $err;
|
||||
}
|
||||
|
||||
return ($drive_name, $dst_volid);
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user