5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-27 22:50:15 +03:00

api: update vm: print drive string for newly allocated/imported drives

In the spirit of c75bf16 ("qm importdisk: tell user to what VM disk we
actually imported"), and so that the information is not lost once qm
importdisk switches to re-using the API call.

Added for cloudinit too, because a new disk is allocated.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2022-03-17 12:31:06 +01:00 committed by Fabian Grünbichler
parent e6ac9fed7b
commit 3e7d9fac7c

@ -349,6 +349,7 @@ my $create_disks = sub {
push @$vollist, $volid;
delete $disk->{format}; # no longer needed
$res->{$ds} = PVE::QemuServer::print_drive($disk);
print "$ds: successfully created disk '$res->{$ds}'\n";
} elsif ($volid =~ $NEW_DISK_RE) {
my ($storeid, $size) = ($2 || $default_storage, $3);
die "no storage ID specified (and no default storage)\n" if !$storeid;
@ -417,6 +418,8 @@ my $create_disks = sub {
delete $disk->{format}; # no longer needed
$res->{$ds} = PVE::QemuServer::print_drive($disk);
}
print "$ds: successfully created disk '$res->{$ds}'\n";
} else {
PVE::Storage::check_volume_access(
$rpcenv,