[gnome-boxes/gnome-3-26] Revert "libvirt-machine-props: Allow resize of disk w/ snapshots"



commit a7a2fd8db0da3c2ec17824050d167a235e6af1cb
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Oct 31 11:58:12 2017 +0100

    Revert "libvirt-machine-props: Allow resize of disk w/ snapshots"
    
    This reverts commit 6d05a73c213f63015ac9a1775e751cdbc6f71722.

 src/libvirt-machine-properties.vala |   44 -----------------------------------
 1 files changed, 0 insertions(+), 44 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 1cc49cd..8b99121 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -523,36 +523,6 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
         if (machine.storage_volume == null)
             return;
 
-        List<GVir.DomainSnapshot> snapshots;
-        try {
-            snapshots = yield get_snapshots (null);
-        } catch (GLib.Error e) {
-            warning ("Error fetching snapshots for %s: %s", machine.name, e.message);
-            snapshots = new List<GVir.DomainSnapshot> ();
-        }
-
-        var num_snapshots = snapshots.length ();
-        if (num_snapshots != 0) {
-            // qemu-img doesn't support resizing disk image with snapshots:
-            // https://bugs.launchpad.net/qemu/+bug/1563931
-            var msg = ngettext ("Storage resize requires deleting associated snapshot.",
-                                "Storage resize requires deleting %llu associated snapshots.",
-                                num_snapshots).printf (num_snapshots);
-
-            Notification.OKFunc undo = () => {
-                debug ("Storage resize of '%s' cancelled by user.", machine.name);
-            };
-
-            Notification.DismissFunc really_resize = () => {
-                debug ("User did not cancel storage resize of '%s'. Deleting all snapshots..", machine.name);
-                force_change_storage_size.begin (property, value);
-            };
-
-            machine.window.notificationbar.display_for_action (msg, _("_Undo"), (owned) undo, (owned) 
really_resize);
-
-            return;
-        }
-
         try {
             if (machine.is_running) {
                 var disk = machine.get_domain_disk ();
@@ -585,20 +555,6 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
         }
     }
 
-    private async void force_change_storage_size (Boxes.Property property, uint64 value) {
-        try {
-            var snapshots = yield get_snapshots (null);
-
-            foreach (var snapshot in snapshots) {
-                yield snapshot.delete_async (0, null);
-            }
-
-            change_storage_size.begin (property, value);
-        } catch (GLib.Error e) {
-            warning ("Error while deleting snapshots: %s", e.message);
-        }
-    }
-
     private uint64 get_minimum_disk_size () throws GLib.Error {
         var volume_info = machine.storage_volume.get_info ();
         if (machine.vm_creator == null) {


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