From 7aca710470950b966fc2d302326caf1ff7bea114 Mon Sep 17 00:00:00 2001 From: Stefan Priebe Date: Thu, 28 Feb 2013 14:05:15 +0100 Subject: [PATCH] qemu-server: vncproxy: qm: wait max 10s for the socket if it does not exist Signed-off-by: Stefan Priebe --- qm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qm b/qm index 93f621c1..2ab5eaa2 100755 --- a/qm +++ b/qm @@ -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;