]> git.proxmox.com Git - qemu-server.git/commitdiff
QemuServer: code cleanup
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 May 2019 08:53:50 +0000 (10:53 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 17 May 2019 08:53:50 +0000 (10:53 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 2822a81af146fcd9da7d1e3461d1f6a0e7f81a9e..7d7a6bf4e978abcf56b6a9d9c6220b9c73e5b8d1 100644 (file)
@@ -6306,7 +6306,6 @@ sub restore_vma_archive {
                return if drive_is_cdrom($drive);
 
                my $volid = $drive->{file};
-
                return if !$volid || $volid =~ m|^/|;
 
                my ($path, $owner) = PVE::Storage::path($cfg, $volid);
@@ -6322,8 +6321,7 @@ sub restore_vma_archive {
                }
            });
 
-           # delete vmstate files
-           # since after the restore we have no snapshots anymore
+           # delete vmstate files, after the restore we have no snapshots anymore
            foreach my $snapname (keys %{$oldconf->{snapshots}}) {
                my $snap = $oldconf->{snapshots}->{$snapname};
                if ($snap->{vmstate}) {
@@ -6357,12 +6355,12 @@ sub restore_vma_archive {
                $name = $d->{name};
                $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";
            $d->{volid} = $volid;
 
-           PVE::Storage::activate_volumes($cfg,[$volid]);
+           PVE::Storage::activate_volumes($cfg, [$volid]);
 
            my $write_zeros = 1;
            if (PVE::Storage::volume_has_feature($cfg, 'sparseinit', $volid)) {