virt-manager: Exit on ctrl-c
pygobject3 doesn't provide this automatically. Solution taken from: https://bugzilla.gnome.org/show_bug.cgi?id=622084
This commit is contained in:
parent
fb8db15269
commit
8fd8791139
|
@ -272,6 +272,15 @@ def main():
|
||||||
LibvirtGLib.init(None)
|
LibvirtGLib.init(None)
|
||||||
LibvirtGLib.event_register()
|
LibvirtGLib.event_register()
|
||||||
|
|
||||||
|
# Actually exit when we receive ctrl-c
|
||||||
|
from gi.repository import GLib
|
||||||
|
def _sigint_handler(user_data):
|
||||||
|
ignore = user_data
|
||||||
|
logging.debug("Received KeyboardInterrupt. Exiting application.")
|
||||||
|
sys.exit(0)
|
||||||
|
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, signal.SIGINT,
|
||||||
|
_sigint_handler, None)
|
||||||
|
|
||||||
engine = vmmEngine()
|
engine = vmmEngine()
|
||||||
|
|
||||||
engine.start(options.uri, show_window, domain, options.skip_autostart)
|
engine.start(options.uri, show_window, domain, options.skip_autostart)
|
||||||
|
|
Loading…
Reference in New Issue