libvirtpy 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- libvirtpy/__init__.py +5 -0
- libvirtpy/client/__init__.py +54 -0
- libvirtpy/client/_bases.py +326 -0
- libvirtpy/client/_runner.py +57 -0
- libvirtpy/client/aio.py +5922 -0
- libvirtpy/client/client.py +5695 -0
- libvirtpy/client/operations/__init__.py +631 -0
- libvirtpy/client/operations/_common.py +495 -0
- libvirtpy/client/operations/checkpoint.py +196 -0
- libvirtpy/client/operations/connection.py +93 -0
- libvirtpy/client/operations/connection_extra.py +256 -0
- libvirtpy/client/operations/domain.py +306 -0
- libvirtpy/client/operations/domain_agent.py +115 -0
- libvirtpy/client/operations/domain_block.py +368 -0
- libvirtpy/client/operations/domain_info.py +400 -0
- libvirtpy/client/operations/domain_lifecycle.py +338 -0
- libvirtpy/client/operations/domain_migration.py +164 -0
- libvirtpy/client/operations/domain_network.py +113 -0
- libvirtpy/client/operations/domain_tuning.py +494 -0
- libvirtpy/client/operations/host.py +246 -0
- libvirtpy/client/operations/host_interface.py +100 -0
- libvirtpy/client/operations/interface_extra.py +45 -0
- libvirtpy/client/operations/network.py +135 -0
- libvirtpy/client/operations/network_info.py +155 -0
- libvirtpy/client/operations/network_port.py +142 -0
- libvirtpy/client/operations/node_device.py +76 -0
- libvirtpy/client/operations/node_device_info.py +189 -0
- libvirtpy/client/operations/nwfilter.py +67 -0
- libvirtpy/client/operations/nwfilter_binding.py +74 -0
- libvirtpy/client/operations/secret.py +93 -0
- libvirtpy/client/operations/secret_extra.py +24 -0
- libvirtpy/client/operations/snapshot.py +100 -0
- libvirtpy/client/operations/snapshot_tree.py +114 -0
- libvirtpy/client/operations/storage.py +267 -0
- libvirtpy/client/operations/storage_info.py +188 -0
- libvirtpy/client/operations/streams.py +201 -0
- libvirtpy/client/references.py +249 -0
- libvirtpy/client/subscribing.py +88 -0
- libvirtpy/client/testing/__init__.py +24 -0
- libvirtpy/client/testing/_common.py +167 -0
- libvirtpy/client/testing/_domains.py +294 -0
- libvirtpy/client/testing/_objects.py +205 -0
- libvirtpy/client/testing/_state.py +246 -0
- libvirtpy/client/testing/_storage.py +171 -0
- libvirtpy/client/testing/async_transport.py +30 -0
- libvirtpy/client/testing/fake.py +81 -0
- libvirtpy/client/transport.py +87 -0
- libvirtpy/client/types.py +59 -0
- libvirtpy/client/wire.py +436 -0
- libvirtpy/client/wire_aio.py +348 -0
- libvirtpy/errors.py +7 -0
- libvirtpy/py.typed +0 -0
- libvirtpy/rpc/__init__.py +1 -0
- libvirtpy/rpc/aio.py +387 -0
- libvirtpy/rpc/cpumap.py +48 -0
- libvirtpy/rpc/errors.py +186 -0
- libvirtpy/rpc/events.py +259 -0
- libvirtpy/rpc/options.py +66 -0
- libvirtpy/rpc/procedure.py +27 -0
- libvirtpy/rpc/protocol/__init__.py +0 -0
- libvirtpy/rpc/protocol/procedures.py +5163 -0
- libvirtpy/rpc/protocol/typed_hints.py +210 -0
- libvirtpy/rpc/protocol/types.py +9299 -0
- libvirtpy/rpc/remote.py +295 -0
- libvirtpy/rpc/remote_aio.py +106 -0
- libvirtpy/rpc/sasl.py +467 -0
- libvirtpy/rpc/session.py +424 -0
- libvirtpy/rpc/sockets.py +251 -0
- libvirtpy/rpc/stream.py +323 -0
- libvirtpy/rpc/subscription.py +451 -0
- libvirtpy/rpc/sync.py +460 -0
- libvirtpy/rpc/typed_params.py +97 -0
- libvirtpy/rpc/uri.py +85 -0
- libvirtpy/rpc/xdr.py +552 -0
- libvirtpy/xml/__init__.py +49 -0
- libvirtpy/xml/_base.py +145 -0
- libvirtpy/xml/_shared/__init__.py +1 -0
- libvirtpy/xml/_shared/metadata.py +67 -0
- libvirtpy/xml/_shared/network.py +108 -0
- libvirtpy/xml/_shared/storage.py +131 -0
- libvirtpy/xml/_shared/sysinfo.py +83 -0
- libvirtpy/xml/_types.py +197 -0
- libvirtpy/xml/_xml_element.py +134 -0
- libvirtpy/xml/backup/__init__.py +25 -0
- libvirtpy/xml/backup/backup.py +89 -0
- libvirtpy/xml/backup/checkpoint.py +48 -0
- libvirtpy/xml/capabilities/__init__.py +43 -0
- libvirtpy/xml/capabilities/domain.py +436 -0
- libvirtpy/xml/capabilities/host.py +413 -0
- libvirtpy/xml/capabilities/storagepool.py +59 -0
- libvirtpy/xml/domain/__init__.py +493 -0
- libvirtpy/xml/domain/blkiotune.py +81 -0
- libvirtpy/xml/domain/clock.py +79 -0
- libvirtpy/xml/domain/cpu.py +265 -0
- libvirtpy/xml/domain/devices/__init__.py +495 -0
- libvirtpy/xml/domain/devices/address.py +152 -0
- libvirtpy/xml/domain/devices/audio.py +204 -0
- libvirtpy/xml/domain/devices/chardev.py +197 -0
- libvirtpy/xml/domain/devices/common.py +75 -0
- libvirtpy/xml/domain/devices/controller.py +262 -0
- libvirtpy/xml/domain/devices/devices.py +79 -0
- libvirtpy/xml/domain/devices/disk.py +471 -0
- libvirtpy/xml/domain/devices/filesystem.py +206 -0
- libvirtpy/xml/domain/devices/graphics.py +245 -0
- libvirtpy/xml/domain/devices/hostdev.py +221 -0
- libvirtpy/xml/domain/devices/input.py +89 -0
- libvirtpy/xml/domain/devices/interface.py +459 -0
- libvirtpy/xml/domain/devices/iommu.py +54 -0
- libvirtpy/xml/domain/devices/memballoon.py +42 -0
- libvirtpy/xml/domain/devices/memory_device.py +101 -0
- libvirtpy/xml/domain/devices/misc.py +169 -0
- libvirtpy/xml/domain/devices/nvram.py +20 -0
- libvirtpy/xml/domain/devices/shmem.py +46 -0
- libvirtpy/xml/domain/devices/sound.py +42 -0
- libvirtpy/xml/domain/devices/tpm.py +103 -0
- libvirtpy/xml/domain/devices/usb.py +86 -0
- libvirtpy/xml/domain/devices/video.py +101 -0
- libvirtpy/xml/domain/domain.py +157 -0
- libvirtpy/xml/domain/features.py +312 -0
- libvirtpy/xml/domain/iothread.py +41 -0
- libvirtpy/xml/domain/launch_security.py +82 -0
- libvirtpy/xml/domain/memory.py +149 -0
- libvirtpy/xml/domain/misc.py +113 -0
- libvirtpy/xml/domain/namespaces.py +96 -0
- libvirtpy/xml/domain/numa.py +140 -0
- libvirtpy/xml/domain/os.py +267 -0
- libvirtpy/xml/domain/qemu.py +102 -0
- libvirtpy/xml/domain/seclabel.py +29 -0
- libvirtpy/xml/domain/storage_source.py +466 -0
- libvirtpy/xml/domain/sysinfo.py +34 -0
- libvirtpy/xml/interface/__init__.py +17 -0
- libvirtpy/xml/interface/interface.py +153 -0
- libvirtpy/xml/network/__init__.py +101 -0
- libvirtpy/xml/network/network.py +311 -0
- libvirtpy/xml/network/port.py +84 -0
- libvirtpy/xml/nodedev/__init__.py +13 -0
- libvirtpy/xml/nodedev/nodedev.py +490 -0
- libvirtpy/xml/nwfilter/__init__.py +81 -0
- libvirtpy/xml/nwfilter/binding.py +51 -0
- libvirtpy/xml/nwfilter/filter.py +92 -0
- libvirtpy/xml/nwfilter/rules.py +534 -0
- libvirtpy/xml/secret/__init__.py +11 -0
- libvirtpy/xml/secret/secret.py +36 -0
- libvirtpy/xml/snapshot/__init__.py +29 -0
- libvirtpy/xml/snapshot/snapshot.py +136 -0
- libvirtpy/xml/storage/__init__.py +75 -0
- libvirtpy/xml/storage/pool.py +219 -0
- libvirtpy/xml/storage/volume.py +102 -0
- libvirtpy/xml/sysinfo.py +40 -0
- libvirtpy-0.1.0.dist-info/METADATA +109 -0
- libvirtpy-0.1.0.dist-info/RECORD +154 -0
- libvirtpy-0.1.0.dist-info/WHEEL +4 -0
- libvirtpy-0.1.0.dist-info/licenses/LICENSE +501 -0
- libvirtpy-0.1.0.dist-info/licenses/NOTICE +23 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""``<domain>``: the root element of a guest definition.
|
|
2
|
+
|
|
3
|
+
See https://libvirt.org/formatdomain.html#general-metadata
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from pydantic_xml import attr, element
|
|
9
|
+
|
|
10
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
11
|
+
from libvirtpy.xml._shared.metadata import Metadata
|
|
12
|
+
from libvirtpy.xml._types import Uuid
|
|
13
|
+
from libvirtpy.xml.domain.blkiotune import Blkiotune, ThrottleGroups
|
|
14
|
+
from libvirtpy.xml.domain.clock import Clock
|
|
15
|
+
from libvirtpy.xml.domain.cpu import Cpu, Cputune, Vcpu, Vcpus
|
|
16
|
+
from libvirtpy.xml.domain.devices.devices import Devices
|
|
17
|
+
from libvirtpy.xml.domain.features import Features
|
|
18
|
+
from libvirtpy.xml.domain.iothread import DefaultIothread, IothreadIds
|
|
19
|
+
from libvirtpy.xml.domain.launch_security import LaunchSecurity
|
|
20
|
+
from libvirtpy.xml.domain.memory import (
|
|
21
|
+
CurrentMemory,
|
|
22
|
+
MaxMemory,
|
|
23
|
+
Memory,
|
|
24
|
+
MemoryBacking,
|
|
25
|
+
MemTune,
|
|
26
|
+
)
|
|
27
|
+
from libvirtpy.xml.domain.misc import Idmap, Iommufd, Keywrap, Perf, Pm, Resource
|
|
28
|
+
from libvirtpy.xml.domain.namespaces import (
|
|
29
|
+
BHYVE_NAMESPACE,
|
|
30
|
+
LXC_NAMESPACE,
|
|
31
|
+
VMWARE_NAMESPACE,
|
|
32
|
+
XEN_NAMESPACE,
|
|
33
|
+
BhyveCommandline,
|
|
34
|
+
LxcNamespace,
|
|
35
|
+
VmwareDatacenterPath,
|
|
36
|
+
XenCommandline,
|
|
37
|
+
)
|
|
38
|
+
from libvirtpy.xml.domain.numa import NumaTune
|
|
39
|
+
from libvirtpy.xml.domain.os import Os
|
|
40
|
+
from libvirtpy.xml.domain.qemu import (
|
|
41
|
+
QEMU_NAMESPACE,
|
|
42
|
+
QemuCapabilities,
|
|
43
|
+
QemuCommandline,
|
|
44
|
+
QemuDeprecation,
|
|
45
|
+
QemuOverride,
|
|
46
|
+
)
|
|
47
|
+
from libvirtpy.xml.domain.seclabel import Seclabel
|
|
48
|
+
from libvirtpy.xml.domain.sysinfo import Sysinfo
|
|
49
|
+
|
|
50
|
+
__all__ = ["CrashAction", "Domain", "LifecycleAction", "LockFailureAction"]
|
|
51
|
+
|
|
52
|
+
# https://libvirt.org/formatdomain.html#events-configuration
|
|
53
|
+
LifecycleAction = Literal["destroy", "restart", "preserve", "rename-restart"]
|
|
54
|
+
CrashAction = Literal[
|
|
55
|
+
"destroy",
|
|
56
|
+
"restart",
|
|
57
|
+
"preserve",
|
|
58
|
+
"rename-restart",
|
|
59
|
+
"coredump-destroy",
|
|
60
|
+
"coredump-restart",
|
|
61
|
+
"preserve-running",
|
|
62
|
+
]
|
|
63
|
+
LockFailureAction = Literal["poweroff", "restart", "pause", "ignore"]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class Domain(LibvirtXmlModel, tag="domain"):
|
|
67
|
+
"""``<domain>``: a guest definition."""
|
|
68
|
+
|
|
69
|
+
type: str = attr(
|
|
70
|
+
name="type",
|
|
71
|
+
description="Hypervisor driver, e.g. ``kvm``, ``qemu``, ``xen``, ``lxc``.",
|
|
72
|
+
)
|
|
73
|
+
id: int | None = attr(
|
|
74
|
+
name="id", default=None, description="Runtime ID of a running guest."
|
|
75
|
+
)
|
|
76
|
+
name: str = element(tag="name")
|
|
77
|
+
uuid: Uuid | None = element(tag="uuid", default=None)
|
|
78
|
+
title: str | None = element(tag="title", default=None)
|
|
79
|
+
description: str | None = element(tag="description", default=None)
|
|
80
|
+
genid: Uuid | Literal[""] | None = element(
|
|
81
|
+
tag="genid",
|
|
82
|
+
default=None,
|
|
83
|
+
description="VM generation ID; an empty ``<genid/>`` asks libvirt to make one.",
|
|
84
|
+
)
|
|
85
|
+
hwuuid: Uuid | None = element(tag="hwuuid", default=None)
|
|
86
|
+
metadata: Metadata | None = element(tag="metadata", default=None)
|
|
87
|
+
max_memory: MaxMemory | None = element(tag="maxMemory", default=None)
|
|
88
|
+
memory: Memory | None = element(tag="memory", default=None)
|
|
89
|
+
current_memory: CurrentMemory | None = element(tag="currentMemory", default=None)
|
|
90
|
+
memtune: MemTune | None = element(tag="memtune", default=None)
|
|
91
|
+
memory_backing: MemoryBacking | None = element(tag="memoryBacking", default=None)
|
|
92
|
+
blkiotune: Blkiotune | None = element(tag="blkiotune", default=None)
|
|
93
|
+
vcpu: Vcpu | None = element(tag="vcpu", default=None)
|
|
94
|
+
vcpus: Vcpus | None = element(tag="vcpus", default=None)
|
|
95
|
+
iothreads: int | None = element(tag="iothreads", default=None, ge=0)
|
|
96
|
+
iothreadids: IothreadIds | None = element(tag="iothreadids", default=None)
|
|
97
|
+
defaultiothread: DefaultIothread | None = element(
|
|
98
|
+
tag="defaultiothread", default=None
|
|
99
|
+
)
|
|
100
|
+
cputune: Cputune | None = element(tag="cputune", default=None)
|
|
101
|
+
numatune: NumaTune | None = element(tag="numatune", default=None)
|
|
102
|
+
resource: Resource | None = element(tag="resource", default=None)
|
|
103
|
+
bootloader: str | None = element(
|
|
104
|
+
tag="bootloader",
|
|
105
|
+
default=None,
|
|
106
|
+
description="Host bootloader for paravirtualized guests. May be empty.",
|
|
107
|
+
)
|
|
108
|
+
bootloader_args: str | None = element(tag="bootloader_args", default=None)
|
|
109
|
+
os: Os | None = element(tag="os", default=None)
|
|
110
|
+
cpu: Cpu | None = element(tag="cpu", default=None)
|
|
111
|
+
features: Features | None = element(tag="features", default=None)
|
|
112
|
+
clock: Clock | None = element(tag="clock", default=None)
|
|
113
|
+
on_poweroff: LifecycleAction | None = element(tag="on_poweroff", default=None)
|
|
114
|
+
on_reboot: LifecycleAction | None = element(tag="on_reboot", default=None)
|
|
115
|
+
on_crash: CrashAction | None = element(tag="on_crash", default=None)
|
|
116
|
+
on_lockfailure: LockFailureAction | None = element(
|
|
117
|
+
tag="on_lockfailure", default=None
|
|
118
|
+
)
|
|
119
|
+
pm: Pm | None = element(tag="pm", default=None)
|
|
120
|
+
perf: Perf | None = element(tag="perf", default=None)
|
|
121
|
+
keywrap: Keywrap | None = element(tag="keywrap", default=None)
|
|
122
|
+
idmap: Idmap | None = element(tag="idmap", default=None)
|
|
123
|
+
iommufd: Iommufd | None = element(tag="iommufd", default=None)
|
|
124
|
+
throttlegroups: ThrottleGroups | None = element(tag="throttlegroups", default=None)
|
|
125
|
+
devices: Devices | None = element(tag="devices", default=None)
|
|
126
|
+
seclabels: list[Seclabel] = element(tag="seclabel", default_factory=list)
|
|
127
|
+
sysinfos: list[Sysinfo] = element(tag="sysinfo", default_factory=list)
|
|
128
|
+
launch_security: LaunchSecurity | None = element(tag="launchSecurity", default=None)
|
|
129
|
+
|
|
130
|
+
# Extension namespaces of the drivers
|
|
131
|
+
qemu_commandline: QemuCommandline | None = element(
|
|
132
|
+
tag="commandline", ns="qemu", nsmap={"qemu": QEMU_NAMESPACE}, default=None
|
|
133
|
+
)
|
|
134
|
+
qemu_capabilities: QemuCapabilities | None = element(
|
|
135
|
+
tag="capabilities", ns="qemu", nsmap={"qemu": QEMU_NAMESPACE}, default=None
|
|
136
|
+
)
|
|
137
|
+
qemu_deprecation: QemuDeprecation | None = element(
|
|
138
|
+
tag="deprecation", ns="qemu", nsmap={"qemu": QEMU_NAMESPACE}, default=None
|
|
139
|
+
)
|
|
140
|
+
qemu_override: QemuOverride | None = element(
|
|
141
|
+
tag="override", ns="qemu", nsmap={"qemu": QEMU_NAMESPACE}, default=None
|
|
142
|
+
)
|
|
143
|
+
vmware_datacenterpath: VmwareDatacenterPath | None = element(
|
|
144
|
+
tag="datacenterpath",
|
|
145
|
+
ns="vmware",
|
|
146
|
+
nsmap={"vmware": VMWARE_NAMESPACE},
|
|
147
|
+
default=None,
|
|
148
|
+
)
|
|
149
|
+
lxc_namespace: LxcNamespace | None = element(
|
|
150
|
+
tag="namespace", ns="lxc", nsmap={"lxc": LXC_NAMESPACE}, default=None
|
|
151
|
+
)
|
|
152
|
+
xen_commandline: XenCommandline | None = element(
|
|
153
|
+
tag="commandline", ns="xen", nsmap={"xen": XEN_NAMESPACE}, default=None
|
|
154
|
+
)
|
|
155
|
+
bhyve_commandline: BhyveCommandline | None = element(
|
|
156
|
+
tag="commandline", ns="bhyve", nsmap={"bhyve": BHYVE_NAMESPACE}, default=None
|
|
157
|
+
)
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"""``<features>``: hypervisor features (``<clock>`` will follow).
|
|
2
|
+
|
|
3
|
+
See https://libvirt.org/formatdomain.html#hypervisor-features
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from pydantic_xml import attr, element
|
|
9
|
+
|
|
10
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
11
|
+
from libvirtpy.xml._types import OnOff, PresenceFlag, ScaledInteger, YesNo
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"Aia",
|
|
15
|
+
"Apic",
|
|
16
|
+
"AsyncTeardown",
|
|
17
|
+
"Capabilities",
|
|
18
|
+
"Cfpc",
|
|
19
|
+
"DirtyRing",
|
|
20
|
+
"FeatureState",
|
|
21
|
+
"Features",
|
|
22
|
+
"Gic",
|
|
23
|
+
"Hpt",
|
|
24
|
+
"Hyperv",
|
|
25
|
+
"Ibs",
|
|
26
|
+
"Ioapic",
|
|
27
|
+
"KvmFeatures",
|
|
28
|
+
"Msrs",
|
|
29
|
+
"Sbbc",
|
|
30
|
+
"Smm",
|
|
31
|
+
"SmmTseg",
|
|
32
|
+
"Spinlocks",
|
|
33
|
+
"Stimer",
|
|
34
|
+
"Tcg",
|
|
35
|
+
"Tlbflush",
|
|
36
|
+
"VendorId",
|
|
37
|
+
"XenFeatures",
|
|
38
|
+
"XenPassthrough",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class FeatureState(LibvirtXmlModel):
|
|
43
|
+
"""A feature element with an optional ``state`` attribute, like ``<pmu/>``.
|
|
44
|
+
|
|
45
|
+
The element tag comes from the field that uses it. An absent ``state``
|
|
46
|
+
stays ``None``; libvirt treats the bare element as ``state='on'``.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
state: OnOff | None = attr(name="state", default=None)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class Spinlocks(FeatureState):
|
|
53
|
+
"""``<spinlocks>`` of ``<hyperv>``: how often to retry before notifying."""
|
|
54
|
+
|
|
55
|
+
retries: int | None = attr(name="retries", default=None, ge=0)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class Stimer(FeatureState):
|
|
59
|
+
"""``<stimer>`` of ``<hyperv>``."""
|
|
60
|
+
|
|
61
|
+
direct: FeatureState | None = element(tag="direct", default=None)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class Tlbflush(FeatureState):
|
|
65
|
+
"""``<tlbflush>`` of ``<hyperv>``."""
|
|
66
|
+
|
|
67
|
+
direct: FeatureState | None = element(tag="direct", default=None)
|
|
68
|
+
extended: FeatureState | None = element(tag="extended", default=None)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class VendorId(FeatureState):
|
|
72
|
+
"""``<vendor_id>`` of ``<hyperv>``: the hypervisor vendor string."""
|
|
73
|
+
|
|
74
|
+
value: str | None = attr(name="value", default=None, pattern=r"^[^,]{0,12}$")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class Hyperv(LibvirtXmlModel, tag="hyperv"):
|
|
78
|
+
"""``<hyperv>``: Hyper-V enlightenments for Windows guests."""
|
|
79
|
+
|
|
80
|
+
mode: Literal["custom", "host-model", "passthrough"] | None = attr(
|
|
81
|
+
name="mode", default=None
|
|
82
|
+
)
|
|
83
|
+
relaxed: FeatureState | None = element(tag="relaxed", default=None)
|
|
84
|
+
vapic: FeatureState | None = element(tag="vapic", default=None)
|
|
85
|
+
spinlocks: Spinlocks | None = element(tag="spinlocks", default=None)
|
|
86
|
+
vpindex: FeatureState | None = element(tag="vpindex", default=None)
|
|
87
|
+
runtime: FeatureState | None = element(tag="runtime", default=None)
|
|
88
|
+
synic: FeatureState | None = element(tag="synic", default=None)
|
|
89
|
+
stimer: Stimer | None = element(tag="stimer", default=None)
|
|
90
|
+
reset: FeatureState | None = element(tag="reset", default=None)
|
|
91
|
+
vendor_id: VendorId | None = element(tag="vendor_id", default=None)
|
|
92
|
+
frequencies: FeatureState | None = element(tag="frequencies", default=None)
|
|
93
|
+
reenlightenment: FeatureState | None = element(tag="reenlightenment", default=None)
|
|
94
|
+
tlbflush: Tlbflush | None = element(tag="tlbflush", default=None)
|
|
95
|
+
ipi: FeatureState | None = element(tag="ipi", default=None)
|
|
96
|
+
evmcs: FeatureState | None = element(tag="evmcs", default=None)
|
|
97
|
+
avic: FeatureState | None = element(tag="avic", default=None)
|
|
98
|
+
emsr_bitmap: FeatureState | None = element(tag="emsr_bitmap", default=None)
|
|
99
|
+
xmm_input: FeatureState | None = element(tag="xmm_input", default=None)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class DirtyRing(FeatureState):
|
|
103
|
+
"""``<dirty-ring>`` of ``<kvm>``."""
|
|
104
|
+
|
|
105
|
+
size: int | None = attr(name="size", default=None, ge=0)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class KvmFeatures(LibvirtXmlModel, tag="kvm"):
|
|
109
|
+
"""``<kvm>``: KVM specific features."""
|
|
110
|
+
|
|
111
|
+
hidden: FeatureState | None = element(tag="hidden", default=None)
|
|
112
|
+
hint_dedicated: FeatureState | None = element(tag="hint-dedicated", default=None)
|
|
113
|
+
poll_control: FeatureState | None = element(tag="poll-control", default=None)
|
|
114
|
+
pv_ipi: FeatureState | None = element(tag="pv-ipi", default=None)
|
|
115
|
+
dirty_ring: DirtyRing | None = element(tag="dirty-ring", default=None)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class XenPassthrough(FeatureState):
|
|
119
|
+
"""``<passthrough>`` of ``<xen>``."""
|
|
120
|
+
|
|
121
|
+
mode: Literal["sync_pt", "share_pt"] | None = attr(name="mode", default=None)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class XenFeatures(LibvirtXmlModel, tag="xen"):
|
|
125
|
+
"""``<xen>``: Xen specific features."""
|
|
126
|
+
|
|
127
|
+
e820_host: FeatureState | None = element(tag="e820_host", default=None)
|
|
128
|
+
passthrough: XenPassthrough | None = element(tag="passthrough", default=None)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class Capabilities(LibvirtXmlModel, tag="capabilities"):
|
|
132
|
+
"""``<capabilities>``: Linux capabilities of an LXC container."""
|
|
133
|
+
|
|
134
|
+
policy: Literal["default", "allow", "deny"] = attr(name="policy")
|
|
135
|
+
audit_control: FeatureState | None = element(tag="audit_control", default=None)
|
|
136
|
+
audit_write: FeatureState | None = element(tag="audit_write", default=None)
|
|
137
|
+
block_suspend: FeatureState | None = element(tag="block_suspend", default=None)
|
|
138
|
+
chown: FeatureState | None = element(tag="chown", default=None)
|
|
139
|
+
dac_override: FeatureState | None = element(tag="dac_override", default=None)
|
|
140
|
+
dac_read_search: FeatureState | None = element(tag="dac_read_search", default=None)
|
|
141
|
+
fowner: FeatureState | None = element(tag="fowner", default=None)
|
|
142
|
+
fsetid: FeatureState | None = element(tag="fsetid", default=None)
|
|
143
|
+
ipc_lock: FeatureState | None = element(tag="ipc_lock", default=None)
|
|
144
|
+
ipc_owner: FeatureState | None = element(tag="ipc_owner", default=None)
|
|
145
|
+
kill: FeatureState | None = element(tag="kill", default=None)
|
|
146
|
+
lease: FeatureState | None = element(tag="lease", default=None)
|
|
147
|
+
linux_immutable: FeatureState | None = element(tag="linux_immutable", default=None)
|
|
148
|
+
mac_admin: FeatureState | None = element(tag="mac_admin", default=None)
|
|
149
|
+
mac_override: FeatureState | None = element(tag="mac_override", default=None)
|
|
150
|
+
mknod: FeatureState | None = element(tag="mknod", default=None)
|
|
151
|
+
net_admin: FeatureState | None = element(tag="net_admin", default=None)
|
|
152
|
+
net_bind_service: FeatureState | None = element(
|
|
153
|
+
tag="net_bind_service", default=None
|
|
154
|
+
)
|
|
155
|
+
net_broadcast: FeatureState | None = element(tag="net_broadcast", default=None)
|
|
156
|
+
net_raw: FeatureState | None = element(tag="net_raw", default=None)
|
|
157
|
+
setgid: FeatureState | None = element(tag="setgid", default=None)
|
|
158
|
+
setfcap: FeatureState | None = element(tag="setfcap", default=None)
|
|
159
|
+
setpcap: FeatureState | None = element(tag="setpcap", default=None)
|
|
160
|
+
setuid: FeatureState | None = element(tag="setuid", default=None)
|
|
161
|
+
sys_admin: FeatureState | None = element(tag="sys_admin", default=None)
|
|
162
|
+
sys_boot: FeatureState | None = element(tag="sys_boot", default=None)
|
|
163
|
+
sys_chroot: FeatureState | None = element(tag="sys_chroot", default=None)
|
|
164
|
+
sys_module: FeatureState | None = element(tag="sys_module", default=None)
|
|
165
|
+
sys_nice: FeatureState | None = element(tag="sys_nice", default=None)
|
|
166
|
+
sys_pacct: FeatureState | None = element(tag="sys_pacct", default=None)
|
|
167
|
+
sys_ptrace: FeatureState | None = element(tag="sys_ptrace", default=None)
|
|
168
|
+
sys_rawio: FeatureState | None = element(tag="sys_rawio", default=None)
|
|
169
|
+
sys_resource: FeatureState | None = element(tag="sys_resource", default=None)
|
|
170
|
+
sys_time: FeatureState | None = element(tag="sys_time", default=None)
|
|
171
|
+
sys_tty_config: FeatureState | None = element(tag="sys_tty_config", default=None)
|
|
172
|
+
syslog: FeatureState | None = element(tag="syslog", default=None)
|
|
173
|
+
wake_alarm: FeatureState | None = element(tag="wake_alarm", default=None)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class SmmTseg(ScaledInteger, tag="tseg"):
|
|
177
|
+
"""``<tseg>``: the size of the SMRAM."""
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
class Smm(FeatureState):
|
|
181
|
+
"""``<smm>``: System Management Mode; ``<tseg>`` is its SMRAM size."""
|
|
182
|
+
|
|
183
|
+
tseg: SmmTseg | None = element(tag="tseg", default=None)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class HptMaxPageSize(ScaledInteger, tag="maxpagesize"):
|
|
187
|
+
"""``<maxpagesize>``: the largest page size of the hash page table."""
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class Hpt(LibvirtXmlModel, tag="hpt"):
|
|
191
|
+
"""``<hpt>``: PowerPC hash page table settings."""
|
|
192
|
+
|
|
193
|
+
resizing: Literal["enabled", "disabled", "required"] | None = attr(
|
|
194
|
+
name="resizing", default=None
|
|
195
|
+
)
|
|
196
|
+
maxpagesize: HptMaxPageSize | None = element(tag="maxpagesize", default=None)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class Ioapic(LibvirtXmlModel, tag="ioapic"):
|
|
200
|
+
"""``<ioapic>``: which IOAPIC implementation to use."""
|
|
201
|
+
|
|
202
|
+
driver: Literal["qemu", "kvm"] = attr(name="driver")
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class Msrs(LibvirtXmlModel, tag="msrs"):
|
|
206
|
+
"""``<msrs>``: how the guest's access to unknown MSRs is handled."""
|
|
207
|
+
|
|
208
|
+
unknown: Literal["ignore", "fault"] = attr(name="unknown")
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class TbCache(ScaledInteger, tag="tb-cache"):
|
|
212
|
+
"""``<tb-cache>``: the size of the TCG translation block cache."""
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
class Tcg(LibvirtXmlModel, tag="tcg"):
|
|
216
|
+
"""``<tcg>``: software emulation settings."""
|
|
217
|
+
|
|
218
|
+
tb_cache: TbCache | None = element(tag="tb-cache", default=None)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
class AsyncTeardown(LibvirtXmlModel, tag="async-teardown"):
|
|
222
|
+
enabled: YesNo | None = attr(name="enabled", default=None)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class Apic(LibvirtXmlModel, tag="apic"):
|
|
226
|
+
"""``<apic>``: use the programmable IRQ management."""
|
|
227
|
+
|
|
228
|
+
eoi: OnOff | None = attr(
|
|
229
|
+
name="eoi",
|
|
230
|
+
default=None,
|
|
231
|
+
description="Paravirtualized End of Interrupt. Since 0.10.2 (QEMU only).",
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
class Gic(LibvirtXmlModel, tag="gic"):
|
|
236
|
+
"""``<gic>``: the ARM generic interrupt controller."""
|
|
237
|
+
|
|
238
|
+
version: Literal["host", "2", "3"] | None = attr(name="version", default=None)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class Cfpc(LibvirtXmlModel, tag="cfpc"):
|
|
242
|
+
"""``<cfpc>``: cache flush on privilege change (PowerPC)."""
|
|
243
|
+
|
|
244
|
+
value: Literal["broken", "workaround", "fixed"] = attr(name="value")
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
class Sbbc(LibvirtXmlModel, tag="sbbc"):
|
|
248
|
+
"""``<sbbc>``: speculation barrier bounds checking (PowerPC)."""
|
|
249
|
+
|
|
250
|
+
value: Literal["broken", "workaround", "fixed"] = attr(name="value")
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class Ibs(LibvirtXmlModel, tag="ibs"):
|
|
254
|
+
"""``<ibs>``: indirect branch speculation (PowerPC)."""
|
|
255
|
+
|
|
256
|
+
value: Literal["broken", "workaround", "fixed-ibs", "fixed-ccd", "fixed-na"] = attr(
|
|
257
|
+
name="value"
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class Aia(LibvirtXmlModel, tag="aia"):
|
|
262
|
+
"""``<aia>``: the RISC-V advanced interrupt architecture."""
|
|
263
|
+
|
|
264
|
+
value: Literal["none", "aplic", "aplic-imsic"] = attr(name="value")
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class Features(LibvirtXmlModel, tag="features"):
|
|
268
|
+
"""``<features>``: hypervisor features to turn on or off."""
|
|
269
|
+
|
|
270
|
+
pae: PresenceFlag | None = element(tag="pae", default=None)
|
|
271
|
+
acpi: PresenceFlag | None = element(tag="acpi", default=None)
|
|
272
|
+
apic: Apic | None = element(tag="apic", default=None)
|
|
273
|
+
hap: FeatureState | None = element(
|
|
274
|
+
tag="hap", default=None, description="Hardware Assisted Paging."
|
|
275
|
+
)
|
|
276
|
+
viridian: PresenceFlag | None = element(tag="viridian", default=None)
|
|
277
|
+
privnet: PresenceFlag | None = element(tag="privnet", default=None)
|
|
278
|
+
pvspinlock: FeatureState | None = element(
|
|
279
|
+
tag="pvspinlock", default=None, description="Paravirtual spinlocks."
|
|
280
|
+
)
|
|
281
|
+
pmu: FeatureState | None = element(
|
|
282
|
+
tag="pmu",
|
|
283
|
+
default=None,
|
|
284
|
+
description="Performance monitoring unit. Since 1.2.12.",
|
|
285
|
+
)
|
|
286
|
+
hyperv: Hyperv | None = element(tag="hyperv", default=None)
|
|
287
|
+
kvm: KvmFeatures | None = element(tag="kvm", default=None)
|
|
288
|
+
xen: XenFeatures | None = element(tag="xen", default=None)
|
|
289
|
+
capabilities: Capabilities | None = element(tag="capabilities", default=None)
|
|
290
|
+
gic: Gic | None = element(tag="gic", default=None)
|
|
291
|
+
smm: Smm | None = element(tag="smm", default=None)
|
|
292
|
+
ioapic: Ioapic | None = element(tag="ioapic", default=None)
|
|
293
|
+
hpt: Hpt | None = element(tag="hpt", default=None)
|
|
294
|
+
vmcoreinfo: FeatureState | None = element(tag="vmcoreinfo", default=None)
|
|
295
|
+
htm: FeatureState | None = element(tag="htm", default=None)
|
|
296
|
+
nested_hv: FeatureState | None = element(tag="nested-hv", default=None)
|
|
297
|
+
msrs: Msrs | None = element(tag="msrs", default=None)
|
|
298
|
+
ccf_assist: FeatureState | None = element(tag="ccf-assist", default=None)
|
|
299
|
+
cfpc: Cfpc | None = element(tag="cfpc", default=None)
|
|
300
|
+
sbbc: Sbbc | None = element(tag="sbbc", default=None)
|
|
301
|
+
ibs: Ibs | None = element(tag="ibs", default=None)
|
|
302
|
+
tcg: Tcg | None = element(tag="tcg", default=None)
|
|
303
|
+
async_teardown: AsyncTeardown | None = element(tag="async-teardown", default=None)
|
|
304
|
+
ras: FeatureState | None = element(tag="ras", default=None)
|
|
305
|
+
ps2: FeatureState | None = element(tag="ps2", default=None)
|
|
306
|
+
aia: Aia | None = element(tag="aia", default=None)
|
|
307
|
+
virtualization: PresenceFlag | None = element(tag="virtualization", default=None)
|
|
308
|
+
vmport: FeatureState | None = element(
|
|
309
|
+
tag="vmport",
|
|
310
|
+
default=None,
|
|
311
|
+
description="VMware IO port emulation. Since 1.2.16.",
|
|
312
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""``<iothreads>``, ``<iothreadids>`` and ``<defaultiothread>``.
|
|
2
|
+
|
|
3
|
+
See https://libvirt.org/formatdomain.html#iothreads-allocation
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic_xml import attr, element
|
|
7
|
+
|
|
8
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["DefaultIothread", "IothreadId", "IothreadIds", "IothreadPoll"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class IothreadPoll(LibvirtXmlModel, tag="poll"):
|
|
14
|
+
"""``<poll>``: adaptive polling of an I/O thread."""
|
|
15
|
+
|
|
16
|
+
max: int | None = attr(name="max", default=None, ge=0)
|
|
17
|
+
grow: int | None = attr(name="grow", default=None, ge=0)
|
|
18
|
+
shrink: int | None = attr(name="shrink", default=None, ge=0)
|
|
19
|
+
weight: int | None = attr(name="weight", default=None, ge=0)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class IothreadId(LibvirtXmlModel, tag="iothread"):
|
|
23
|
+
"""``<iothread>``: one I/O thread with its settings."""
|
|
24
|
+
|
|
25
|
+
id: int = attr(name="id", ge=0)
|
|
26
|
+
thread_pool_min: int | None = attr(name="thread_pool_min", default=None, ge=0)
|
|
27
|
+
thread_pool_max: int | None = attr(name="thread_pool_max", default=None, ge=0)
|
|
28
|
+
poll: IothreadPoll | None = element(tag="poll", default=None)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class IothreadIds(LibvirtXmlModel, tag="iothreadids"):
|
|
32
|
+
"""``<iothreadids>``: the I/O threads, by ID."""
|
|
33
|
+
|
|
34
|
+
iothreads: list[IothreadId] = element(tag="iothread", default_factory=list)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class DefaultIothread(LibvirtXmlModel, tag="defaultiothread"):
|
|
38
|
+
"""``<defaultiothread>``: thread pool limits of the default I/O thread."""
|
|
39
|
+
|
|
40
|
+
thread_pool_min: int | None = attr(name="thread_pool_min", default=None, ge=0)
|
|
41
|
+
thread_pool_max: int | None = attr(name="thread_pool_max", default=None, ge=0)
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""``<launchSecurity>``: confidential guest launch (AMD SEV, Intel TDX, s390 PV).
|
|
2
|
+
|
|
3
|
+
One class per ``type``; ``LaunchSecurity`` is their plain union.
|
|
4
|
+
|
|
5
|
+
See https://libvirt.org/formatdomain.html#launch-security
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Literal
|
|
9
|
+
|
|
10
|
+
from pydantic_xml import attr, element
|
|
11
|
+
|
|
12
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
13
|
+
from libvirtpy.xml._types import YesNo
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"LaunchSecurity",
|
|
17
|
+
"S390PvLaunchSecurity",
|
|
18
|
+
"SevLaunchSecurity",
|
|
19
|
+
"SevSnpLaunchSecurity",
|
|
20
|
+
"TdxLaunchSecurity",
|
|
21
|
+
"TdxQuoteGenerationService",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class SevLaunchSecurity(LibvirtXmlModel, tag="launchSecurity"):
|
|
26
|
+
"""``type='sev'``: AMD SEV."""
|
|
27
|
+
|
|
28
|
+
type: Literal["sev"] = attr(name="type")
|
|
29
|
+
kernel_hashes: YesNo | None = attr(name="kernelHashes", default=None)
|
|
30
|
+
cbitpos: int | None = element(tag="cbitpos", default=None, ge=0)
|
|
31
|
+
reduced_phys_bits: int | None = element(tag="reducedPhysBits", default=None, ge=0)
|
|
32
|
+
policy: str = element(tag="policy", description="Hex number, e.g. ``0x0003``.")
|
|
33
|
+
handle: int | None = element(tag="handle", default=None, ge=0)
|
|
34
|
+
dh_cert: str | None = element(tag="dhCert", default=None)
|
|
35
|
+
session: str | None = element(tag="session", default=None)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class SevSnpLaunchSecurity(LibvirtXmlModel, tag="launchSecurity"):
|
|
39
|
+
"""``type='sev-snp'``: AMD SEV-SNP."""
|
|
40
|
+
|
|
41
|
+
type: Literal["sev-snp"] = attr(name="type")
|
|
42
|
+
kernel_hashes: YesNo | None = attr(name="kernelHashes", default=None)
|
|
43
|
+
author_key: YesNo | None = attr(name="authorKey", default=None)
|
|
44
|
+
vcek: YesNo | None = attr(name="vcek", default=None)
|
|
45
|
+
cbitpos: int | None = element(tag="cbitpos", default=None, ge=0)
|
|
46
|
+
reduced_phys_bits: int | None = element(tag="reducedPhysBits", default=None, ge=0)
|
|
47
|
+
policy: str = element(tag="policy", description="Hex number, e.g. ``0x30000``.")
|
|
48
|
+
guest_visible_workarounds: str | None = element(
|
|
49
|
+
tag="guestVisibleWorkarounds", default=None
|
|
50
|
+
)
|
|
51
|
+
id_block: str | None = element(tag="idBlock", default=None)
|
|
52
|
+
id_auth: str | None = element(tag="idAuth", default=None)
|
|
53
|
+
host_data: str | None = element(tag="hostData", default=None)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class S390PvLaunchSecurity(LibvirtXmlModel, tag="launchSecurity"):
|
|
57
|
+
"""``type='s390-pv'``: s390 protected virtualization."""
|
|
58
|
+
|
|
59
|
+
type: Literal["s390-pv"] = attr(name="type")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class TdxQuoteGenerationService(LibvirtXmlModel, tag="quoteGenerationService"):
|
|
63
|
+
path: str | None = attr(name="path", default=None)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class TdxLaunchSecurity(LibvirtXmlModel, tag="launchSecurity"):
|
|
67
|
+
"""``type='tdx'``: Intel TDX."""
|
|
68
|
+
|
|
69
|
+
type: Literal["tdx"] = attr(name="type")
|
|
70
|
+
policy: str | None = element(tag="policy", default=None)
|
|
71
|
+
mr_config_id: str | None = element(tag="mrConfigId", default=None)
|
|
72
|
+
mr_owner: str | None = element(tag="mrOwner", default=None)
|
|
73
|
+
mr_owner_config: str | None = element(tag="mrOwnerConfig", default=None)
|
|
74
|
+
quote_generation_service: TdxQuoteGenerationService | None = element(
|
|
75
|
+
tag="quoteGenerationService", default=None
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
LaunchSecurity = (
|
|
80
|
+
SevLaunchSecurity | SevSnpLaunchSecurity | S390PvLaunchSecurity | TdxLaunchSecurity
|
|
81
|
+
)
|
|
82
|
+
"""Any ``<launchSecurity>``; the variant is chosen by its ``type`` attribute."""
|