Show max vcpus in create wizard, set to accurate value based on specified guest type.

This commit is contained in:
Cole Robinson 2008-04-08 15:22:53 -04:00
parent 1da5172865
commit f7acb3c54c
2 changed files with 183 additions and 117 deletions

View File

@ -816,6 +816,10 @@ class vmmCreate(gobject.GObject):
startup_mem_adjustment.value = max_memory
startup_mem_adjustment.upper = max_memory
def set_max_vcpus(self, type):
self.window.get_widget("create-vcpus").get_adjustment().upper = self.connection.get_max_vcpus(type)
self.window.get_widget("config-max-vcpus").set_text(str(self.connection.get_max_vcpus(type)))
def validate(self, page_num):
# Setting the values in the Guest/Disk/Network virtinst objects
@ -842,6 +846,12 @@ class vmmCreate(gobject.GObject):
self._guest.name = name # Transfer name over
# Set vcpu limits based on guest type
try:
self.set_max_vcpus(self.get_domain_type())
except Exception, e:
logging.exception(e)
elif page_num == PAGE_INST:
if self.get_config_method() == VM_PARA_VIRT:
os_type = "xen"

View File

@ -4019,7 +4019,7 @@
<widget class="GtkTable" id="table28">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="n_rows">11</property>
<property name="n_rows">12</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
@ -4281,36 +4281,6 @@
</packing>
</child>
<child>
<widget class="GtkLabel" id="label339">
<property name="visible">True</property>
<property name="label" translatable="yes">_VCPUs:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">create-vcpus</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="x_padding">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label278">
<property name="visible">True</property>
@ -4339,92 +4309,6 @@
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox37">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkAlignment" id="alignment106">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.10000000149</property>
<property name="xscale">1</property>
<property name="yscale">0.10000000149</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">5</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkImage" id="image88">
<property name="visible">True</property>
<property name="stock">gtk-info</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment107">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">3</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkLabel" id="label280">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;b&gt;Tip:&lt;/b&gt; For best performance, the number of virtual CPUs should be less than (or equal to) the number of logical CPUs on the host system.&lt;/small&gt;</property>
<property name="use_underline">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>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label340">
<property name="visible">True</property>
@ -4559,6 +4443,92 @@
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox37">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkAlignment" id="alignment106">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.10000000149</property>
<property name="xscale">1</property>
<property name="yscale">0.10000000149</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">5</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkImage" id="image88">
<property name="visible">True</property>
<property name="stock">gtk-info</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment107">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">3</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkLabel" id="label280">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;b&gt;Tip:&lt;/b&gt; For best performance, the number of virtual CPUs should be less than (or equal to) the number of logical CPUs on the host system.&lt;/small&gt;</property>
<property name="use_underline">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>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">3</property>
<property name="top_attach">11</property>
<property name="bottom_attach">12</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment126">
<property name="visible">True</property>
@ -4588,6 +4558,92 @@
</widget>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label339">
<property name="visible">True</property>
<property name="label" translatable="yes">_VCPUs:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">create-vcpus</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">10</property>
<property name="bottom_attach">11</property>
<property name="x_padding">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label400">
<property name="visible">True</property>
<property name="label" translatable="yes">Maximum VM type VCPUs:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">3</property>
<property name="ypad">2</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">9</property>
<property name="bottom_attach">10</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="config-max-vcpus">
<property name="visible">True</property>
<property name="label" translatable="yes">32</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">4</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>