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
|
@ -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