Don't skip virt-type wizard step if fully-virt is not available. Instead disable option & inform user why (bz 212451)

This commit is contained in:
Daniel P. Berrange
2006-11-06 11:36:55 -05:00
parent 5c113d482a
commit 6ac751b471
2 changed files with 186 additions and 7 deletions

View File

@@ -6174,6 +6174,172 @@ TB</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="virt-method-fv-unsupported">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkAlignment" id="alignment128">
<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="image96">
<property name="visible">True</property>
<property name="stock">gtk-dialog-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="alignment129">
<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="label343">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;b&gt;Note:&lt;/b&gt; The host CPU(s) in this machine do not have support for full virtualization.&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="padding">4</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="virt-method-fv-disabled">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkAlignment" id="alignment130">
<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="image97">
<property name="visible">True</property>
<property name="stock">gtk-dialog-warning</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="alignment131">
<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="label344">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;b&gt;Note:&lt;/b&gt; The host CPU(s) in this machine support full virtualization, but it is not enabled by the BIOS.&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="padding">4</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>

View File

@@ -152,6 +152,24 @@ class vmmCreate(gobject.GObject):
self.window.get_widget("create-back").set_sensitive(False)
self.window.get_widget("storage-file-size").set_sensitive(False)
# If we don't have full-virt support disable the choice, and
# display a message telling the user why it is not working
if virtinst.util.is_hvm_capable():
self.window.get_widget("virt-method-fv").set_sensitive(True)
self.window.get_widget("virt-method-fv-unsupported").hide()
self.window.get_widget("virt-method-fv-disabled").hide()
else:
self.window.get_widget("virt-method-fv").set_sensitive(False)
flags = virtinst.util.get_cpu_flags()
if "vmx" in flags or "svm" in flags:
# Host has support, but disabled in bios
self.window.get_widget("virt-method-fv-unsupported").hide()
self.window.get_widget("virt-method-fv-disabled").show()
else:
# Host has no support
self.window.get_widget("virt-method-fv-unsupported").show()
self.window.get_widget("virt-method-fv-disabled").hide()
self.change_media_type()
self.change_storage_type()
self.window.get_widget("create-vm-name").set_text("")
@@ -178,9 +196,7 @@ class vmmCreate(gobject.GObject):
if(self.validate(notebook.get_current_page()) != True):
return
if notebook.get_current_page() == 1 and not virtinst.util.is_hvm_capable():
notebook.set_current_page(4)
elif (notebook.get_current_page() == 2 and self.get_config_method() == VM_PARA_VIRT):
if (notebook.get_current_page() == 2 and self.get_config_method() == VM_PARA_VIRT):
notebook.set_current_page(4)
elif (notebook.get_current_page() == 3 and self.get_config_method() == VM_FULLY_VIRT):
notebook.set_current_page(5)
@@ -193,10 +209,7 @@ class vmmCreate(gobject.GObject):
self.window.get_widget("create-finish").hide()
self.window.get_widget("create-forward").show()
if notebook.get_current_page() == 4 and self.get_config_method() == VM_PARA_VIRT:
if virtinst.util.is_hvm_capable():
notebook.set_current_page(2)
else:
notebook.set_current_page(1)
notebook.set_current_page(2)
elif notebook.get_current_page() == 5 and self.get_config_method() == VM_FULLY_VIRT:
notebook.set_current_page(3)
else: