mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-24 21:34:47 +03:00
capabilities: Drop workarounds for long gone libvirt bugs
These were both fixed 4-5 years ago
This commit is contained in:
parent
6e4bafc58c
commit
68ddb9d885
@ -34,7 +34,7 @@
|
|||||||
<arch name="i686">
|
<arch name="i686">
|
||||||
<wordsize>32</wordsize>
|
<wordsize>32</wordsize>
|
||||||
<domain type="xen"></domain>
|
<domain type="xen"></domain>
|
||||||
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
|
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
|
||||||
<machine>pc</machine>
|
<machine>pc</machine>
|
||||||
<machine>isapc</machine>
|
<machine>isapc</machine>
|
||||||
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
||||||
|
@ -509,7 +509,6 @@ class Capabilities(object):
|
|||||||
util.parse_node_helper(self.xml, "capabilities",
|
util.parse_node_helper(self.xml, "capabilities",
|
||||||
self.parseXML,
|
self.parseXML,
|
||||||
RuntimeError)
|
RuntimeError)
|
||||||
self._fixBrokenEmulator()
|
|
||||||
|
|
||||||
def _is_xen(self):
|
def _is_xen(self):
|
||||||
for g in self.guests:
|
for g in self.guests:
|
||||||
@ -644,31 +643,6 @@ class Capabilities(object):
|
|||||||
(a is None or g.arch == a):
|
(a is None or g.arch == a):
|
||||||
return g
|
return g
|
||||||
|
|
||||||
# 32-bit HVM emulator path, on a 64-bit host is wrong due
|
|
||||||
# to bug in libvirt capabilities. We fix by copying the
|
|
||||||
# 64-bit emualtor path
|
|
||||||
def _fixBrokenEmulator(self):
|
|
||||||
if self.host.arch != "x86_64":
|
|
||||||
return
|
|
||||||
|
|
||||||
fixEmulator = None
|
|
||||||
for g in self.guests:
|
|
||||||
if g.os_type != "hvm" or g.arch != "x86_64":
|
|
||||||
continue
|
|
||||||
for d in g.domains:
|
|
||||||
if d.emulator is not None and d.emulator.find("lib64") != -1:
|
|
||||||
fixEmulator = d.emulator
|
|
||||||
|
|
||||||
if not fixEmulator:
|
|
||||||
return
|
|
||||||
|
|
||||||
for g in self.guests:
|
|
||||||
if g.os_type != "hvm" or g.arch != "i686":
|
|
||||||
continue
|
|
||||||
for d in g.domains:
|
|
||||||
if d.emulator is not None and d.emulator.find("lib64") == -1:
|
|
||||||
d.emulator = fixEmulator
|
|
||||||
|
|
||||||
def parseXML(self, node):
|
def parseXML(self, node):
|
||||||
child = node.children
|
child = node.children
|
||||||
while child:
|
while child:
|
||||||
@ -676,15 +650,8 @@ class Capabilities(object):
|
|||||||
self.host = Host(child)
|
self.host = Host(child)
|
||||||
elif child.name == "guest":
|
elif child.name == "guest":
|
||||||
self.guests.append(Guest(child))
|
self.guests.append(Guest(child))
|
||||||
if child.name == "topology":
|
|
||||||
self._topology = Topology(child)
|
|
||||||
child = child.next
|
child = child.next
|
||||||
|
|
||||||
# Libvirt < 0.4.1 placed topology info at the capabilities level
|
|
||||||
# rather than the host level. This is just for back compat
|
|
||||||
if self.host.topology is None:
|
|
||||||
self.host.topology = self._topology
|
|
||||||
|
|
||||||
def get_cpu_values(self, arch):
|
def get_cpu_values(self, arch):
|
||||||
if not self._cpu_values:
|
if not self._cpu_values:
|
||||||
self._cpu_values = CPUValues()
|
self._cpu_values = CPUValues()
|
||||||
|
Loading…
Reference in New Issue
Block a user