virt-manager/virtman-check-for-valid-display.patch
Charles Arnold 10d2977e4e - bsc#Bug 952241 - virt-manager: LibvirtGLib was imported without
specifying a version first.
  cde2f0ef-Suppress-gi-warnings-about-lack-of-require_version.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=278
2015-10-27 19:48:08 +00:00

21 lines
810 B
Diff

References: bnc#907958
Sanity check for those who forget '-X' on ssh and try to start virt-manager
Index: virt-manager-1.2.1/virt-manager
===================================================================
--- virt-manager-1.2.1.orig/virt-manager
+++ virt-manager-1.2.1/virt-manager
@@ -182,8 +182,11 @@ def main():
from gi.repository import Gtk
leftovers = sys.argv[1:]
- # This will error if Gtk wasn't correctly initialized
- Gtk.Window()
+ if os.environ.has_key('DISPLAY') and os.environ['DISPLAY']:
+ # This will error if Gtk wasn't correctly initialized
+ Gtk.Window()
+ else:
+ raise Exception("Error starting virt-manager: No graphical display found")
globals()["Gtk"] = Gtk
import virtManager.config