]> git.proxmox.com Git - qemu-server.git/commitdiff
drive-mirror: warn use POSIX::_exit on exec failure
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 5 Jan 2017 08:39:13 +0000 (09:39 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 5 Jan 2017 09:03:16 +0000 (10:03 +0100)
PVE/QemuServer.pm

index 0b866cdda406a48ebdbe46a7de5bced74ebdd662..31e30fa66430cce5f19356d7813c665dd989e942 100644 (file)
@@ -5926,17 +5926,16 @@ sub qemu_drive_mirror {
            die "forking socat tunnel failed";
        } elsif ($pid == 0) {
            exec(@$cmd);
-           exit(-1);
-       } else {
-           $jobs->{"drive-$drive"}->{pid} = $pid;
+           warn "exec failed: $!\n";
+           POSIX::_exit(-1);
+       }
+       $jobs->{"drive-$drive"}->{pid} = $pid;
 
-           my $timeout = 0;
-           while (1) {
-               last if -S $unixsocket; 
-               die if $timeout > 5;
-               $timeout++;
-               sleep 1;
-           }
+       my $timeout = 0;
+       while (!-S $unixsocket) {
+           die "nbd connection helper timed out\n"
+               if $timeout++ > 5;
+           sleep 1;
        }
     } else {
        my $storecfg = PVE::Storage::config();