[pve-devel] [PATCH v2 qemu-server] fix #2382: delete cloudinit disk before restoring

Mira Limbeck m.limbeck at proxmox.com
Wed Sep 25 15:30:12 CEST 2019


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 at proxmox.com>
---
v2: set $exclude_cloudinit in drive_is_cdrom() which calls
  drive_is_cloudinit() internally instead of calling it directly.

 PVE/QemuServer.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ad6902f..00c6b58 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6509,7 +6509,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|^/|;
-- 
2.20.1





More information about the pve-devel mailing list