[pve-devel] [PATCH qemu-server 3/3] Consistently use format determined in 'PVE::Storage::foreach_volid'

Fabian Ebner f.ebner at proxmox.com
Wed Jan 8 11:28:47 CET 2020


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/QemuMigrate.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index a1e2dea..96ad3f4 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -319,6 +319,7 @@ sub sync_disks {
 
 		# always set 'snapshots' for qcow2 and vmdk volumes
 		$local_volumes->{$volid}->{snapshots} = ($volinfo->{format} =~ /^(?:qcow2|vmdk)$/);
+		$local_volumes->{$volid}->{format} = $volinfo->{format};
 	    });
 	}
 
@@ -372,7 +373,6 @@ sub sync_disks {
 	    die "owned by other VM (owner = VM $owner)\n"
 		if !$owner || ($owner != $self->{vmid});
 
-	    my $format = PVE::QemuServer::qemu_img_format($scfg, $volname);
 	    if (defined($snaprefs)) {
 		$local_volumes->{$volid}->{snapshots} = 1;
 
@@ -380,7 +380,7 @@ sub sync_disks {
 		# exceptions: 'zfspool' or 'qcow2' files (on directory storage)
 
 		die "online storage migration not possible if snapshot exists\n" if $self->{running};
-		if (!($scfg->{type} eq 'zfspool' || $format eq 'qcow2')) {
+		if (!($scfg->{type} eq 'zfspool' || $local_volumes->{$volid}->{format} eq 'qcow2')) {
 		    die "non-migratable snapshot exists\n";
 		}
 	    }
-- 
2.20.1





More information about the pve-devel mailing list