]> git.proxmox.com Git - qemu-server.git/commitdiff
clone: use a fullclone hash instead of $drive->{full}
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 29 Oct 2015 14:02:35 +0000 (15:02 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 30 Oct 2015 06:06:10 +0000 (07:06 +0100)
'full' is not a valid drive property which are now being
checked in print_property_string. Since it's only a
temporary value and passed to clone_disk as parameter it
can be stored separately.

PVE/API2/Qemu.pm

index 3f16bcd3cc7bbe1bbbe0e2c12985879cb6a20d96..e9cf5debb9cf1d5bf38da6483f8844638708d91d 100644 (file)
@@ -2191,6 +2191,7 @@ __PACKAGE__->register_method({
 
            my $newconf = { lock => 'clone' };
            my $drives = {};
+           my $fullclone = {};
            my $vollist = [];
 
            foreach my $opt (keys %$oldconf) {
@@ -2217,7 +2218,7 @@ __PACKAGE__->register_method({
                        if ($param->{full}) {
                            die "Full clone feature is not available"
                                if !PVE::Storage::volume_has_feature($storecfg, 'copy', $drive->{file}, $snapname, $running);
-                           $drive->{full} = 1;
+                           $fullclone->{$opt} = 1;
                        } else {
                            # not full means clone instead of copy
                            die "Linked clone feature is not available"
@@ -2273,7 +2274,7 @@ __PACKAGE__->register_method({
                        my $drive = $drives->{$opt};
 
                        my $newdrive = PVE::QemuServer::clone_disk($storecfg, $vmid, $running, $opt, $drive, $snapname,
-                                                                  $newid, $storage, $format, $drive->{full}, $newvollist);
+                                                                  $newid, $storage, $format, $fullclone->{$opt}, $newvollist);
 
                        $newconf->{$opt} = PVE::QemuServer::print_drive($vmid, $newdrive);