]> git.proxmox.com Git - qemu-server.git/commitdiff
check has_feature copy for full clone
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 2 May 2013 05:17:15 +0000 (07:17 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 2 May 2013 05:17:15 +0000 (07:17 +0200)
PVE/API2/Qemu.pm

index 1eafe79534ba87ccf2f49083ddca40113ea40763..264dfe12a317a49b148730aa560bb0ef80681116 100644 (file)
@@ -1948,7 +1948,11 @@ __PACKAGE__->register_method({
                    if (PVE::QemuServer::drive_is_cdrom($drive)) {
                        $newconf->{$opt} = $value; # simply copy configuration
                    } else {
-                       $drive->{full} = 1 if $param->{full} || !PVE::Storage::volume_is_base($storecfg,  $drive->{file});
+                       if ($param->{full} || !PVE::Storage::volume_is_base($storecfg,  $drive->{file})) {
+                           die "Full copy feature is not available" 
+                               if !PVE::Storage::volume_has_feature($storecfg, 'copy', $drive->{file}, $snapname, $running);
+                           $drive->{full} = 1; 
+                       }
                        $drives->{$opt} = $drive;
                        push @$vollist, $drive->{file};
                    }