mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-19 20:16:24 +00:00
PVE::QemuServer::create_disks - run code inside eval
So that we can free allocated volumes ins something fails.
Thi bug was introduced with commit ae57f6b352
This commit is contained in:
parent
0342b45bee
commit
64932aebff
@ -119,7 +119,8 @@ my $create_disks = sub {
|
|||||||
my $vollist = [];
|
my $vollist = [];
|
||||||
|
|
||||||
my $res = {};
|
my $res = {};
|
||||||
PVE::QemuServer::foreach_drive($settings, sub {
|
|
||||||
|
my $code = sub {
|
||||||
my ($ds, $disk) = @_;
|
my ($ds, $disk) = @_;
|
||||||
|
|
||||||
my $volid = $disk->{file};
|
my $volid = $disk->{file};
|
||||||
@ -190,7 +191,9 @@ my $create_disks = sub {
|
|||||||
|
|
||||||
$res->{$ds} = PVE::QemuServer::print_drive($vmid, $disk);
|
$res->{$ds} = PVE::QemuServer::print_drive($vmid, $disk);
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
eval { PVE::QemuServer::foreach_drive($settings, $code); };
|
||||||
|
|
||||||
# free allocated images on error
|
# free allocated images on error
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
|
Loading…
Reference in New Issue
Block a user