[Pkg-libvirt-commits] [libguestfs] 66/233: tests/nbd: Move wait for qemu-nbd to start up earlier.

Hilko Bengen bengen at moszumanska.debian.org
Wed Feb 19 21:10:55 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch experimental
in repository libguestfs.

commit 3858eeb5171c0d6824c424e03a523e5686a98dfd
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Sat Jan 18 14:20:43 2014 +0000

    tests/nbd: Move wait for qemu-nbd to start up earlier.
    
    tests/nbd/test-nbd.pl contains a hack (a call to sleep) to wait
    for qemu-nbd to start up in another process.
    
    This sleep was previously located before the call to $g->launch()
    since that is where (previous to commit 4a0f5ed382) the backend would
    have connected to the NBD server.
    
    However in the new code, an initial NBD connection test is done when
    the drive is added (ie. $g->add_drive (..., protocol=>"nbd")), which
    duly failed intermittently because the qemu-nbd server had not opened
    its socket yet.
    
    Move the wait earlier -- just after the fork -- to avoid this.
    
    This updates commit 4a0f5ed38233393e75ea69ff0595936aed0e8abb.
---
 tests/nbd/test-nbd.pl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/nbd/test-nbd.pl b/tests/nbd/test-nbd.pl
index 1c8e0b2..c7361fd 100755
--- a/tests/nbd/test-nbd.pl
+++ b/tests/nbd/test-nbd.pl
@@ -74,17 +74,17 @@ sub run_test {
         die "qemu-nbd: $!";
     }
 
+    # XXX qemu-nbd lacks any way to tell if it is awake and listening
+    # for connections.  It could write a pid file or something.  Could
+    # we check that the socket has been opened by looking in netstat?
+    sleep (2);
+
     my $g = Sys::Guestfs->new ();
 
     # Add an NBD drive.
     $g->add_drive ("", readonly => $readonly, format => "raw",
                    protocol => "nbd", server => [$server]);
 
-    # XXX qemu-nbd lacks any way to tell if it is awake and listening
-    # for connections.  It could write a pid file or something.  Could
-    # we check that the socket has been opened by looking in netstat?
-    sleep (2);
-
     # This dies if qemu cannot connect to the NBD server.
     $g->launch ();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list