details: List ACPI, APIC, and clock offset values.

These will be made editable shortly, but for now just show their values.
This commit is contained in:
Cole Robinson
2009-11-04 13:16:38 -05:00
parent a7d4b6978d
commit 82855b54c0
3 changed files with 185 additions and 4 deletions

View File

@@ -306,6 +306,22 @@ class vmmDetails(gobject.GObject):
graph_table.attach(self.network_traffic_graph, 1, 2, 3, 4)
def init_details(self):
# Disable all 'machine details' options since we don't yet allow edit
self.window.get_widget("overview-clock-combo").set_sensitive(False)
self.window.get_widget("overview-acpi").set_sensitive(False)
self.window.get_widget("overview-apic").set_sensitive(False)
# Clock combo
clock_combo = self.window.get_widget("overview-clock-combo")
clock_model = gtk.ListStore(str)
clock_combo.set_model(clock_model)
text = gtk.CellRendererText()
clock_combo.pack_start(text, True)
clock_combo.add_attribute(text, 'text', 0)
clock_model.set_sort_column_id(0, gtk.SORT_ASCENDING)
for offset in [ "localtime", "utc" ]:
clock_model.append([offset])
# Security info tooltips
util.tooltip_wrapper(self.window.get_widget("security-static-info"),
_("Static SELinux security type tells libvirt to always start the guest process with the specified label. The administrator is responsible for making sure the images are labeled corectly on disk."))
@@ -696,15 +712,40 @@ class vmmDetails(gobject.GObject):
self.hw_selected(page=pagetype)
def refresh_overview_page(self):
# Basic details
self.window.get_widget("overview-name").set_text(self.vm.get_name())
self.window.get_widget("overview-uuid").set_text(self.vm.get_uuid())
# Hypervisor Details
self.window.get_widget("overview-hv").set_text(self.vm.get_pretty_hv_type())
arch = self.vm.get_arch() or _("Unknown")
emu = self.vm.get_emulator() or _("None")
self.window.get_widget("overview-arch").set_text(arch)
self.window.get_widget("overview-emulator").set_text(emu)
# Machine settings
acpi = self.vm.get_acpi()
apic = self.vm.get_apic()
clock = self.vm.get_clock()
self.window.get_widget("overview-acpi").set_active(acpi)
self.window.get_widget("overview-apic").set_active(apic)
if not clock:
clock = _("Same as host")
clock_combo = self.window.get_widget("overview-clock-combo")
clock_label = self.window.get_widget("overview-clock-label")
clock_list = map(lambda x: x[0], clock_combo.get_model())
clock_in_combo = (clock in clock_list)
clock_combo.set_property("visible", clock_in_combo)
clock_label.set_property("visible", not clock_in_combo)
if clock_in_combo:
clock_combo.set_active(clock_list.index(clock))
else:
clock_label.set_text(clock)
# Security details
vmmodel, ignore, vmlabel = self.vm.get_seclabel()
semodel_combo = self.window.get_widget("security-model")
semodel_model = semodel_combo.get_model()

View File

@@ -591,6 +591,17 @@ class vmmDomain(gobject.GObject):
def get_emulator(self):
return vutil.get_xml_path(self.get_xml(), "/domain/devices/emulator")
def get_acpi(self):
return bool(vutil.get_xml_path(self.get_xml(),
"count(/domain/features/acpi)"))
def get_apic(self):
return bool(vutil.get_xml_path(self.get_xml(),
"count(/domain/features/apic)"))
def get_clock(self):
return vutil.get_xml_path(self.get_xml(), "/domain/clock/@offset")
def _normalize_status(self, status):
if status == libvirt.VIR_DOMAIN_NOSTATE:
return libvirt.VIR_DOMAIN_RUNNING

View File

@@ -1040,7 +1040,7 @@
<child>
<widget class="GtkLabel" id="label50">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Basic details&lt;/b&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;Basic Details&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
@@ -1087,6 +1087,7 @@
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Architecture:</property>
</widget>
<packing>
@@ -1159,7 +1160,7 @@
<child>
<widget class="GtkLabel" id="frame">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Machine Details&lt;/b&gt;</property>
<property name="label" translatable="yes">&lt;b&gt;Hypervisor Details&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
@@ -1172,6 +1173,134 @@
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="expander2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<widget class="GtkAlignment" id="alignment13">
<property name="visible">True</property>
<property name="left_padding">21</property>
<child>
<widget class="GtkTable" id="table7">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
<widget class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Enable ACPI:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Enable APIC:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label22">
<property name="visible">True</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Clock Offset:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="overview-acpi">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="overview-apic">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<property name="spacing">6</property>
<child>
<widget class="GtkComboBox" id="overview-clock-combo">
<property name="visible">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="overview-clock-label">
<property name="xalign">0</property>
<property name="label">label</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label19">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Machine Settings&lt;/b&gt;</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="expander1">
<property name="visible">True</property>
@@ -1180,7 +1309,7 @@
<child>
<widget class="GtkAlignment" id="alignment7">
<property name="visible">True</property>
<property name="left_padding">12</property>
<property name="left_padding">21</property>
<child>
<widget class="GtkTable" id="table3">
<property name="visible">True</property>
@@ -1372,7 +1501,7 @@
</child>
</widget>
<packing>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</widget>