|
|
dd4c2a |
From 57e4fdbc608b96ee261cf64e14aa267338b213f4 Mon Sep 17 00:00:00 2001
|
|
|
dd4c2a |
From: "Zeeshan Ali (Khattak)" <zeeshanak@gnome.org>
|
|
|
dd4c2a |
Date: Wed, 12 Mar 2014 22:41:04 +0000
|
|
|
dd4c2a |
Subject: [PATCH 1/2] libvirt-machine-props: Volume size is correct units
|
|
|
dd4c2a |
|
|
|
dd4c2a |
GVir.DomainDisk.resize expects values in KiB.
|
|
|
dd4c2a |
|
|
|
dd4c2a |
I'm not entirely sure if it helps with the following bug but my guess is
|
|
|
dd4c2a |
that it does as the disk capacity really must have been set to that
|
|
|
dd4c2a |
insane value because of the issue this bug fixes.
|
|
|
dd4c2a |
|
|
|
dd4c2a |
https://bugzilla.gnome.org/show_bug.cgi?id=725384
|
|
|
dd4c2a |
---
|
|
|
dd4c2a |
src/libvirt-machine-properties.vala | 6 ++++--
|
|
|
dd4c2a |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
dd4c2a |
|
|
|
dd4c2a |
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
|
|
|
dd4c2a |
index 82d0a87..97dcd85 100644
|
|
|
dd4c2a |
--- a/src/libvirt-machine-properties.vala
|
|
|
dd4c2a |
+++ b/src/libvirt-machine-properties.vala
|
|
|
dd4c2a |
@@ -566,8 +566,10 @@ private void on_storage_changed (Boxes.Property property, uint64 value) {
|
|
|
dd4c2a |
try {
|
|
|
dd4c2a |
if (machine.is_running ()) {
|
|
|
dd4c2a |
var disk = machine.get_domain_disk ();
|
|
|
dd4c2a |
- if (disk != null)
|
|
|
dd4c2a |
- disk.resize (value, 0);
|
|
|
dd4c2a |
+ if (disk != null) {
|
|
|
dd4c2a |
+ var size = (value + Osinfo.KIBIBYTES - 1) / Osinfo.KIBIBYTES;
|
|
|
dd4c2a |
+ disk.resize (size, 0);
|
|
|
dd4c2a |
+ }
|
|
|
dd4c2a |
} else
|
|
|
dd4c2a |
// Currently this never happens as properties page cant be reached without starting the machine
|
|
|
dd4c2a |
machine.storage_volume.resize (value, StorageVolResizeFlags.NONE);
|
|
|
dd4c2a |
--
|
|
|
dd4c2a |
2.1.0
|
|
|
dd4c2a |
|