Fixes 213855. Added documentation to warn the operator not to allocate too much memory to a new VM; limited the max memory spinbox to physical RAM present; cleaned up physical RAM display.

This commit is contained in:
Hugh O. Brock 2006-12-07 15:55:50 -05:00
parent 64cc1fdee6
commit ba20edec8c
2 changed files with 12 additions and 6 deletions

View File

@ -8182,7 +8182,7 @@ TB</property>
<child>
<widget class="GtkLabel" id="label338">
<property name="visible">True</property>
<property name="label" translatable="yes">VM _Startup Memory:</property>
<property name="label" translatable="yes">VM _Startup Memory (MB):</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -8211,7 +8211,7 @@ TB</property>
<child>
<widget class="GtkLabel" id="label337">
<property name="visible">True</property>
<property name="label" translatable="yes">VM _Max Memory:</property>
<property name="label" translatable="yes">VM _Max Memory (MB):</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
@ -8296,9 +8296,9 @@ TB</property>
<child>
<widget class="GtkLabel" id="label272">
<property name="visible">True</property>
<property name="label" translatable="yes">Please enter the memory configuration for this VM. You can specify the maximum amount of memory the VM should be able to use, and optionally a lower amount to grab on startup.</property>
<property name="label" translatable="yes">Please enter the memory configuration for this VM. You can specify the maximum amount of memory the VM should be able to use, and optionally a lower amount to grab on startup. Warning: setting VM memory too high will cause out-of-memory errors in your host domain!</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>

View File

@ -141,8 +141,9 @@ class vmmCreate(gobject.GObject):
ks_url_list.set_text_column(0)
self.window.get_widget("create-cpus-physical").set_text(str(self.connection.host_maximum_processor_count()))
memory = int(self.connection.host_memory_size())/1024
self.window.get_widget("create-host-memory").set_text("%d GB" % memory)
memory = int(self.connection.host_memory_size())
self.window.get_widget("create-host-memory").set_text(self.pretty_memory(memory))
self.window.get_widget("create-memory-max").set_range(50, memory/1024)
def reset_state(self):
notebook = self.window.get_widget("create-pages")
@ -681,4 +682,9 @@ class vmmCreate(gobject.GObject):
# pygtk throws a bogus type error here, ignore it
return
def pretty_memory(self, mem):
if mem > (1024*1024):
return "%2.2f GB" % (mem/(1024.0*1024.0))
else:
return "%2.2f MB" % (mem/1024.0)