]> xenbits.xensource.com Git - rumpuser-xen.git/commitdiff
be verbose about error and workaround slow console
authorAntti Kantee <pooka@iki.fi>
Tue, 20 Jan 2015 16:55:46 +0000 (17:55 +0100)
committerAntti Kantee <pooka@iki.fi>
Tue, 20 Jan 2015 16:59:03 +0000 (17:59 +0100)
In case the domu runs very quickly, there will be a complete failure
to observe any output.  Therefore, in case we exit with val != 0,
sleep a bit.  This is a cheap and dirty workaround.

lib/emul.c

index e9bc299e4b89c828c9c6dddfa85a722f13f0062e..7b3fdc177b98aec83ffbd85a1d3847ceac06f7b9 100644 (file)
@@ -96,7 +96,13 @@ void __dead
 _exit(int eval)
 {
        /* XXX this duplicates _app_main / callmain cleanup */
-       minios_printk("\n=== _exit(%d) called ===\n", eval);
+       if (eval) {
+               minios_printk("\n=== ERROR: _exit(%d) called ===\n", eval);
+               /* XXX: work around the console being slow to attach */
+               sleep(1);
+       } else {
+               minios_printk("\n=== _exit(%d) called ===\n", eval);
+       }
        _rumprun_deconfig();
        _netbsd_fini();
        minios_stop_kernel();