p2v: Print an error if gtk_init_check fails.

Apparently gtk_init_check doesn't (always?) print an error message
when it returns false, so virt-p2v just exits without any message.

This was observed on RHEL 6 when $DISPLAY was not set.
This commit is contained in:
Richard W.M. Jones
2015-08-13 14:13:49 +01:00
parent 2bfb9ff9ea
commit 1d082d127e

View File

@@ -197,9 +197,13 @@ main (int argc, char *argv[])
kernel_configuration (config, cmdline, cmdline_source);
else {
gui:
if (!gui_possible)
/* Gtk has already printed an error. */
if (!gui_possible) {
fprintf (stderr,
_("%s: gtk_init_check returned false, indicating that\n"
"a GUI is not possible on this host. Check X11, $DISPLAY etc.\n"),
guestfs_int_program_name);
exit (EXIT_FAILURE);
}
gui_application (config);
}