[pve-devel] [PATCH qemu-server 2/4] use more verbose message for hotplug errors

Oguz Bektas o.bektas at proxmox.com
Tue Oct 29 14:19:08 CET 2019


also rename $add_error to $add_hotplug_error to differentiate between
apply_error (for vmconfig_apply_pending) and hotplug_error

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 PVE/QemuServer.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 1dc116b..d92040b 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -4827,9 +4827,9 @@ sub vmconfig_hotplug_pending {
     # Note: those option cannot raise errors, we we do not care about
     # $selection and always apply them.
 
-    my $add_error = sub {
+    my $add_hotplug_error = sub {
 	my ($opt, $msg) = @_;
-	$errors->{$opt} = "hotplug problem - $msg";
+	$errors->{$opt} = "unable to hotplug $opt: $msg";
     };
 
     my $changes = 0;
@@ -4901,7 +4901,7 @@ sub vmconfig_hotplug_pending {
 	    }
 	};
 	if (my $err = $@) {
-	    &$add_error($opt, $err) if $err ne "skip\n";
+	    $add_hotplug_error->($opt, $err) if $err ne "skip\n";
 	} else {
 	    # save new config if hotplug was successful
 	    delete $conf->{$opt};
@@ -4990,7 +4990,7 @@ sub vmconfig_hotplug_pending {
 	    }
 	};
 	if (my $err = $@) {
-	    &$add_error($opt, $err) if $err ne "skip\n";
+	    $add_hotplug_error->($opt, $err) if $err ne "skip\n";
 	} else {
 	    # save new config if hotplug was successful
 	    $conf->{$opt} = $value;
-- 
2.20.1




More information about the pve-devel mailing list