mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 07:03:02 -06:00
capabilities: Remove some XML parsing we don't use
These have been used in the past, but no current code touches them, so drop the parsing infrastructure Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
49f54a294b
commit
0cce75addc
@ -24,18 +24,10 @@ def _buildCaps(filename):
|
||||
|
||||
def testCapsCPUFeaturesNewSyntax():
|
||||
filename = "test-qemu-with-kvm.xml"
|
||||
host_feature_list = ['lahf_lm', 'xtpr', 'cx16', 'tm2', 'est', 'vmx',
|
||||
'ds_cpl', 'pbe', 'tm', 'ht', 'ss', 'acpi', 'ds']
|
||||
|
||||
caps = _buildCaps(filename)
|
||||
for f in host_feature_list:
|
||||
assert f in [feat.name for feat in caps.host.cpu.features]
|
||||
|
||||
assert caps.host.cpu.arch == "x86_64"
|
||||
assert caps.host.cpu.model == "core2duo"
|
||||
assert caps.host.cpu.vendor == "Intel"
|
||||
assert caps.host.cpu.topology.threads == 3
|
||||
assert caps.host.cpu.topology.cores == 5
|
||||
assert caps.host.cpu.topology.sockets == 7
|
||||
|
||||
|
||||
def testCapsUtilFuncs():
|
||||
@ -59,12 +51,6 @@ def testCapsUtilFuncs():
|
||||
caps_empty.guest_lookup()
|
||||
|
||||
|
||||
def testCapsNuma():
|
||||
cells = _buildCaps("lxc.xml").host.topology.cells
|
||||
assert len(cells) == 1
|
||||
assert len(cells[0].cpus) == 8
|
||||
assert cells[0].cpus[3].id == '3'
|
||||
|
||||
|
||||
##############################
|
||||
# domcapabilities.py testing #
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
import pwd
|
||||
|
||||
from .domain import DomainCpu
|
||||
from .logger import log
|
||||
from .xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
|
||||
|
||||
@ -17,27 +16,10 @@ from .xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
|
||||
# capabilities host <cpu> parsing #
|
||||
###################################
|
||||
|
||||
class _CapsCPU(DomainCpu):
|
||||
arch = XMLProperty("./arch")
|
||||
|
||||
|
||||
###########################
|
||||
# Caps <topology> parsers #
|
||||
###########################
|
||||
|
||||
class _CapsTopologyCPU(XMLBuilder):
|
||||
class _CapsCPU(XMLBuilder):
|
||||
XML_NAME = "cpu"
|
||||
id = XMLProperty("./@id")
|
||||
|
||||
|
||||
class _TopologyCell(XMLBuilder):
|
||||
XML_NAME = "cell"
|
||||
cpus = XMLChildProperty(_CapsTopologyCPU, relative_xpath="./cpus")
|
||||
|
||||
|
||||
class _CapsTopology(XMLBuilder):
|
||||
XML_NAME = "topology"
|
||||
cells = XMLChildProperty(_TopologyCell, relative_xpath="./cells")
|
||||
arch = XMLProperty("./arch")
|
||||
model = XMLProperty("./model")
|
||||
|
||||
|
||||
######################################
|
||||
@ -60,7 +42,6 @@ class _CapsHost(XMLBuilder):
|
||||
XML_NAME = "host"
|
||||
secmodels = XMLChildProperty(_CapsSecmodel)
|
||||
cpu = XMLChildProperty(_CapsCPU, is_single=True)
|
||||
topology = XMLChildProperty(_CapsTopology, is_single=True)
|
||||
|
||||
def get_qemu_baselabel(self):
|
||||
for secmodel in self.secmodels:
|
||||
|
Loading…
Reference in New Issue
Block a user