From: Richard Jones Date: Wed, 13 May 2009 10:43:21 +0000 (+0100) Subject: Increase the wait time for vmchannel socket to appear (fix for slow / heavily-loaded... X-Git-Tag: 1.0.26~17 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=1ed352b5dd07ee6068e0255e17bf81dc609af702;p=libguestfs.git Increase the wait time for vmchannel socket to appear (fix for slow / heavily-loaded) machines. --- 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");