]> git.proxmox.com Git - pve-zsync.git/blobdiff - pve-zsync
Revert "fix: check for incremental sync snapshot."
[pve-zsync.git] / pve-zsync
index d14a1c165a998b333c91f849bbff14e189e0249d..25add923165a29f4c8d4e896d6ffd408bf720cb4 100755 (executable)
--- a/pve-zsync
+++ b/pve-zsync
@@ -53,6 +53,8 @@ my $HOSTRE = "(?:$HOSTv4RE1|\\[$IPV6RE\\])";       # ipv6 must always be in brac
 # targets are either a VMID, or a 'host:zpool/path' with 'host:' being optional
 my $TARGETRE = qr!^(?:($HOSTRE):)?(\d+|(?:[\w\-_]+)(/.+)?)$!;
 
+my $DISK_KEY_RE = qr/^(?:(?:(?:virtio|ide|scsi|sata|efidisk|mp)\d+)|rootfs): /;
+
 my $command = $ARGV[0];
 
 if (defined($command) && $command ne 'help' && $command ne 'printpod') {
@@ -545,10 +547,10 @@ sub init {
        update_state($job);
     }); #cron and state lock
 
-    eval {
-       sync($param) if !$param->{skip};
-    };
-    if(my $err = $@) {
+    return if $param->{skip};
+
+    eval { sync($param) };
+    if (my $err = $@) {
        destroy_job($param);
        print $err;
     }
@@ -830,7 +832,7 @@ sub parse_disks {
        my $line = $1;
 
        next if $line =~ /media=cdrom/;
-       next if $line !~ m/^(?:((?:virtio|ide|scsi|sata|mp)\d+)|rootfs): /;
+       next if $line !~ m/$DISK_KEY_RE/;
 
        #QEMU if backup is not set include in  sync
        next if $vm_type eq 'qemu' && ($line =~ m/backup=(?i:0|no|off|false)/);
@@ -840,7 +842,7 @@ sub parse_disks {
 
        my $disk = undef;
        my $stor = undef;
-       if($line =~ m/^(?:(?:(?:virtio|ide|scsi|sata|mp)\d+)|rootfs): (.*)$/) {
+       if($line =~ m/$DISK_KEY_RE(.*)$/) {
            my @parameter = split(/,/,$1);
 
            foreach my $opt (@parameter) {