[gnome-boxes] libvirt-machine-props: Volume size is correct units



commit 5b51ef66d0aa4cecc91af30801da79f9730f0634
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Wed Mar 12 22:41:04 2014 +0000

    libvirt-machine-props: Volume size is correct units
    
    GVir.DomainDisk.resize expects values in KiB.
    
    I'm not entirely sure if it helps with the following bug but my guess is
    that it does as the disk capacity really must have been set to that
    insane value because of the issue this bug fixes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725384

 src/libvirt-machine-properties.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index 2e71d17..27c76ae 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -494,8 +494,10 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
             try {
                 if (machine.is_running ()) {
                     var disk = machine.get_domain_disk ();
-                    if (disk != null)
-                        disk.resize (value, 0);
+                    if (disk != null) {
+                        var size = (value + Osinfo.KIBIBYTES - 1) / Osinfo.KIBIBYTES;
+                        disk.resize (size, 0);
+                    }
                 } else
                     machine.storage_volume.resize (value, StorageVolResizeFlags.NONE);
                 debug ("Storage changed to %llu", value);


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