From 1d082d127e017d91bc493807a4a488dfa045a79c Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 13 Aug 2015 14:13:49 +0100 Subject: [PATCH] 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. --- p2v/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/p2v/main.c b/p2v/main.c index e88e1b41b..d59465a23 100644 --- a/p2v/main.c +++ b/p2v/main.c @@ -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); }