fix #2382: delete cloudinit disk before restoring

The fix introduced in commit bf4a933 did not work as intended. We're
iterating over the $oldconf, not over $virtdev_hash. This means
$drive->{is_cloudinit} is always undefined. Instead use the $exclude_cloudinit
parameter from drive_is_cdrom().

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
(cherry picked from commit a82348eb34)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Mira Limbeck 2019-09-25 15:30:12 +02:00 committed by Thomas Lamprecht
parent c5fdfea839
commit 89099a07c7

View File

@ -6301,7 +6301,7 @@ sub restore_vma_archive {
foreach_drive($oldconf, sub {
my ($ds, $drive) = @_;
return if !$drive->{is_cloudinit} && drive_is_cdrom($drive);
return if drive_is_cdrom($drive, 1);
my $volid = $drive->{file};
return if !$volid || $volid =~ m|^/|;