From 47669aac4ecb1d0b5d70f86b3b85957784af42d8 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sat, 13 Apr 2013 03:12:58 +0200 Subject: [PATCH] Replace direct xl calls with proper QubesVM methods --- qubesmanager/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 4521065..89c6a39 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -1394,7 +1394,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): if vm.is_paused(): try: - subprocess.check_call (["/usr/sbin/xl", "unpause", vm.name]) + vm.unpause() except Exception as ex: QMessageBox.warning (None, "Error unpausing VM!", "ERROR: {0}".format(ex)) return @@ -1432,8 +1432,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): vm = self.get_selected_vm() assert vm.is_running() try: - subprocess.check_call (["/usr/sbin/xl", "pause", vm.name]) - + vm.pause() except Exception as ex: QMessageBox.warning (None, "Error pausing VM!", "ERROR: {0}".format(ex)) return @@ -1458,7 +1457,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): def shutdown_vm(self, vm, shutdown_time = vm_shutdown_timeout): try: - subprocess.check_call (["/usr/sbin/xl", "shutdown", vm.name]) + vm.shutdown() except Exception as ex: QMessageBox.warning (None, "Error shutting down VM!", "ERROR: {0}".format(ex)) return