[pve-devel] [PATCH qemu-server v2] improve 'pending changes' message for clone

Dominik Csapak d.csapak at proxmox.com
Wed Sep 12 10:53:52 CEST 2018


$newconf->{pending} is a reference to an empty hash, which is not falsy,
thus we always printed the warning

so check if there are actual values there and if yes,
give the names of the properties for which pending changes are found

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
changes from v1:
* use (my @changes = ...)
 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 b0af9d9..c1cc01b 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2785,8 +2785,9 @@ __PACKAGE__->register_method({
 		    delete $newconf->{lock};
 
 		    # do not write pending changes
-		    if ($newconf->{pending}) {
-			warn "found pending changes, discarding for clone\n";
+		    if (my @changes = keys %{$newconf->{pending}}) {
+			my $pending = join(',', @changes);
+			warn "found pending changes for '$pending', discarding for clone\n";
 			delete $newconf->{pending};
 		    }
 
-- 
2.11.0





More information about the pve-devel mailing list