From 58504d5edfe531ace87c40258e1b15e1a9f21c06 Mon Sep 17 00:00:00 2001 From: Stefan Priebe Date: Mon, 25 Feb 2013 21:57:23 +0100 Subject: [PATCH] vncproxy: wait max 10s for the socket if it does not exist Signed-off-by: Stefan Priebe --- PVE/API2/Qemu.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 1597e68b..f91716f3 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1110,6 +1110,9 @@ __PACKAGE__->register_method({ my $realcmd = sub { my $upid = shift; + my $c = 0; + while ( ++$c < 10 && !-e "/var/run/qemu-server/$vmid.vnc" ) { sleep(1); } + syslog('info', "starting vnc proxy $upid\n"); my $qmcmd = [@$remcmd, "/usr/sbin/qm", 'vncproxy', $vmid];