[pve-devel] [PATCH pve-zsync 04/11] replace $is_disk with an early check

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Sep 28 11:40:05 CEST 2015


---
 pve-zsync | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pve-zsync b/pve-zsync
index 33962a6..dfb383b 100644
--- a/pve-zsync
+++ b/pve-zsync
@@ -692,10 +692,10 @@ sub parse_disks {
 	my $line = $1;
 
 	next if $line =~ /cdrom|none/;
+	next if $line !~ m/^(?:virtio|ide|scsi|sata)\d+: /;
 
 	my $disk = undef;
 	my $stor = undef;
-	my $is_disk = $line =~ m/^(virtio|ide|scsi|sata){1}\d+: /;
 	if($line =~ m/^(virtio\d+: )(.+:)([A-Za-z0-9\-]+),(.*)$/) {
 	    $disk = $3;
 	    $stor = $2;
@@ -708,10 +708,10 @@ sub parse_disks {
 	} elsif($line =~ m/^(sata\d+: )(.+:)([A-Za-z0-9\-]+),(.*)$/) {
 	    $disk = $3;
 	    $stor = $2;
+	} else {
+	    die "disk is not on ZFS Storage\n";
 	}
 
-	die "disk is not on ZFS Storage\n" if $is_disk && !$disk;
-
 	if($disk) {
 	    my $cmd = "";
 	    $cmd .= "ssh root\@$ip " if $ip;
-- 
2.1.4




More information about the pve-devel mailing list