Gerrit Slomma | 2 Apr 00:59
Picon

fix for presenting memory allocation of host and/or vm

Hello

I found the presentation of the memory allocation of host and/or vm
annoying, e.g. hosts/vms with more then one GB showed up in
virtual-manager with x.yy GBwhereas hosts/vms with less or equal to on
GB showed up as xxxx.yy MB. In details of hosts this also showed up.
I changed this behavior to showing GB if memory is >10 GB and set
MB-presentation to 2.0f.
I find it clearer, what is your opinion?

--- a/src/virtManager/domain.py       2009-04-01 23:19:28.000000000 +0200
+++ b/src/virtManager/domain.py       2009-04-02 00:28:44.000000000 +0200
@@ -379,7 +379,7 @@

     def current_memory_pretty(self):
         if self.get_id() == -1:
-            return "0.00 MB"
+            return "0 MB"
         return self.get_memory_pretty()

@@ -400,10 +400,10 @@

     def get_memory_pretty(self):
         mem = self.get_memory()
-        if mem > (1024*1024):
+        if mem > (10*1024*1024):
             return "%2.2f GB" % (mem/(1024.0*1024.0))
         else:
-            return "%2.2f MB" % (mem/1024.0)
+            return "%2.0f MB" % (mem/1024.0)
(Continue reading)

Cole Robinson | 20 Apr 18:35
Picon
Favicon

Re: fix for presenting memory allocation of host and/or vm

On 04/01/2009 06:59 PM, Gerrit Slomma wrote:
> Hello
> 
> I found the presentation of the memory allocation of host and/or vm
> annoying, e.g. hosts/vms with more then one GB showed up in
> virtual-manager with x.yy GBwhereas hosts/vms with less or equal to on
> GB showed up as xxxx.yy MB. In details of hosts this also showed up.
> I changed this behavior to showing GB if memory is >10 GB and set
> MB-presentation to 2.0f.
> I find it clearer, what is your opinion?
> 

I agree. I've applied the patch:

http://hg.et.redhat.com/cgi-bin/hg-virt.cgi/applications/virt-manager--devel/rev/c8798a8e9c6e

Thanks,
Cole

Gmane