[gnome-boxes] Disallow changing of system props during install



commit 59dbcc59474652253ccf99e77f7f26b99dde82ae
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Mar 12 03:16:25 2013 +0200

    Disallow changing of system props during install
    
    Changing of system properties require a reboot and rebooting the machine
    in the middle of an installation/live session is not a good idea. More so
    since we track end of installation/live session through number of
    reboots, especially in case of live session where we automatically remove
    the machine on shutdown/reboot if no installation was performed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=690779

 src/libvirt-machine-properties.vala |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 446ba54..9957d12 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -405,7 +405,11 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                                               max_ram * Osinfo.KIBIBYTES,
                                               64 * Osinfo.MEBIBYTES,
                                               FormatSizeFlags.IEC_UNITS);
-            property.changed.connect (on_ram_changed);
+            if (VMConfigurator.is_install_config (machine.domain_config) ||
+                VMConfigurator.is_live_config (machine.domain_config))
+                property.sensitive = false;
+            else
+                property.changed.connect (on_ram_changed);
 
             this.notify["state"].connect (() => {
                 if (!machine.is_on ())
@@ -516,7 +520,11 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                                               volume_info.capacity,
                                               max_storage,
                                               256 * MEGABYTES);
-            property.changed.connect (on_storage_changed);
+            if (VMConfigurator.is_install_config (machine.domain_config) ||
+                VMConfigurator.is_live_config (machine.domain_config))
+                property.sensitive = false;
+            else
+                property.changed.connect (on_storage_changed);
 
             return property;
         } catch (GLib.Error error) {


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