[gnome-boxes/wip/feborges/pause-vms: 28/28] selectionbar: Don't Pause machines that aren't running



commit a06f5bbbe30a405971b33cd0e2d2cdcb19d722df
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Jan 11 17:29:16 2018 +0100

    selectionbar: Don't Pause machines that aren't running
    
    The "Pause" action maps to libvirt's "save" functionality, which
    consists of the process of taking a running guest and saving its
    memory state to a file[0].
    
    In doing so, pausing a non-running machine is useless and would
    trigger a "Pausing $VM_NAME failed" warning.
    
    [0] https://libvirt.org/guide/html/Application_Development_Guide-Lifecycle-Save.html
    
    Resolves #139

 src/selectionbar.vala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/selectionbar.vala b/src/selectionbar.vala
index 272abcf7..de78a050 100644
--- a/src/selectionbar.vala
+++ b/src/selectionbar.vala
@@ -107,7 +107,7 @@ private void update_pause_btn () {
                 continue;
 
             var machine = item as Machine;
-            if (machine.can_save) {
+            if (machine.can_save && machine.is_running) {
                 sensitive = true;
 
                 break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]