mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-24 06:05:20 +00:00
Add lib and qemu version info to compute overview
This commit is contained in:
parent
04d3568d1a
commit
c98f0b1232
3 changed files with 29 additions and 1 deletions
|
@ -42,6 +42,7 @@
|
||||||
<p>{% trans "Hostname" %}</p>
|
<p>{% trans "Hostname" %}</p>
|
||||||
<p>{% trans "Hypervisors" %}</p>
|
<p>{% trans "Hypervisors" %}</p>
|
||||||
<p>{% trans "Emulator" %}</p>
|
<p>{% trans "Emulator" %}</p>
|
||||||
|
<p>{% trans "Version" %}</p>
|
||||||
<p>{% trans "Memory" %}</p>
|
<p>{% trans "Memory" %}</p>
|
||||||
<p>{% trans "Architecture" %}</p>
|
<p>{% trans "Architecture" %}</p>
|
||||||
<p>{% trans "Logical CPUs" %}</p>
|
<p>{% trans "Logical CPUs" %}</p>
|
||||||
|
@ -55,10 +56,17 @@
|
||||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
<span class="glyphicon glyphicon-chevron-right"></span>
|
||||||
<span class="label label-default">{{ arch }}</span>
|
<span class="label label-default">{{ arch }}</span>
|
||||||
{% for h in hpv %}
|
{% for h in hpv %}
|
||||||
<span class="label label-primary">{{ h }}</span>{% endfor %}
|
<span class="label label-primary">{{ h }}</span>
|
||||||
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
<p>{{ emulator }}</p>
|
<p>{{ emulator }}</p>
|
||||||
|
<p>
|
||||||
|
<span class="label label-default">{% trans 'Qemu' %} </span>
|
||||||
|
<span class="label label-primary">{{ version }}</span>
|
||||||
|
<span class="label label-default">{% trans 'Libvirt' %} </span>
|
||||||
|
<span class="label label-primary">{{ lib_version }}</span>
|
||||||
|
</p>
|
||||||
<p>{{ host_memory|filesizeformat }}</p>
|
<p>{{ host_memory|filesizeformat }}</p>
|
||||||
<p>{{ host_arch }}</p>
|
<p>{{ host_arch }}</p>
|
||||||
<p>{{ logical_cpu }}</p>
|
<p>{{ logical_cpu }}</p>
|
||||||
|
|
|
@ -157,6 +157,8 @@ def overview(request, compute_id):
|
||||||
hypervisor = conn.hypervisor_type()
|
hypervisor = conn.hypervisor_type()
|
||||||
mem_usage = conn.get_memory_usage()
|
mem_usage = conn.get_memory_usage()
|
||||||
emulator = conn.get_emulator(host_arch)
|
emulator = conn.get_emulator(host_arch)
|
||||||
|
version = conn.get_version()
|
||||||
|
lib_version = conn.get_lib_version()
|
||||||
conn.close()
|
conn.close()
|
||||||
except libvirtError as lib_err:
|
except libvirtError as lib_err:
|
||||||
error_messages.append(lib_err)
|
error_messages.append(lib_err)
|
||||||
|
|
|
@ -361,6 +361,24 @@ class wvmConnect(object):
|
||||||
virttype = self.hypervisor_type()[arch][0]
|
virttype = self.hypervisor_type()[arch][0]
|
||||||
return self.wvm.getDomainCapabilities(emulatorbin, arch, machine, virttype)
|
return self.wvm.getDomainCapabilities(emulatorbin, arch, machine, virttype)
|
||||||
|
|
||||||
|
def get_version(self):
|
||||||
|
ver = self.wvm.getVersion()
|
||||||
|
major = ver / 1000000
|
||||||
|
ver = ver % 1000000
|
||||||
|
minor = ver / 1000
|
||||||
|
ver = ver % 1000
|
||||||
|
release = ver
|
||||||
|
return "%s.%s.%s" % (major,minor,release)
|
||||||
|
|
||||||
|
def get_lib_version(self):
|
||||||
|
ver = self.wvm.getLibVersion()
|
||||||
|
major = ver / 1000000
|
||||||
|
ver %= 1000000
|
||||||
|
minor = ver / 1000
|
||||||
|
ver %= 1000
|
||||||
|
release = ver
|
||||||
|
return "%s.%s.%s" % (major,minor,release)
|
||||||
|
|
||||||
def is_kvm_supported(self):
|
def is_kvm_supported(self):
|
||||||
"""Return KVM capabilities."""
|
"""Return KVM capabilities."""
|
||||||
return util.is_kvm_available(self.get_cap_xml())
|
return util.is_kvm_available(self.get_cap_xml())
|
||||||
|
|
Loading…
Reference in a new issue