Merge "libvirt: make default value of numa cell memory to 0 when not defined" into stable/juno
This commit is contained in:
commit
fdab7e0475
|
@ -121,6 +121,28 @@ class LibvirtConfigCapsTest(LibvirtConfigBaseTest):
|
||||||
|
|
||||||
self.assertXmlEqual(xmlin, xmlout)
|
self.assertXmlEqual(xmlin, xmlout)
|
||||||
|
|
||||||
|
def test_config_host_numa_cell_no_memory_caps(self):
|
||||||
|
xmlin = """
|
||||||
|
<cell id='0'>
|
||||||
|
<cpus num='1'>
|
||||||
|
<cpu id='0' socket_id='0' core_id='0' siblings='0'/>
|
||||||
|
</cpus>
|
||||||
|
</cell>"""
|
||||||
|
obj = config.LibvirtConfigCapsNUMACell()
|
||||||
|
obj.parse_str(xmlin)
|
||||||
|
self.assertEqual(0, obj.memory)
|
||||||
|
self.assertEqual(1, len(obj.cpus))
|
||||||
|
|
||||||
|
def test_config_host_numa_cell_no_cpus_caps(self):
|
||||||
|
xmlin = """
|
||||||
|
<cell id='0'>
|
||||||
|
<memory unit='KiB'>128</memory>
|
||||||
|
</cell>"""
|
||||||
|
obj = config.LibvirtConfigCapsNUMACell()
|
||||||
|
obj.parse_str(xmlin)
|
||||||
|
self.assertEqual(128, obj.memory)
|
||||||
|
self.assertEqual(0, len(obj.cpus))
|
||||||
|
|
||||||
|
|
||||||
class LibvirtConfigGuestTimerTest(LibvirtConfigBaseTest):
|
class LibvirtConfigGuestTimerTest(LibvirtConfigBaseTest):
|
||||||
def test_config_platform(self):
|
def test_config_platform(self):
|
||||||
|
|
|
@ -153,7 +153,7 @@ class LibvirtConfigCapsNUMACell(LibvirtConfigObject):
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
self.id = None
|
self.id = None
|
||||||
self.memory = None
|
self.memory = 0
|
||||||
self.cpus = []
|
self.cpus = []
|
||||||
|
|
||||||
def parse_dom(self, xmldoc):
|
def parse_dom(self, xmldoc):
|
||||||
|
|
Loading…
Reference in New Issue