[pve-devel] [PATCH 6/8] forbid offline migration of a non shared volume if it's a clone

Alexandre Derumier aderumier at odiso.com
Tue Dec 4 12:19:09 CET 2012


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/QemuMigrate.pm |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 0711681..eae28a6 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -245,6 +245,12 @@ sub sync_disks {
 
 	    die "can't migrate '$volid' - storagy type '$scfg->{type}' not supported\n"
 		if $scfg->{type} ne 'dir';
+
+	    #if file, check if a backing file exist
+	    if(($scfg->{type} eq 'dir') && (!$sharedvm)){
+		my (undef, undef, undef, $parent) = PVE::Storage::volume_size_info($self->{storecfg}, $volid, 1);
+		die "can't migrate '$volid' as it's a clone of '$parent'";
+	    }
 	}
 
 	foreach my $volid (keys %$volhash) {
-- 
1.7.10.4




More information about the pve-devel mailing list