From a2386b94d231009be1d65a5c7c6726a3c443ca0a Mon Sep 17 00:00:00 2001 From: Mickael B Date: Wed, 16 Oct 2024 10:38:53 +0200 Subject: [PATCH] update --- libvirt/dom/config.py | 50 ++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/libvirt/dom/config.py b/libvirt/dom/config.py index 6466b85..92ff556 100644 --- a/libvirt/dom/config.py +++ b/libvirt/dom/config.py @@ -37,19 +37,11 @@ class OSFirmwareFeature(BaseXmlModel, search_mode='ordered'): enrolled_keys = "enrolled-keys" secure_boot = "secure-boot" - enabled:YesNoEnum = attr(default=YesNoEnum.YES) + enabled:YesNoEnum = attr(default=YesNoEnum.NO) name:nameEnum = attr() class OSFirmware(BaseXmlModel, search_mode='ordered'): - feature:List[OSFirmwareFeature] = element(default=[ - OSFirmwareFeature( - name=OSFirmwareFeature.nameEnum.enrolled_keys - ), - OSFirmwareFeature( - name=OSFirmwareFeature.nameEnum.secure_boot - ) - ] - ) + feature:Optional[List[OSFirmwareFeature]] = element(default=None) class OSLoader(BaseXmlModel, search_mode='ordered'): class typeEnum(str, Enum): @@ -84,17 +76,13 @@ class OS(BaseXmlModel, search_mode='ordered'): bios = "bios" efi = "efi" - firmware:Optional[firmwareEnum] = attr(default=firmwareEnum.efi) + firmware:Optional[firmwareEnum] = attr(default=firmwareEnum.bios) type:OSType = element(default=OSType()) - firmware_options:OSFirmware = element(tag="firmware", default=OSFirmware()) - loader:OSLoader = element(default=OSLoader()) - nvram:Optional[str] = element(default="") - boot:List[OSBoot] = element(default=[ - OSBoot(dev="hd"), - OSBoot(dev="cdrom"), - OSBoot(dev="network") - ]) - bootmenu:OSBootMenu = element(default=OSBootMenu()) + firmware_options:Optional[OSFirmware] = element(tag="firmware", default=None) + loader:Optional[OSLoader] = element(default=None) + nvram:Optional[str] = element(default=None) + boot:Optional[List[OSBoot]] = element(default=None) + bootmenu:Optional[OSBootMenu] = element(default=None) smbios:OSSmbios = element(default=OSSmbios()) class SysinfoEntry(BaseXmlModel, search_mode='ordered'): @@ -134,11 +122,11 @@ class SysinfoOEMStrings(BaseXmlModel, search_mode='ordered'): entry:List[SysinfoEntry] = element(default=None) class Sysinfo(BaseXmlModel, search_mode='ordered'): - bios:SysinfoBIOS = element(default=SysinfoBIOS()) + bios:Optional[SysinfoBIOS] = element(default=None) system:Optional[SysinfoSystem] = element(default=SysinfoSystem()) - baseBoard:Optional[SysinfoBaseBoard] = element(default=SysinfoBaseBoard()) - chassis:Optional[SysinfoChassis] = element(default=SysinfoChassis()) - oemStrings:Optional[SysinfoOEMStrings] = element(default=SysinfoOEMStrings()) + baseBoard:Optional[SysinfoBaseBoard] = element(default=None) + chassis:Optional[SysinfoChassis] = element(default=None) + oemStrings:Optional[SysinfoOEMStrings] = element(default=None) class VCPU(BaseXmlModel, search_mode='ordered'): class placementEnum(str, Enum): @@ -336,8 +324,8 @@ class FeaturesKVM(BaseXmlModel, search_mode='ordered'): class Features(BaseXmlModel, search_mode='ordered'): pae:str = element(default=None) - acpi:str = element(default="enable") - apic:str = element(default="enable") + acpi:str = element(default="") + apic:str = element(default="") hap:str = element(default=None) privnet:str = element(default=None) kvm:FeaturesKVM = element(default=None) @@ -375,8 +363,8 @@ class Clock(BaseXmlModel, search_mode='ordered'): variable = "variable" absolute = "absolute" - offset:offsetEnum = attr(default=offsetEnum.localtime) - timer:ClockTimer = element(default=None) + offset:Optional[offsetEnum] = attr(default=offsetEnum.utc) + timer:Optional[ClockTimer] = element(default=None) class Perf(BaseXmlModel, search_mode='ordered'): """Not implemented""" @@ -402,10 +390,10 @@ class DevicesDiskAuthSecret(BaseXmlModel, search_mode='ordered'): ceph = "ceph" type:typeEnum = attr(default=typeEnum.ceph) - uuid:str = attr(default="1") + uuid:UUID4 = attr(default=None) class DevicesDiskAuth(BaseXmlModel, search_mode='ordered'): - username:str = attr(default="1") + username:str = attr() secret:DevicesDiskAuthSecret = element(default=DevicesDiskAuthSecret()) class DevicesDiskSourceHost(BaseXmlModel, search_mode='ordered'): @@ -687,7 +675,7 @@ class Dom(BaseXmlModel, tag='domain', search_mode='ordered'): features:Features = element(default=Features()) # Time keeping - clock:Clock = element(default=Clock()) + clock:Optional[Clock] = element(default=None) # Events configuration on_poweroff:on_poweroffEnum = element(default=on_poweroffEnum.destroy)