[pve-devel] [PATCH qemu-server] clone: use a fullclone hash instead of $drive->{full}
Wolfgang Bumiller
w.bumiller at proxmox.com
Thu Oct 29 15:02:35 CET 2015
'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 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 51627c0..472f396 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2219,6 +2219,7 @@ __PACKAGE__->register_method({
my $newconf = { lock => 'clone' };
my $drives = {};
+ my $fullclone = {};
my $vollist = [];
foreach my $opt (keys %$oldconf) {
@@ -2245,7 +2246,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"
@@ -2301,7 +2302,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);
--
2.1.4
More information about the pve-devel
mailing list