Index: trunk/packages/invirt-autoinstaller/common/usr/sbin/invirt-create-image
===================================================================
--- trunk/packages/invirt-autoinstaller/common/usr/sbin/invirt-create-image	(revision 2158)
+++ trunk/packages/invirt-autoinstaller/common/usr/sbin/invirt-create-image	(revision 2161)
@@ -3,5 +3,5 @@
 # "arguments" come in environment:
 #  TARGET a device filename
-#  FSSIZE the desired filesystem size in megabytes (rest will be swap)
+#  FSSIZE the desired filesystem size in mebibytes (rest will be swap)
 #  ARCH, DIST, MIRROR
 #  HOSTNAME, IP
Index: trunk/packages/invirt-autoinstaller/debian/changelog
===================================================================
--- trunk/packages/invirt-autoinstaller/debian/changelog	(revision 2158)
+++ trunk/packages/invirt-autoinstaller/debian/changelog	(revision 2161)
@@ -1,2 +1,8 @@
+invirt-autoinstaller (0.0.14) jaunty; urgency=low
+
+  * Don't confuse MB with MiB.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Feb 2009 04:56:38 -0500
+
 invirt-autoinstaller (0.0.13) unstable; urgency=low
 
Index: trunk/packages/invirt-autoinstaller/host/usr/sbin/invirt-install
===================================================================
--- trunk/packages/invirt-autoinstaller/host/usr/sbin/invirt-install	(revision 2158)
+++ trunk/packages/invirt-autoinstaller/host/usr/sbin/invirt-install	(revision 2161)
@@ -13,6 +13,6 @@
 export DIST="$3"
 export MIRROR="$4"
-export FSSIZE="$5"    # in megabytes
-SWAPSIZE="$6"  # in megabytes
+export FSSIZE="$5"    # in mebibytes
+SWAPSIZE="$6"  # in mebibytes
 export IP="$7"
 
@@ -20,5 +20,5 @@
 VGNAME=xenvg
 
-#LVSIZE=`lvs --noheadings --units M --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'`
+#LVSIZE=`lvs --noheadings --units m --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'`
 
 if [ -z "$IP" ]; then
@@ -26,5 +26,5 @@
 fi
 
-/sbin/lvcreate -L $(($FSSIZE+$SWAPSIZE))M -n "${NAME}_hda" $VGNAME
+/sbin/lvcreate -L $(($FSSIZE+$SWAPSIZE))m -n "${NAME}_hda" $VGNAME
 
 export TARGET=/dev/mapper/xenvg-"$(echo "${NAME}_hda" | sed -e 's/-/--/g')"
Index: trunk/packages/invirt-remote/debian/changelog
===================================================================
--- trunk/packages/invirt-remote/debian/changelog	(revision 2158)
+++ trunk/packages/invirt-remote/debian/changelog	(revision 2161)
@@ -1,2 +1,8 @@
+invirt-remote (0.3.6) unstable; urgency=low
+
+  * Don't confuse KB with KiB, or MB with MiB.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Feb 2009 04:58:06 -0500
+
 invirt-remote (0.3.5) unstable; urgency=low
 
Index: trunk/packages/invirt-remote/host/usr/sbin/invirt-availability
===================================================================
--- trunk/packages/invirt-remote/host/usr/sbin/invirt-availability	(revision 2158)
+++ trunk/packages/invirt-remote/host/usr/sbin/invirt-availability	(revision 2161)
@@ -9,16 +9,17 @@
 import os
 
-# return the amount of memory in kilobytes represented by s
+# return the amount of memory in kibibytes represented by s
 def parseUnits(s):
     num, unit = s.split(' ')
-    return int(num) * {'kb':1, 'mb':1024}[unit.lower()]
+    assert unit == 'kB', "unexpected unit"
+    return int(num)
 
 def main(argv):
     """
     Calculate the amount of memory available for new VMs
-    The numbers returned by xm info and xm info -c are in MB
-    The numbers in /proc/xen/balloon have nice units
-    All math is done in kilobytes for consistency
-    Output is in MB
+    The numbers returned by xm info and xm info -c are in MiB
+    The numbers in /proc/xen/balloon are in KiB
+    All math is done in kibibytes for consistency
+    Output is in MiB
 
     Bail if /etc/invirt/nocreate exists
@@ -51,5 +52,5 @@
     xminfoc = yaml.load(output, yaml.CSafeLoader)
 
-    # In kilobytes
+    # In kibibytes
     dom0minmem = int(xminfoc['dom0-min-mem']) * 1024
 
Index: trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-create
===================================================================
--- trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-create	(revision 2158)
+++ trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-create	(revision 2161)
@@ -72,5 +72,5 @@
         max_memory = maxMemory(owner, vms.keys())
         if vm_memory > max_memory:
-            print >>sys.stderr, "owner %s requested %d MB of memory for vm %s; %d MB allowed" % (owner, vm_memory, machine_name, max_memory)
+            print >>sys.stderr, "owner %s requested %d MiB of memory for vm %s; %d MiB allowed" % (owner, vm_memory, machine_name, max_memory)
             return 1
 
Index: trunk/packages/invirt-web/code/main.py
===================================================================
--- trunk/packages/invirt-web/code/main.py	(revision 2158)
+++ trunk/packages/invirt-web/code/main.py	(revision 2161)
@@ -480,5 +480,5 @@
                     'Quotas': """
 Quotas are determined on a per-locker basis.  Each locker may have a
-maximum of 512 megabytes of active ram, 50 gigabytes of disk, and 4
+maximum of 512 mebibytes of active ram, 50 gibibytes of disk, and 4
 active machines.""",
                     'Console': """
@@ -489,5 +489,5 @@
 """,
                     'Windows': """
-<strong>Windows Vista:</strong> The Vista image is licensed for all MIT students and will automatically activate off the network; see <a href="/static/msca-email.txt">the licensing confirmation e-mail</a> for details. The installer req	uires 512 MB RAM and at least 7.5 GB disk space (15 GB or more recommended).<br>
+<strong>Windows Vista:</strong> The Vista image is licensed for all MIT students and will automatically activate off the network; see <a href="/static/msca-email.txt">the licensing confirmation e-mail</a> for details. The installer requires 512 MiB RAM and at least 7.5 GiB disk space (15 GiB or more recommended).<br>
 <strong>Windows XP:</strong> This is the volume license CD image. You will need your own volume license key to complete the install. We do not have these available for the general MIT community; ask your department if they have one.
 """
Index: trunk/packages/invirt-web/debian/changelog
===================================================================
--- trunk/packages/invirt-web/debian/changelog	(revision 2158)
+++ trunk/packages/invirt-web/debian/changelog	(revision 2161)
@@ -1,2 +1,8 @@
+invirt-web (0.0.20) unstable; urgency=low
+
+  * Don't confuse MB with MiB, or GB with GiB.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Tue, 17 Feb 2009 04:54:54 -0500
+
 invirt-web (0.0.19) unstable; urgency=low
 
Index: trunk/scripts/invirt-admin/invirt-admin
===================================================================
--- trunk/scripts/invirt-admin/invirt-admin	(revision 2158)
+++ trunk/scripts/invirt-admin/invirt-admin	(revision 2161)
@@ -9,5 +9,5 @@
     echo "    --hostname, --ip, --mac, --arch, --dist, --mirror"
     echo
-    echo "  fs-size, swap-size, memory in MB"
+    echo "  fs-size, swap-size, memory in MiB"
     echo "  fs-size + swap-size will be total disk-image size"
     exit 2
