From 1ed352b5dd07ee6068e0255e17bf81dc609af702 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Wed, 13 May 2009 11:43:21 +0100 Subject: [PATCH] Increase the wait time for vmchannel socket to appear (fix for slow / heavily-loaded) machines. --- src/guestfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/guestfs.c b/src/guestfs.c index 612ac00..43571af 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -906,10 +906,9 @@ guestfs_launch (guestfs_h *g) addr.sun_path[UNIX_PATH_MAX-1] = '\0'; tries = 100; + /* Always sleep at least once to give qemu a small chance to start up. */ + usleep (10000); while (tries > 0) { - /* Always sleep at least once to give qemu a small chance to start up. */ - usleep (10000); - r = connect (g->sock, (struct sockaddr *) &addr, sizeof addr); if ((r == -1 && errno == EINPROGRESS) || r == 0) goto connected; @@ -917,6 +916,7 @@ guestfs_launch (guestfs_h *g) if (errno != ENOENT) perrorf (g, "connect"); tries--; + usleep (100000); } error (g, "failed to connect to vmchannel socket"); -- 1.8.3.1