]> git.proxmox.com Git - pve-zsync.git/commitdiff
insert check if disk is no zvol
authorWolfgang Link <w.link@proxmox.com>
Tue, 19 May 2015 05:02:49 +0000 (07:02 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 19 May 2015 05:32:27 +0000 (07:32 +0200)
this was before implemented wrong

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
pve-zsync

index 4a0d2d82793f2573869eefe0282afa251686fa37..82619da2b45c8fe5fd76948ca3475ecf0a6f696b 100644 (file)
--- a/pve-zsync
+++ b/pve-zsync
@@ -635,6 +635,7 @@ sub parse_disks {
        my $line = $1;
        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;
@@ -649,7 +650,9 @@ sub parse_disks {
            $stor = $2;
        }
 
-       if($disk && $disk ne "none" && $disk !~ m/cdrom/ ) {
+       die "disk is not on ZFS Storage\n" if $is_disk && !$disk && $line !~ m/cdrom/;
+
+       if($disk && $line !~ m/none/ && $line !~ m/cdrom/ ) {
            my $cmd = "";
            $cmd .= "ssh root\@$ip " if $ip;
            $cmd .= "pvesm path $stor$disk";
@@ -666,7 +669,6 @@ sub parse_disks {
            }
        }
     }
-    die "disk is not on ZFS Storage\n" if $num == 0;
     return $disks;
 }