From 0250b7f52f580c3600b017bac9e2d9033e82adcd Mon Sep 17 00:00:00 2001 From: Alexander Zeidler Date: Wed, 4 Dec 2024 11:30:04 +0100 Subject: [PATCH] api: clone: mention "snapshot" in the error message if specified as it may be the only cause of the clone incompatibility Example: # qm clone 101 102 --full --snapname foo Before: > Full clone feature is not supported for 'local-zfs:base-100-disk-2/vm-101-disk-2' (tpmstate0) After: > Full clone feature is not supported for a snapshot of 'local-zfs:base-100-disk-2/vm-101-disk-2' (tpmstate0) Signed-off-by: Alexander Zeidler --- PVE/API2/Qemu.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index b318d70e..ec45d5ff 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -3900,13 +3900,16 @@ __PACKAGE__->register_method({ $newconf->{$opt} = $value; # simply copy configuration } else { my $volid = $drive->{file}; + my $msg = "clone feature is not supported for"; + $msg .= " a snapshot of" if $snapname; + $msg .= " '$volid' ($opt)"; if ($full || PVE::QemuServer::drive_is_cloudinit($drive)) { - die "Full clone feature is not supported for '$volid' ($opt)\n" + die "Full $msg\n" if !PVE::Storage::volume_has_feature($storecfg, 'copy', $volid, $snapname, $running); $fullclone->{$opt} = 1; } else { # not full means clone instead of copy - die "Linked clone feature is not supported for '$volid' ($opt)\n" + die "Linked $msg\n" if !PVE::Storage::volume_has_feature($storecfg, 'clone', $volid, $snapname, $running); } $drives->{$opt} = $drive;