mirror of
				https://github.com/retspen/webvirtcloud
				synced 2025-07-31 12:41:08 +00:00 
			
		
		
		
	calling hypervisor, machine, emulator operation is linked to arch variable.
This commit is contained in:
		
							parent
							
								
									ea4f2cba8b
								
							
						
					
					
						commit
						7d21c138b7
					
				
					 4 changed files with 22 additions and 9 deletions
				
			
		|  | @ -49,7 +49,7 @@ | |||
|                     <p>{% trans "Connection" %}</p> | ||||
| 					<p>{% trans "Details" %}</p> | ||||
|                 </div> | ||||
|                 <div class="col-xs-8 col-sm-7"> | ||||
|                 <div class="col-xs-8 col-sm-9"> | ||||
|                     <p>{{ hostname }}</p> | ||||
|                     <p>{% for arch, hpv in hypervisor.items %} | ||||
|                           <span class="glyphicon glyphicon-chevron-right"></span> | ||||
|  |  | |||
|  | @ -156,7 +156,7 @@ def overview(request, compute_id): | |||
|         hostname, host_arch, host_memory, logical_cpu, model_cpu, uri_conn = conn.get_node_info() | ||||
|         hypervisor = conn.hypervisor_type() | ||||
|         mem_usage = conn.get_memory_usage() | ||||
|         emulator = conn.emulator() | ||||
|         emulator = conn.get_emulator(host_arch) | ||||
|         conn.close() | ||||
|     except libvirtError as lib_err: | ||||
|         error_messages.append(lib_err) | ||||
|  |  | |||
|  | @ -10,7 +10,9 @@ | |||
|                 <div class="row"> | ||||
|                     <div class="col-lg-12"> | ||||
|                         {% if request.user.is_superuser %} | ||||
|                             {% include 'create_inst_block.html' %} | ||||
|                              <a href="{% url 'create_instance' compute.id %}" type="button" class="btn btn-success btn-header pull-right" data-toggle="modal"> | ||||
|                                 <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> | ||||
|                              </a> | ||||
|                         {% endif %} | ||||
|                         {% if all_host_vms or all_user_vms %} | ||||
|                             <div class="pull-right search"> | ||||
|  |  | |||
|  | @ -354,9 +354,10 @@ class wvmConnect(object): | |||
| 
 | ||||
|     def get_dom_cap_xml(self): | ||||
|         """ Return domcapabilities xml""" | ||||
|         emulatorbin = self.emulator() | ||||
|         machine = self.machine() | ||||
| 
 | ||||
|         arch = self.wvm.getInfo()[0] | ||||
|         machine = self.get_machines(arch) | ||||
|         emulatorbin = self.get_emulator(arch) | ||||
|         virttype = self.hypervisor_type()[arch][0] | ||||
|         return self.wvm.getDomainCapabilities(emulatorbin, arch, machine, virttype) | ||||
| 
 | ||||
|  | @ -417,13 +418,23 @@ class wvmConnect(object): | |||
|             return result | ||||
|         return util.get_xml_path(self.get_cap_xml(), func=hypervisors) | ||||
| 
 | ||||
|     def emulator(self): | ||||
|     def get_emulator(self, arch): | ||||
|         """Return emulator """ | ||||
|         return util.get_xml_path(self.get_cap_xml(), "/capabilities/guest/arch/emulator") | ||||
|         return util.get_xml_path(self.get_cap_xml(), "/capabilities/guest/arch[@name='{}']/emulator".format(arch)) | ||||
| 
 | ||||
|     def machine(self): | ||||
|     def get_emulators(self): | ||||
|         def emulators(ctx): | ||||
|             result = {} | ||||
|             for arch in ctx.xpath('/capabilities/guest/arch'): | ||||
|                 emulator = arch.xpath('emulator') | ||||
|                 arch_name = arch.xpath('@name')[0] | ||||
|                 result[arch_name]= emulator | ||||
|             return result | ||||
|         return util.get_xml_path(self.get_cap_xml(), func=emulators) | ||||
| 
 | ||||
|     def get_machines(self, arch): | ||||
|         """ Return machine type of emulation""" | ||||
|         return util.get_xml_path(self.get_cap_xml(), "/capabilities/guest/arch/machine") | ||||
|         return util.get_xml_path(self.get_cap_xml(), "/capabilities/guest/arch[@name='{}']/machine".format(arch)) | ||||
| 
 | ||||
|     def get_busses(self): | ||||
|         """Get available busses""" | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue