Changeset 2161 for trunk/packages/invirt-remote
- Timestamp:
- Feb 17, 2009, 5:01:23 AM (16 years ago)
- Location:
- trunk/packages/invirt-remote
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-remote/debian/changelog
r2135 r2161 1 invirt-remote (0.3.6) unstable; urgency=low 2 3 * Don't confuse KB with KiB, or MB with MiB. 4 5 -- Anders Kaseorg <andersk@mit.edu> Tue, 17 Feb 2009 04:58:06 -0500 6 1 7 invirt-remote (0.3.5) unstable; urgency=low 2 8 -
trunk/packages/invirt-remote/host/usr/sbin/invirt-availability
r2114 r2161 9 9 import os 10 10 11 # return the amount of memory in ki lobytes represented by s11 # return the amount of memory in kibibytes represented by s 12 12 def parseUnits(s): 13 13 num, unit = s.split(' ') 14 return int(num) * {'kb':1, 'mb':1024}[unit.lower()] 14 assert unit == 'kB', "unexpected unit" 15 return int(num) 15 16 16 17 def main(argv): 17 18 """ 18 19 Calculate the amount of memory available for new VMs 19 The numbers returned by xm info and xm info -c are in M B20 The numbers in /proc/xen/balloon have nice units21 All math is done in ki lobytes for consistency22 Output is in M B20 The numbers returned by xm info and xm info -c are in MiB 21 The numbers in /proc/xen/balloon are in KiB 22 All math is done in kibibytes for consistency 23 Output is in MiB 23 24 24 25 Bail if /etc/invirt/nocreate exists … … 51 52 xminfoc = yaml.load(output, yaml.CSafeLoader) 52 53 53 # In ki lobytes54 # In kibibytes 54 55 dom0minmem = int(xminfoc['dom0-min-mem']) * 1024 55 56 -
trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-create
r2135 r2161 72 72 max_memory = maxMemory(owner, vms.keys()) 73 73 if vm_memory > max_memory: 74 print >>sys.stderr, "owner %s requested %d M B of memory for vm %s; %d MB allowed" % (owner, vm_memory, machine_name, max_memory)74 print >>sys.stderr, "owner %s requested %d MiB of memory for vm %s; %d MiB allowed" % (owner, vm_memory, machine_name, max_memory) 75 75 return 1 76 76
Note: See TracChangeset
for help on using the changeset viewer.