[pve-devel] [PATCH qemu-server 3/3] code cleanup: migrate: avoid post-ifs

Fabian Ebner f.ebner at proxmox.com
Fri Mar 19 14:49:08 CET 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/QemuMigrate.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/PVE/QemuMigrate.pm b/PVE/QemuMigrate.pm
index 44cecce..64794a7 100644
--- a/PVE/QemuMigrate.pm
+++ b/PVE/QemuMigrate.pm
@@ -407,11 +407,11 @@ sub sync_disks {
 		1,
 	    );
 
-	    $log_error->("storage '$targetsid' is not available on node '$self->{node}'")
-		if !$target_scfg;
-
-	    $log_error->("content type 'images' is not available on storage '$targetsid'")
-		if $target_scfg && !$target_scfg->{content}->{images};
+	    if (!$target_scfg) {
+		$log_error->("storage '$targetsid' is not available on node '$self->{node}'");
+	    } elsif (!$target_scfg->{content}->{images}) {
+		$log_error->("content type 'images' is not available on storage '$targetsid'");
+	    }
 
 	    PVE::Storage::foreach_volid($dl, sub {
 		my ($volid, $sid, $volinfo) = @_;
-- 
2.20.1






More information about the pve-devel mailing list