[gnome-boxes] libvirt-machine-props: No snapshots for host-passthrough



commit 33d08a7cb5f07aaa2858c6ba3c05b0c5957b387b
Author: Timm Bäder <mail baedert org>
Date:   Thu Sep 4 23:00:58 2014 +0200

    libvirt-machine-props: No snapshots for host-passthrough
    
    Since VMs with a cpu mode of host-passthrough can't cope with snapshots,
    just don't add the snapshtos page to the sidebar in the properties
    view in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=735685

 src/libvirt-machine-properties.vala |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 2cfc648..bdb20d4 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -277,7 +277,14 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
             break;
 
         case PropertiesPage.SNAPSHOTS:
-            add_snapshots_property (ref list, machine);
+            try {
+                var config = machine.domain.get_config (0);
+                // Snapshots currently don't work with host-passthrough
+                if (config.get_cpu ().get_mode () != GVirConfig.DomainCpuMode.HOST_PASSTHROUGH)
+                    add_snapshots_property (ref list, machine);
+            } catch (GLib.Error e) {
+                warning (e.message);
+            }
 
             break;
         }


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