devices: controller: Add set_defaults
This commit is contained in:
parent
6215f790f5
commit
640a068650
|
@ -90,7 +90,7 @@ class DeviceController(Device):
|
||||||
ports = XMLProperty("./@ports", is_int=True)
|
ports = XMLProperty("./@ports", is_int=True)
|
||||||
master_startport = XMLProperty("./master/@startport", is_int=True)
|
master_startport = XMLProperty("./master/@startport", is_int=True)
|
||||||
|
|
||||||
index = XMLProperty("./@index", is_int=True, default_cb=lambda s: 0)
|
index = XMLProperty("./@index", is_int=True)
|
||||||
|
|
||||||
def pretty_desc(self):
|
def pretty_desc(self):
|
||||||
ret = self.pretty_type(self.type)
|
ret = self.pretty_type(self.type)
|
||||||
|
@ -102,3 +102,12 @@ class DeviceController(Device):
|
||||||
if self.type == "pci" and self.model == "pcie-root":
|
if self.type == "pci" and self.model == "pcie-root":
|
||||||
ret = "PCIe"
|
ret = "PCIe"
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
##################
|
||||||
|
# Default config #
|
||||||
|
##################
|
||||||
|
|
||||||
|
def set_defaults(self, _guest):
|
||||||
|
if self.index is None:
|
||||||
|
self.index = 0
|
||||||
|
|
Loading…
Reference in New Issue