mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
guest stuff
This commit is contained in:
parent
38f110954d
commit
a23f1794d0
@ -88,7 +88,7 @@ class Guest(XMLBuilder):
|
||||
_XML_PROP_ORDER = ["type", "name", "uuid", "description",
|
||||
"maxmemory", "memory", "hugepage", "vcpus", "curvcpus",
|
||||
"numatune", "bootloader", "os", "features", "cpu", "clock",
|
||||
"on_poweroff", "on_reboot", "on_crash", "emulator", "all_devices",
|
||||
"on_poweroff", "on_reboot", "on_crash", "emulator", "_devices",
|
||||
"seclabel"]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -237,7 +237,6 @@ class Guest(XMLBuilder):
|
||||
for devtype in VirtualDevice.virtual_device_types:
|
||||
retlist.extend(self.get_devices(devtype))
|
||||
return retlist
|
||||
all_devices = property(lambda s: s.get_all_devices())
|
||||
|
||||
|
||||
############################
|
||||
@ -648,7 +647,7 @@ class Guest(XMLBuilder):
|
||||
|
||||
def _check_address_multi(self):
|
||||
addresses = {}
|
||||
for d in self.all_devices:
|
||||
for d in self.get_all_devices():
|
||||
if d.address.type != d.address.ADDRESS_TYPE_PCI:
|
||||
continue
|
||||
|
||||
|
@ -293,8 +293,23 @@ class XMLChildProperty(property):
|
||||
for obj in self._get(xmlbuilder)[:]:
|
||||
xmlbuilder._remove_child(obj)
|
||||
|
||||
def append(self, xmlbuilder, obj):
|
||||
self._get(xmlbuilder).append(obj)
|
||||
def append(self, xmlbuilder, newobj):
|
||||
# Keep the list ordered by the order of passed in child classes
|
||||
objlist = self._get(xmlbuilder)
|
||||
if len(self.child_classes) == 1:
|
||||
objlist.append(newobj)
|
||||
return
|
||||
|
||||
idx = 0
|
||||
for idx in range(len(objlist)):
|
||||
obj = objlist[idx]
|
||||
if (obj.__class__ not in self.child_classes or
|
||||
(self.child_classes.index(newobj.__class__) <
|
||||
self.child_classes.index(obj.__class__))):
|
||||
break
|
||||
idx += 1
|
||||
|
||||
objlist.insert(idx, newobj)
|
||||
def remove(self, xmlbuilder, obj):
|
||||
self._get(xmlbuilder).remove(obj)
|
||||
def set(self, xmlbuilder, obj):
|
||||
|
Loading…
Reference in New Issue
Block a user