X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=d8abfd63f6bba93f222f2f101a4c44f9d16e02a2;hb=e395d7db8fd3fe3d1b121258fe2f401d6b3e64c8;hp=27ecb51eebe8fcfa51ffcee0cc82e2e71bc30ab7;hpb=d96554c58fd48db02156044fc15b181e453f0315;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 27ecb51..d8abfd6 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -143,13 +143,6 @@ can easily destroy all your data>." * * Between each test we blockdev-setrw, umount-all, lvm-remove-all. * - * If the appliance is running an older Linux kernel (eg. RHEL 5) then - * devices are named /dev/hda etc. To cope with this, the test suite - * adds some hairly logic to detect this case, and then automagically - * replaces all strings which match "/dev/sd.*" with "/dev/hd.*". - * When writing test cases you shouldn't have to worry about this - * difference. - * * Don't assume anything about the previous contents of the block * devices. Use 'Init*' to create some initial scenarios. * @@ -3987,11 +3980,18 @@ int main (int argc, char *argv[]) printf (\"guestfs_launch FAILED\\n\"); exit (1); } + + /* Set a timeout in case qemu hangs during launch (RHBZ#505329). */ + alarm (600); + if (guestfs_wait_ready (g) == -1) { printf (\"guestfs_wait_ready FAILED\\n\"); exit (1); } + /* Cancel previous alarm. */ + alarm (0); + nr_tests = %d; " (500 * 1024 * 1024) (50 * 1024 * 1024) (10 * 1024 * 1024) nr_tests; @@ -4803,6 +4803,8 @@ generator (const char *text, int state) len = strlen (text); } + rl_attempted_completion_over = 1; + while ((name = commands[index]) != NULL) { index++; if (strncasecmp (name, text, len) == 0) @@ -4819,8 +4821,12 @@ char **do_completion (const char *text, int start, int end) char **matches = NULL; #ifdef HAVE_LIBREADLINE + rl_completion_append_character = ' '; + if (start == 0) matches = rl_completion_matches (text, generator); + else if (complete_dest_paths) + matches = rl_completion_matches (text, complete_dest_paths_generator); #endif return matches;