[Kimchi-devel] [PATCH] [Kimchi] Fix issue #1010: Convert disk size to bytes while attaching new disk to guest

Aline Manera alinefm at linux.vnet.ibm.com
Wed Sep 21 02:01:50 UTC 2016


The API POST /storagepools/*pool*/storagevolumes requires the disk size
in bytes and GB is used on UI. So do the proper convertion to bytes
before sending the request to server.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.guest_storage_add.main.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ui/js/src/kimchi.guest_storage_add.main.js b/ui/js/src/kimchi.guest_storage_add.main.js
index 29fccab..27f8f84 100644
--- a/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/ui/js/src/kimchi.guest_storage_add.main.js
@@ -377,8 +377,8 @@ kimchi.guest_storage_add_main = function() {
                     vol:  settings['vol'],
                     pool: settings['pool']
                 };
-                var sizeInMB = parseInt(settings['capacity']) * 1024;
-                settings['capacity'] = sizeInMB;
+                var sizeInBytes = parseInt(settings['capacity']) * 1024 * 1024 * 1024;
+                settings['capacity'] = sizeInBytes;
                 //These need to be deleted so they don't get passed to backend
                 delete settings['path'];
                 delete settings['newpool'];
-- 
2.5.5




More information about the Kimchi-devel mailing list