"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "nova/virt/libvirt/config.py" between
nova-22.0.0.tar.gz and nova-22.0.1.tar.gz

About: OpenStack Nova (Core Service: Compute) manages the lifecycle of compute instances in an OpenStack environment. Responsibilities include spawning, scheduling and decomissioning of machines on demand.
The "Victoria" series (latest release).

config.py  (nova-22.0.0):config.py  (nova-22.0.1)
skipping to change at line 658 skipping to change at line 658
def add_timer(self, tm): def add_timer(self, tm):
self.timers.append(tm) self.timers.append(tm)
class LibvirtConfigCPUFeature(LibvirtConfigObject): class LibvirtConfigCPUFeature(LibvirtConfigObject):
def __init__(self, name=None, **kwargs): def __init__(self, name=None, **kwargs):
super(LibvirtConfigCPUFeature, self).__init__(root_name='feature', super(LibvirtConfigCPUFeature, self).__init__(root_name='feature',
**kwargs) **kwargs)
self.name = name self.name = name
self.policy = "require"
def parse_dom(self, xmldoc): def parse_dom(self, xmldoc):
super(LibvirtConfigCPUFeature, self).parse_dom(xmldoc) super(LibvirtConfigCPUFeature, self).parse_dom(xmldoc)
self.name = xmldoc.get("name") self.name = xmldoc.get("name")
self.policy = xmldoc.get("policy", "require")
def format_dom(self): def format_dom(self):
ft = super(LibvirtConfigCPUFeature, self).format_dom() ft = super(LibvirtConfigCPUFeature, self).format_dom()
ft.set("name", self.name) ft.set("name", self.name)
return ft return ft
def __eq__(self, obj): def __eq__(self, obj):
return obj.name == self.name return obj.name == self.name
skipping to change at line 713 skipping to change at line 715
self.model = c.text self.model = c.text
elif c.tag == "vendor": elif c.tag == "vendor":
self.vendor = c.text self.vendor = c.text
elif c.tag == "topology": elif c.tag == "topology":
self.sockets = int(c.get("sockets")) self.sockets = int(c.get("sockets"))
self.cores = int(c.get("cores")) self.cores = int(c.get("cores"))
self.threads = int(c.get("threads")) self.threads = int(c.get("threads"))
elif c.tag == "feature": elif c.tag == "feature":
f = LibvirtConfigCPUFeature() f = LibvirtConfigCPUFeature()
f.parse_dom(c) f.parse_dom(c)
self.add_feature(f) if f.policy != "disable":
self.add_feature(f)
def format_dom(self): def format_dom(self):
cpu = super(LibvirtConfigCPU, self).format_dom() cpu = super(LibvirtConfigCPU, self).format_dom()
if self.arch is not None: if self.arch is not None:
cpu.append(self._text_node("arch", self.arch)) cpu.append(self._text_node("arch", self.arch))
if self.model is not None: if self.model is not None:
cpu.append(self._text_node("model", self.model)) cpu.append(self._text_node("model", self.model))
if self.vendor is not None: if self.vendor is not None:
cpu.append(self._text_node("vendor", self.vendor)) cpu.append(self._text_node("vendor", self.vendor))
skipping to change at line 736 skipping to change at line 739
self.cores is not None and self.cores is not None and
self.threads is not None): self.threads is not None):
top = etree.Element("topology") top = etree.Element("topology")
top.set("sockets", str(self.sockets)) top.set("sockets", str(self.sockets))
top.set("cores", str(self.cores)) top.set("cores", str(self.cores))
top.set("threads", str(self.threads)) top.set("threads", str(self.threads))
cpu.append(top) cpu.append(top)
# sorting the features to allow more predictable tests # sorting the features to allow more predictable tests
for f in sorted(self.features, key=lambda x: x.name): for f in sorted(self.features, key=lambda x: x.name):
cpu.append(f.format_dom()) if f.policy != "disable":
cpu.append(f.format_dom())
return cpu return cpu
def add_feature(self, feat): def add_feature(self, feat):
self.features.add(feat) self.features.add(feat)
class LibvirtConfigGuestCPUFeature(LibvirtConfigCPUFeature): class LibvirtConfigGuestCPUFeature(LibvirtConfigCPUFeature):
def __init__(self, name=None, **kwargs): def __init__(self, name=None, **kwargs):
super(LibvirtConfigGuestCPUFeature, self).__init__(name, **kwargs) super(LibvirtConfigGuestCPUFeature, self).__init__(name, **kwargs)
 End of changes. 4 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)