mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-20 05:53:19 +00:00
QemuServer: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
87056e1821
commit
2b2923aefd
@ -6306,7 +6306,6 @@ sub restore_vma_archive {
|
|||||||
return if drive_is_cdrom($drive);
|
return if drive_is_cdrom($drive);
|
||||||
|
|
||||||
my $volid = $drive->{file};
|
my $volid = $drive->{file};
|
||||||
|
|
||||||
return if !$volid || $volid =~ m|^/|;
|
return if !$volid || $volid =~ m|^/|;
|
||||||
|
|
||||||
my ($path, $owner) = PVE::Storage::path($cfg, $volid);
|
my ($path, $owner) = PVE::Storage::path($cfg, $volid);
|
||||||
@ -6322,8 +6321,7 @@ sub restore_vma_archive {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
# delete vmstate files
|
# delete vmstate files, after the restore we have no snapshots anymore
|
||||||
# since after the restore we have no snapshots anymore
|
|
||||||
foreach my $snapname (keys %{$oldconf->{snapshots}}) {
|
foreach my $snapname (keys %{$oldconf->{snapshots}}) {
|
||||||
my $snap = $oldconf->{snapshots}->{$snapname};
|
my $snap = $oldconf->{snapshots}->{$snapname};
|
||||||
if ($snap->{vmstate}) {
|
if ($snap->{vmstate}) {
|
||||||
@ -6357,12 +6355,12 @@ sub restore_vma_archive {
|
|||||||
$name = $d->{name};
|
$name = $d->{name};
|
||||||
$name .= ".$d->{format}" if $d->{format} ne 'raw';
|
$name .= ".$d->{format}" if $d->{format} ne 'raw';
|
||||||
}
|
}
|
||||||
my $volid = PVE::Storage::vdisk_alloc($cfg, $storeid, $vmid,
|
|
||||||
$d->{format}, $name, $alloc_size);
|
my $volid = PVE::Storage::vdisk_alloc($cfg, $storeid, $vmid, $d->{format}, $name, $alloc_size);
|
||||||
print STDERR "new volume ID is '$volid'\n";
|
print STDERR "new volume ID is '$volid'\n";
|
||||||
$d->{volid} = $volid;
|
$d->{volid} = $volid;
|
||||||
|
|
||||||
PVE::Storage::activate_volumes($cfg,[$volid]);
|
PVE::Storage::activate_volumes($cfg, [$volid]);
|
||||||
|
|
||||||
my $write_zeros = 1;
|
my $write_zeros = 1;
|
||||||
if (PVE::Storage::volume_has_feature($cfg, 'sparseinit', $volid)) {
|
if (PVE::Storage::volume_has_feature($cfg, 'sparseinit', $volid)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user