Fix vcpu bug and memory-size-int issue

This commit is contained in:
Hugh O. Brock 2006-08-18 14:16:20 -04:00
parent 041e13cd27
commit 6cd257e5ed

View File

@ -229,7 +229,7 @@ class vmmCreate(gobject.GObject):
#avoid absurdity, hopefully #avoid absurdity, hopefully
if self.max_memory == 0: if self.max_memory == 0:
self.max_memory = max_mem / 2 self.max_memory = int(max_mem / 2)
if self.startup_memory > self.max_memory: if self.startup_memory > self.max_memory:
self.startup_memory = self.max_memory self.startup_memory = self.max_memory
@ -286,9 +286,9 @@ class vmmCreate(gobject.GObject):
"\n Install storage type: " + `self.storage_method` + \ "\n Install storage type: " + `self.storage_method` + \
"\n Install storage address: " + saddr + \ "\n Install storage address: " + saddr + \
"\n Install storage file size: " + sfs + \ "\n Install storage file size: " + sfs + \
"\n Install max kernel memory: " + `self.max_memory` + \ "\n Install max kernel memory: " + `int(self.max_memory)` + \
"\n Install startup kernel memory: " + `self.startup_memory` + \ "\n Install startup kernel memory: " + `int(self.startup_memory)` + \
"\n Install vcpus: " + `self.vcpus` "\n Install vcpus: " + `int(self.vcpus)`
# end DEBUG STUFF # end DEBUG STUFF
# first things first, are we trying to create a fully virt guest? # first things first, are we trying to create a fully virt guest?
@ -324,12 +324,15 @@ class vmmCreate(gobject.GObject):
# set the memory # set the memory
try: try:
guest.memory = self.max_memory guest.memory = int(self.max_memory)
except ValueError: except ValueError:
self._validation_error_box(_("Invalid memory setting"), e.args[0]) self._validation_error_box(_("Invalid memory setting"), e.args[0])
self.max_memory = None self.max_memory = None
return return
# set vcpus
guest.vcpus = int(self.vcpus)
# disks # disks
if self.storage_method == VM_STORAGE_PARTITION: if self.storage_method == VM_STORAGE_PARTITION:
saddr = self.storage_partition_address saddr = self.storage_partition_address