qemu-server: vncproxy: qm: wait max 10s for the socket if it does not exist

Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
This commit is contained in:
Stefan Priebe 2013-02-28 14:05:15 +01:00 committed by Dietmar Maurer
parent 8da4165a63
commit 7aca710470

3
qm
View File

@ -48,6 +48,9 @@ sub run_vnc_proxy {
my $path = PVE::QemuServer::vnc_socket($vmid);
my $c;
while ( ++$c < 10 && !-e $path ) { sleep(1); }
my $s = IO::Socket::UNIX->new(Peer => $path, Timeout => 120);
die "unable to connect to socket '$path' - $!" if !$s;