[pve-devel] [PATCH] vncproxy: wait max 10s for the socket if it does not exist

Stefan Priebe s.priebe at profihost.ag
Mon Feb 25 21:57:23 CET 2013


Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
 PVE/API2/Qemu.pm |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index bed2f4c..32bacaf 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -1123,6 +1123,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];
-- 
1.7.10.4




More information about the pve-devel mailing list