diff -ur virt-manager-0.8.6/src/virtManager/clone.py virt-manager-0.8.6-fixed/src/virtManager/clone.py --- virt-manager-0.8.6/src/virtManager/clone.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/clone.py 2011-05-23 13:09:16.000000000 -0500 @@ -672,7 +672,9 @@ def pretty_storage(self, size): if not size: return "" - return "%.1f GB" % float(size) + # size comes in as GiB + size = size * 1024.0**3 / 1000.0**3 + return "%.1f GB" % size # Listeners def validate(self): diff -ur virt-manager-0.8.6/src/virtManager/connection.py virt-manager-0.8.6-fixed/src/virtManager/connection.py --- virt-manager-0.8.6/src/virtManager/connection.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/connection.py 2011-05-23 13:09:16.000000000 -0500 @@ -285,9 +285,9 @@ return "" mem = self.host_memory_size() if mem > (10 * 1024 * 1024): - return "%2.2f GB" % (mem / (1024.0 * 1024.0)) + return "%2.2f GiB" % (mem / (1024.0 * 1024.0)) else: - return "%2.0f MB" % (mem / 1024.0) + return "%2.0f MiB" % (mem / 1024.0) def host_memory_size(self): if self.vmm is None: @@ -1668,9 +1668,9 @@ def pretty_current_memory(self): mem = self.current_memory() if mem > (10 * 1024 * 1024): - return "%2.2f GB" % (mem / (1024.0 * 1024.0)) + return "%2.2f GiB" % (mem / (1024.0 * 1024.0)) else: - return "%2.0f MB" % (mem / 1024.0) + return "%2.0f MiB" % (mem / 1024.0) def current_memory_percentage(self): if len(self.record) == 0: diff -ur virt-manager-0.8.6/src/virtManager/create.py virt-manager-0.8.6-fixed/src/virtManager/create.py --- virt-manager-0.8.6/src/virtManager/create.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/create.py 2011-05-23 13:09:16.000000000 -0500 @@ -1675,10 +1675,12 @@ return True def pretty_storage(self, size): - return "%.1f Gb" % float(size) + # size comes in as GiB + size = size * 1024.0**3 / 1000.0**3 + return "%.1f GB" % size def pretty_memory(self, mem): - return "%d MB" % (mem / 1024.0) + return "%d MiB" % (mem / 1024.0) # Distro detection methods diff -ur virt-manager-0.8.6/src/virtManager/details.py virt-manager-0.8.6-fixed/src/virtManager/details.py --- virt-manager-0.8.6/src/virtManager/details.py 2011-05-23 15:03:47.000000000 -0500 +++ virt-manager-0.8.6-fixed/src/virtManager/details.py 2011-05-23 13:09:16.000000000 -0500 @@ -115,10 +115,10 @@ return fmt % int(val) def prettyify_bytes(val): - if val > (1024 * 1024 * 1024): - return "%2.2f GB" % (val / (1024.0 * 1024.0 * 1024.0)) + if val > (1000 * 1000 * 1000): + return "%2.2f GB" % (val / (1000.0 * 1000.0 * 1000.0)) else: - return "%2.2f MB" % (val / (1024.0 * 1024.0)) + return "%2.2f MB" % (val / (1000.0 * 1000.0)) def build_hostdev_label(hostdev): # String shown in the devices details section @@ -1972,7 +1972,7 @@ vm_memory = self.vm.current_memory() host_memory = self.vm.get_connection().host_memory_size() - mem_txt = "%d MB of %d MB" % (int(round(vm_memory / 1024.0)), + mem_txt = "%d MiB of %d MiB" % (int(round(vm_memory / 1024.0)), int(round(host_memory / 1024.0))) if self.config.get_stats_enable_disk_poll(): @@ -2088,7 +2088,7 @@ vm_cur_mem = self.vm.get_memory() / 1024.0 vm_max_mem = self.vm.maximum_memory() / 1024.0 - host_mem_widget.set_text("%d MB" % (int(round(host_mem)))) + host_mem_widget.set_text("%d MiB" % (int(round(host_mem)))) curmem = self.window.get_widget("config-memory").get_adjustment() maxmem = self.window.get_widget("config-maxmem").get_adjustment() @@ -2350,7 +2350,7 @@ ram = vid.vram heads = vid.heads try: - ramlabel = ram and "%d MB" % (int(ram) / 1024) or "-" + ramlabel = ram and "%d MiB" % (int(ram) / 1024) or "-" except: ramlabel = "-" diff -ur virt-manager-0.8.6/src/virtManager/domain.py virt-manager-0.8.6-fixed/src/virtManager/domain.py --- virt-manager-0.8.6/src/virtManager/domain.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/domain.py 2011-05-23 13:09:16.000000000 -0500 @@ -763,22 +763,22 @@ def current_memory_pretty(self): if self.get_id() == -1: - return "0 MB" + return "0 MiB" return self.get_memory_pretty() def get_memory_pretty(self): mem = self.get_memory() if mem > (10 * 1024 * 1024): - return "%2.2f GB" % (mem / (1024.0 * 1024.0)) + return "%2.2f GiB" % (mem / (1024.0 * 1024.0)) else: - return "%2.0f MB" % (mem / 1024.0) + return "%2.0f MiB" % (mem / 1024.0) def maximum_memory_pretty(self): mem = self.maximum_memory() if mem > (10 * 1024 * 1024): - return "%2.2f GB" % (mem / (1024.0 * 1024.0)) + return "%2.2f GiB" % (mem / (1024.0 * 1024.0)) else: - return "%2.0f MB" % (mem / 1024.0) + return "%2.0f MiB" % (mem / 1024.0) def cpu_time_pretty(self): return "%2.2f %%" % self.cpu_time_percentage() diff -ur virt-manager-0.8.6/src/virtManager/storagepool.py virt-manager-0.8.6-fixed/src/virtManager/storagepool.py --- virt-manager-0.8.6/src/virtManager/storagepool.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/storagepool.py 2011-05-23 13:09:16.000000000 -0500 @@ -141,9 +141,9 @@ def _prettyify(self, val): - if val > (1024 * 1024 * 1024): - return "%2.2f GB" % (val / (1024.0 * 1024.0 * 1024.0)) + if val > (1000 * 1000 * 1000): + return "%2.2f GB" % (val / (1000.0 * 1000.0 * 1000.0)) else: - return "%2.2f MB" % (val / (1024.0 * 1024.0)) + return "%2.2f MB" % (val / (1000.0 * 1000.0)) vmmLibvirtObject.type_register(vmmStoragePool) diff -ur virt-manager-0.8.6/src/virtManager/storagevol.py virt-manager-0.8.6-fixed/src/virtManager/storagevol.py --- virt-manager-0.8.6/src/virtManager/storagevol.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/storagevol.py 2011-05-23 13:09:16.000000000 -0500 @@ -68,9 +68,9 @@ return util.get_xml_path(self.get_xml(), "/volume/format/@type") def _prettyify(self, val): - if val > (1024 * 1024 * 1024): - return "%2.2f GB" % (val / (1024.0 * 1024.0 * 1024.0)) + if val > (1000 * 1000 * 1000): + return "%2.2f GB" % (val / (1000.0 * 1000.0 * 1000.0)) else: - return "%2.2f MB" % (val / (1024.0 * 1024.0)) + return "%2.2f MB" % (val / (1000.0 * 1000.0)) vmmLibvirtObject.type_register(vmmStorageVolume) diff -ur virt-manager-0.8.6/src/virtManager/uihelpers.py virt-manager-0.8.6-fixed/src/virtManager/uihelpers.py --- virt-manager-0.8.6/src/virtManager/uihelpers.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManager/uihelpers.py 2011-05-23 13:09:16.000000000 -0500 @@ -92,7 +92,9 @@ return 0 def pretty_storage(size): - return "%.1f Gb" % float(size) + # size comes in as GiB + size = size * 1024.0**3 / 1000.0**3 + return "%.1f GB" % size hd_label = ("%s available in the default location" % pretty_storage(max_storage)) diff -ur virt-manager-0.8.6/src/virtManagerTui/adddomain.py virt-manager-0.8.6-fixed/src/virtManagerTui/adddomain.py --- virt-manager-0.8.6/src/virtManagerTui/adddomain.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManagerTui/adddomain.py 2011-05-23 13:09:16.000000000 -0500 @@ -495,7 +495,7 @@ grid.setField(Label("Install:"), 0, 1, anchorRight = 1) grid.setField(Label(self.__config.get_install_type_text()), 1, 1, anchorLeft = 1) grid.setField(Label("Memory:"), 0, 2, anchorRight = 1) - grid.setField(Label("%s MB" % self.__config.get_memory()), 1, 2, anchorLeft = 1) + grid.setField(Label("%s MiB" % self.__config.get_memory()), 1, 2, anchorLeft = 1) grid.setField(Label("CPUs:"), 0, 3, anchorRight = 1) grid.setField(Label("%d" % self.__config.get_cpus()), 1, 3, anchorLeft = 1) grid.setField(Label("Storage:"), 0, 4, anchorRight = 1) diff -ur virt-manager-0.8.6/src/virtManagerTui/configscreen.py virt-manager-0.8.6-fixed/src/virtManagerTui/configscreen.py --- virt-manager-0.8.6/src/virtManagerTui/configscreen.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManagerTui/configscreen.py 2011-05-23 13:09:16.000000000 -0500 @@ -248,7 +248,7 @@ self.__volumes_list = Listbox(0) for volname in pool.listVolumes(): volume = pool.storageVolLookupByName(volname) - self.__volumes_list.append("%s (%0.2f GB)" % (volume.name(), volume.info()[2] / 1024**3), volume.name()) + self.__volumes_list.append("%s (%0.2f GB)" % (volume.name(), volume.info()[2] / 1000**3), volume.name()) result = self.__volumes_list else: self.__has_volumes = False diff -ur virt-manager-0.8.6/src/virtManagerTui/utils.py virt-manager-0.8.6-fixed/src/virtManagerTui/utils.py --- virt-manager-0.8.6/src/virtManagerTui/utils.py 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/virtManagerTui/utils.py 2011-05-23 13:09:16.000000000 -0500 @@ -37,8 +37,8 @@ def size_as_mb_or_gb(size): '''Takes a size value in bytes and returns it as either a value in megabytes or gigabytes.''' - if size / 1024.0**3 < 1.0: - result = "%0.2f MB" % (size / 1024.0**2) + if size / 1000.0**3 < 1.0: + result = "%0.2f MB" % (size / 1000.0**2) else: - result = "%0.2f GB" % (size / 1024.0**3) + result = "%0.2f GB" % (size / 1000.0**3) return result diff -ur virt-manager-0.8.6/src/vmm-create.glade virt-manager-0.8.6-fixed/src/vmm-create.glade --- virt-manager-0.8.6/src/vmm-create.glade 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/vmm-create.glade 2011-05-23 13:09:16.000000000 -0500 @@ -1123,7 +1123,7 @@ True 0 - MB + MiB 2 diff -ur virt-manager-0.8.6/src/vmm-create-net.glade virt-manager-0.8.6-fixed/src/vmm-create-net.glade --- virt-manager-0.8.6/src/vmm-create-net.glade 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/vmm-create-net.glade 2011-05-23 13:09:16.000000000 -0500 @@ -1453,7 +1453,7 @@ True 0 - 5 GB + 2 diff -ur virt-manager-0.8.6/src/vmm-details.glade virt-manager-0.8.6-fixed/src/vmm-details.glade --- virt-manager-0.8.6/src/vmm-details.glade 2011-05-23 15:03:47.000000000 -0500 +++ virt-manager-0.8.6-fixed/src/vmm-details.glade 2011-05-23 13:09:16.000000000 -0500 @@ -1712,8 +1712,8 @@ True 0 - 30 MB of -128 MB + 30 MiB of +128 MiB 2 @@ -2642,7 +2642,7 @@ True 0 - 2 GB + 2 GiB True @@ -2677,7 +2677,7 @@ True - MB + MiB False @@ -2720,7 +2720,7 @@ True - MB + MiB False diff -ur virt-manager-0.8.6/src/vmm-host.glade virt-manager-0.8.6-fixed/src/vmm-host.glade --- virt-manager-0.8.6/src/vmm-host.glade 2011-01-14 14:53:29.000000000 -0600 +++ virt-manager-0.8.6-fixed/src/vmm-host.glade 2011-05-23 13:09:16.000000000 -0500 @@ -237,7 +237,7 @@ True 0 - 2000 MB + 2000 MiB 1 @@ -411,7 +411,7 @@ True 0 - 1.59 GB of 2.2 GB + 1.59 GiB of 2.2 GiB 2