From b7089eca0849d08bd61ee060a7c0414f06f81d39 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 3 Oct 2006 10:54:49 -0400 Subject: [PATCH] Improve error reporting to user if hypervisor connection attempt fails (bz 209122) --- src/virtManager/engine.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/virtManager/engine.py b/src/virtManager/engine.py index a4e69bbe..f1506ad0 100644 --- a/src/virtManager/engine.py +++ b/src/virtManager/engine.py @@ -65,7 +65,23 @@ class vmmEngine: self.show_manager(uri) except: logging.error((("Unable to open connection to hypervisor URI '%s'") % str(uri)) + \ - str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1])) + ": " + str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1])) + + if uri is None: + uri = "xen" + if uri == "xen": + dg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, + _("Unable to open a connection to the Xen hypervisor/daemon.\n\n" + \ + "Verify that:\n" + \ + " - A Xen host kernel was booted\n" + \ + " - The Xen service has been started\n")) + else: + dg = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, + _("Unable to open connection to hypervisor '%s'") % str(uri)) + dg.set_title(_("Virtual Machine Manager Connection Failure")) + dg.run() + dg.hide() + dg.destroy() if len(self.connections.keys()) == 0: gtk.main_quit()