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,413 @@
|
|
|
1
|
+
"""``<capabilities>``: what the host and its hypervisors can do.
|
|
2
|
+
|
|
3
|
+
Read-only: libvirt generates it, you only parse it.
|
|
4
|
+
|
|
5
|
+
See https://libvirt.org/formatcaps.html
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from typing import Literal
|
|
9
|
+
|
|
10
|
+
from pydantic import Field
|
|
11
|
+
from pydantic_xml import attr, element
|
|
12
|
+
|
|
13
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
14
|
+
from libvirtpy.xml._types import (
|
|
15
|
+
OnOff,
|
|
16
|
+
PresenceFlag,
|
|
17
|
+
ScaledInteger,
|
|
18
|
+
SizeUnit,
|
|
19
|
+
Uuid,
|
|
20
|
+
YesNo,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"Capabilities",
|
|
25
|
+
"GuestArch",
|
|
26
|
+
"GuestCapabilities",
|
|
27
|
+
"GuestDomain",
|
|
28
|
+
"HostCapabilities",
|
|
29
|
+
"HostCpu",
|
|
30
|
+
"HostTopology",
|
|
31
|
+
"SecModel",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# host <cpu>
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class HostCpuFeatures(LibvirtXmlModel, tag="features"):
|
|
39
|
+
"""``<features>``: legacy x86 feature flags."""
|
|
40
|
+
|
|
41
|
+
pae: PresenceFlag | None = element(tag="pae", default=None)
|
|
42
|
+
nonpae: PresenceFlag | None = element(tag="nonpae", default=None)
|
|
43
|
+
vmx: PresenceFlag | None = element(tag="vmx", default=None)
|
|
44
|
+
svm: PresenceFlag | None = element(tag="svm", default=None)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Microcode(LibvirtXmlModel, tag="microcode"):
|
|
48
|
+
version: int = attr(name="version", ge=1)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
class Signature(LibvirtXmlModel, tag="signature"):
|
|
52
|
+
family: int = attr(name="family", ge=1)
|
|
53
|
+
model: int = attr(name="model", ge=0)
|
|
54
|
+
stepping: int = attr(name="stepping", ge=0)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class Counter(LibvirtXmlModel, tag="counter"):
|
|
58
|
+
name: str = attr(name="name")
|
|
59
|
+
frequency: int = attr(name="frequency", ge=1)
|
|
60
|
+
scaling: YesNo = attr(name="scaling")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class HostCpuTopology(LibvirtXmlModel, tag="topology"):
|
|
64
|
+
sockets: int = attr(name="sockets", ge=1)
|
|
65
|
+
dies: int | None = attr(name="dies", default=None, ge=1)
|
|
66
|
+
clusters: int | None = attr(name="clusters", default=None, ge=1)
|
|
67
|
+
cores: int = attr(name="cores", ge=1)
|
|
68
|
+
threads: int = attr(name="threads", ge=1)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class HostMaxPhysAddr(LibvirtXmlModel, tag="maxphysaddr"):
|
|
72
|
+
mode: Literal["emulate", "passthrough"] = attr(name="mode")
|
|
73
|
+
bits: int | None = attr(name="bits", default=None, ge=0)
|
|
74
|
+
limit: int | None = attr(name="limit", default=None, ge=0)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class HostCpuFeature(LibvirtXmlModel, tag="feature"):
|
|
78
|
+
name: str = attr(name="name")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class HostPages(LibvirtXmlModel, tag="pages"):
|
|
82
|
+
"""``<pages>``: a supported page size."""
|
|
83
|
+
|
|
84
|
+
unit: SizeUnit | None = attr(name="unit", default=None)
|
|
85
|
+
size: int = attr(name="size", ge=0)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class HostCpu(LibvirtXmlModel, tag="cpu"):
|
|
89
|
+
"""``<cpu>``: the host CPU."""
|
|
90
|
+
|
|
91
|
+
arch: str = element(tag="arch")
|
|
92
|
+
features_legacy: HostCpuFeatures | None = element(tag="features", default=None)
|
|
93
|
+
model: str | None = element(tag="model", default=None)
|
|
94
|
+
vendor: str | None = element(tag="vendor", default=None)
|
|
95
|
+
microcode: Microcode | None = element(tag="microcode", default=None)
|
|
96
|
+
signature: Signature | None = element(tag="signature", default=None)
|
|
97
|
+
counter: Counter | None = element(tag="counter", default=None)
|
|
98
|
+
topology: HostCpuTopology | None = element(tag="topology", default=None)
|
|
99
|
+
maxphysaddr: HostMaxPhysAddr | None = element(tag="maxphysaddr", default=None)
|
|
100
|
+
features: list[HostCpuFeature] = element(tag="feature", default_factory=list)
|
|
101
|
+
pages: list[HostPages] = element(tag="pages", default_factory=list)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
# power, iommu, ...
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class PowerManagement(LibvirtXmlModel, tag="power_management"):
|
|
108
|
+
suspend_mem: PresenceFlag | None = element(tag="suspend_mem", default=None)
|
|
109
|
+
suspend_disk: PresenceFlag | None = element(tag="suspend_disk", default=None)
|
|
110
|
+
suspend_hybrid: PresenceFlag | None = element(tag="suspend_hybrid", default=None)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class HostIommu(LibvirtXmlModel, tag="iommu"):
|
|
114
|
+
support: YesNo | None = attr(name="support", default=None)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class UriTransports(LibvirtXmlModel, tag="uri_transports"):
|
|
118
|
+
transports: list[Literal["vpxmigr", "tcp", "rdma", "vzmigr"]] = element(
|
|
119
|
+
tag="uri_transport", default_factory=list
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class MigrationFeatures(LibvirtXmlModel, tag="migration_features"):
|
|
124
|
+
live: PresenceFlag | None = element(tag="live", default=None)
|
|
125
|
+
uri_transports: UriTransports | None = element(tag="uri_transports", default=None)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
# topology
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class CellMemory(ScaledInteger, tag="memory"):
|
|
132
|
+
"""``<memory>``: the memory of a NUMA cell."""
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
class CellPages(LibvirtXmlModel, tag="pages"):
|
|
136
|
+
"""``<pages>``: how many pages of a size the cell has."""
|
|
137
|
+
|
|
138
|
+
value: int = Field(ge=0, description="Element text: the number of pages.")
|
|
139
|
+
unit: SizeUnit | None = attr(name="unit", default=None)
|
|
140
|
+
size: int = attr(name="size", ge=0)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class CellSibling(LibvirtXmlModel, tag="sibling"):
|
|
144
|
+
id: int = attr(name="id", ge=0)
|
|
145
|
+
value: int = attr(name="value", ge=0)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
class CellDistances(LibvirtXmlModel, tag="distances"):
|
|
149
|
+
siblings: list[CellSibling] = element(tag="sibling", default_factory=list)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class CellCacheSize(LibvirtXmlModel, tag="size"):
|
|
153
|
+
value: int = attr(name="value", ge=0)
|
|
154
|
+
unit: SizeUnit = attr(name="unit")
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
class CellCacheLine(LibvirtXmlModel, tag="line"):
|
|
158
|
+
value: int = attr(name="value", ge=0)
|
|
159
|
+
unit: SizeUnit = attr(name="unit")
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class CellCache(LibvirtXmlModel, tag="cache"):
|
|
163
|
+
level: int = attr(name="level", ge=0)
|
|
164
|
+
associativity: Literal["none", "direct", "full"] = attr(name="associativity")
|
|
165
|
+
policy: Literal["none", "writeback", "writethrough"] = attr(name="policy")
|
|
166
|
+
size: CellCacheSize = element(tag="size")
|
|
167
|
+
line: CellCacheLine = element(tag="line")
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class CellCpu(LibvirtXmlModel, tag="cpu"):
|
|
171
|
+
id: int = attr(name="id", ge=0)
|
|
172
|
+
socket_id: int | None = attr(name="socket_id", default=None, ge=0)
|
|
173
|
+
die_id: int | None = attr(name="die_id", default=None, ge=0)
|
|
174
|
+
cluster_id: int | None = attr(name="cluster_id", default=None, ge=0)
|
|
175
|
+
core_id: int | None = attr(name="core_id", default=None, ge=0)
|
|
176
|
+
siblings: str | None = attr(name="siblings", default=None)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class CellCpus(LibvirtXmlModel, tag="cpus"):
|
|
180
|
+
num: int = attr(name="num", ge=0)
|
|
181
|
+
cpus: list[CellCpu] = element(tag="cpu", default_factory=list)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
class Cell(LibvirtXmlModel, tag="cell"):
|
|
185
|
+
"""``<cell>``: one NUMA node of the host."""
|
|
186
|
+
|
|
187
|
+
id: int = attr(name="id", ge=0)
|
|
188
|
+
memory: CellMemory | None = element(tag="memory", default=None)
|
|
189
|
+
pages: list[CellPages] = element(tag="pages", default_factory=list)
|
|
190
|
+
distances: CellDistances | None = element(tag="distances", default=None)
|
|
191
|
+
caches: list[CellCache] = element(tag="cache", default_factory=list)
|
|
192
|
+
cpus: CellCpus | None = element(tag="cpus", default=None)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
class Cells(LibvirtXmlModel, tag="cells"):
|
|
196
|
+
num: int = attr(name="num", ge=0)
|
|
197
|
+
cells: list[Cell] = element(tag="cell", default_factory=list)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class InterconnectLatency(LibvirtXmlModel, tag="latency"):
|
|
201
|
+
initiator: int = attr(name="initiator", ge=0)
|
|
202
|
+
target: int = attr(name="target", ge=0)
|
|
203
|
+
cache: int | None = attr(name="cache", default=None, ge=0)
|
|
204
|
+
type: Literal["access", "read", "write"] = attr(name="type")
|
|
205
|
+
value: int = attr(name="value", ge=0)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class InterconnectBandwidth(LibvirtXmlModel, tag="bandwidth"):
|
|
209
|
+
initiator: int = attr(name="initiator", ge=0)
|
|
210
|
+
target: int = attr(name="target", ge=0)
|
|
211
|
+
cache: int | None = attr(name="cache", default=None, ge=0)
|
|
212
|
+
type: Literal["access", "read", "write"] = attr(name="type")
|
|
213
|
+
value: int = attr(name="value", ge=0)
|
|
214
|
+
unit: SizeUnit = attr(name="unit")
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
class Interconnects(LibvirtXmlModel, tag="interconnects"):
|
|
218
|
+
latencies: list[InterconnectLatency] = element(tag="latency", default_factory=list)
|
|
219
|
+
bandwidths: list[InterconnectBandwidth] = element(
|
|
220
|
+
tag="bandwidth", default_factory=list
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class HostTopology(LibvirtXmlModel, tag="topology"):
|
|
225
|
+
"""``<topology>``: the NUMA topology of the host."""
|
|
226
|
+
|
|
227
|
+
cells: Cells = element(tag="cells")
|
|
228
|
+
interconnects: Interconnects | None = element(tag="interconnects", default=None)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
# cache, bandwidth
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class MonitorFeature(LibvirtXmlModel, tag="feature"):
|
|
235
|
+
name: str = attr(name="name")
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class CacheMonitor(LibvirtXmlModel, tag="monitor"):
|
|
239
|
+
"""``<monitor>``: the cache/bandwidth monitoring of the CPU."""
|
|
240
|
+
|
|
241
|
+
level: int | None = attr(name="level", default=None, ge=0)
|
|
242
|
+
reuse_threshold: int | None = attr(name="reuseThreshold", default=None, ge=0)
|
|
243
|
+
max_monitors: int = attr(name="maxMonitors", ge=0)
|
|
244
|
+
features: list[MonitorFeature] = element(tag="feature", default_factory=list)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
class BankControl(LibvirtXmlModel, tag="control"):
|
|
248
|
+
granularity: int = attr(name="granularity", ge=0)
|
|
249
|
+
min: int | None = attr(name="min", default=None, ge=0)
|
|
250
|
+
unit: SizeUnit | None = attr(name="unit", default=None)
|
|
251
|
+
type: Literal["both", "code", "data"] | None = attr(name="type", default=None)
|
|
252
|
+
max_allocs: int = attr(name="maxAllocs", ge=0)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class CacheBank(LibvirtXmlModel, tag="bank"):
|
|
256
|
+
id: int = attr(name="id", ge=0)
|
|
257
|
+
level: int = attr(name="level", ge=0)
|
|
258
|
+
type: Literal["both", "code", "data"] = attr(name="type")
|
|
259
|
+
size: int = attr(name="size", ge=0)
|
|
260
|
+
unit: SizeUnit = attr(name="unit")
|
|
261
|
+
cpus: str = attr(name="cpus")
|
|
262
|
+
controls: list[BankControl] = element(tag="control", default_factory=list)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class HostCache(LibvirtXmlModel, tag="cache"):
|
|
266
|
+
banks: list[CacheBank] = element(tag="bank", default_factory=list)
|
|
267
|
+
monitor: CacheMonitor | None = element(tag="monitor", default=None)
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
class BandwidthControl(LibvirtXmlModel, tag="control"):
|
|
271
|
+
granularity: int = attr(name="granularity", ge=0)
|
|
272
|
+
min: int | None = attr(name="min", default=None, ge=0)
|
|
273
|
+
max_allocs: int = attr(name="maxAllocs", ge=0)
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class BandwidthNode(LibvirtXmlModel, tag="node"):
|
|
277
|
+
id: int = attr(name="id", ge=0)
|
|
278
|
+
cpus: str = attr(name="cpus")
|
|
279
|
+
controls: list[BandwidthControl] = element(tag="control", default_factory=list)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
class MemoryBandwidth(LibvirtXmlModel, tag="memory_bandwidth"):
|
|
283
|
+
nodes: list[BandwidthNode] = element(tag="node", default_factory=list)
|
|
284
|
+
monitor: CacheMonitor | None = element(tag="monitor", default=None)
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
class EnergyMonitor(LibvirtXmlModel, tag="monitor"):
|
|
288
|
+
max_monitors: int = attr(name="maxMonitors", ge=0)
|
|
289
|
+
features: list[MonitorFeature] = element(tag="feature", default_factory=list)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
class Energy(LibvirtXmlModel, tag="energy"):
|
|
293
|
+
monitor: EnergyMonitor = element(tag="monitor")
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
class SecModelLabel(LibvirtXmlModel, tag="baselabel"):
|
|
297
|
+
value: str = ""
|
|
298
|
+
type: str = attr(name="type")
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
class SecModel(LibvirtXmlModel, tag="secmodel"):
|
|
302
|
+
"""``<secmodel>``: a security driver of the host."""
|
|
303
|
+
|
|
304
|
+
model: str = element(tag="model")
|
|
305
|
+
doi: str = element(tag="doi")
|
|
306
|
+
baselabels: list[SecModelLabel] = element(tag="baselabel", default_factory=list)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
class HostCapabilities(LibvirtXmlModel, tag="host"):
|
|
310
|
+
"""``<host>``: the host itself."""
|
|
311
|
+
|
|
312
|
+
uuid: Uuid | None = element(tag="uuid", default=None)
|
|
313
|
+
cpu: HostCpu = element(tag="cpu")
|
|
314
|
+
power_management: PowerManagement | None = element(
|
|
315
|
+
tag="power_management", default=None
|
|
316
|
+
)
|
|
317
|
+
iommu: HostIommu | None = element(tag="iommu", default=None)
|
|
318
|
+
migration_features: MigrationFeatures | None = element(
|
|
319
|
+
tag="migration_features", default=None
|
|
320
|
+
)
|
|
321
|
+
topology: HostTopology | None = element(tag="topology", default=None)
|
|
322
|
+
cache: HostCache | None = element(tag="cache", default=None)
|
|
323
|
+
memory_bandwidth: MemoryBandwidth | None = element(
|
|
324
|
+
tag="memory_bandwidth", default=None
|
|
325
|
+
)
|
|
326
|
+
energy: Energy | None = element(tag="energy", default=None)
|
|
327
|
+
secmodels: list[SecModel] = element(tag="secmodel", default_factory=list)
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
# guests
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
class Machine(LibvirtXmlModel, tag="machine"):
|
|
334
|
+
"""``<machine>``: a machine type."""
|
|
335
|
+
|
|
336
|
+
value: str = ""
|
|
337
|
+
canonical: str | None = attr(name="canonical", default=None)
|
|
338
|
+
max_cpus: int | None = attr(name="maxCpus", default=None, ge=0)
|
|
339
|
+
deprecated: YesNo | None = attr(name="deprecated", default=None)
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
class GuestDomain(LibvirtXmlModel, tag="domain"):
|
|
343
|
+
"""``<domain>``: a hypervisor type that can run this guest architecture."""
|
|
344
|
+
|
|
345
|
+
type: str = attr(name="type", description="e.g. ``kvm`` or ``qemu``.")
|
|
346
|
+
emulator: str | None = element(tag="emulator", default=None)
|
|
347
|
+
machines: list[Machine] = element(tag="machine", default_factory=list)
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
class GuestArch(LibvirtXmlModel, tag="arch"):
|
|
351
|
+
"""``<arch>``: a guest architecture."""
|
|
352
|
+
|
|
353
|
+
name: str = attr(name="name")
|
|
354
|
+
wordsize: Literal["31", "32", "64"] = element(tag="wordsize")
|
|
355
|
+
emulator: str | None = element(tag="emulator", default=None)
|
|
356
|
+
loader: str | None = element(tag="loader", default=None)
|
|
357
|
+
machines: list[Machine] = element(tag="machine", default_factory=list)
|
|
358
|
+
domains: list[GuestDomain] = element(tag="domain", default_factory=list)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
class FeatureToggle(LibvirtXmlModel):
|
|
362
|
+
"""Base of the guest features that can be toggled."""
|
|
363
|
+
|
|
364
|
+
toggle: YesNo = attr(name="toggle")
|
|
365
|
+
default: OnOff = attr(name="default")
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
class AcpiToggle(FeatureToggle, tag="acpi"):
|
|
369
|
+
"""``<acpi>``."""
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
class ApicToggle(FeatureToggle, tag="apic"):
|
|
373
|
+
"""``<apic>``."""
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
class DisksnapshotToggle(FeatureToggle, tag="disksnapshot"):
|
|
377
|
+
"""``<disksnapshot>``."""
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
class HapToggle(FeatureToggle, tag="hap"):
|
|
381
|
+
"""``<hap>``."""
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class GuestFeatures(LibvirtXmlModel, tag="features"):
|
|
385
|
+
"""``<features>``: the guest features the hypervisor offers."""
|
|
386
|
+
|
|
387
|
+
pae: PresenceFlag | None = element(tag="pae", default=None)
|
|
388
|
+
nonpae: PresenceFlag | None = element(tag="nonpae", default=None)
|
|
389
|
+
ia64_be: PresenceFlag | None = element(tag="ia64_be", default=None)
|
|
390
|
+
acpi: AcpiToggle | None = element(tag="acpi", default=None)
|
|
391
|
+
apic: ApicToggle | None = element(tag="apic", default=None)
|
|
392
|
+
cpuselection: PresenceFlag | None = element(tag="cpuselection", default=None)
|
|
393
|
+
deviceboot: PresenceFlag | None = element(tag="deviceboot", default=None)
|
|
394
|
+
disksnapshot: DisksnapshotToggle | None = element(tag="disksnapshot", default=None)
|
|
395
|
+
hap: HapToggle | None = element(tag="hap", default=None)
|
|
396
|
+
external_snapshot: PresenceFlag | None = element(
|
|
397
|
+
tag="externalSnapshot", default=None
|
|
398
|
+
)
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class GuestCapabilities(LibvirtXmlModel, tag="guest"):
|
|
402
|
+
"""``<guest>``: one guest OS type and architecture."""
|
|
403
|
+
|
|
404
|
+
os_type: Literal["xen", "linux", "hvm", "exe", "uml"] = element(tag="os_type")
|
|
405
|
+
arch: GuestArch = element(tag="arch")
|
|
406
|
+
features: GuestFeatures | None = element(tag="features", default=None)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
class Capabilities(LibvirtXmlModel, tag="capabilities"):
|
|
410
|
+
"""``<capabilities>``: the host and the guests it can run."""
|
|
411
|
+
|
|
412
|
+
host: HostCapabilities = element(tag="host")
|
|
413
|
+
guests: list[GuestCapabilities] = element(tag="guest", default_factory=list)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""``<storagepoolCapabilities>``: what each storage pool type supports.
|
|
2
|
+
|
|
3
|
+
Read-only: libvirt generates it, you only parse it.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Literal
|
|
7
|
+
|
|
8
|
+
from pydantic_xml import attr, element
|
|
9
|
+
|
|
10
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"PoolCapabilities",
|
|
14
|
+
"PoolCapsDefaultFormat",
|
|
15
|
+
"PoolCapsEnum",
|
|
16
|
+
"PoolCapsOptions",
|
|
17
|
+
"StoragePoolCapabilities",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class PoolCapsDefaultFormat(LibvirtXmlModel, tag="defaultFormat"):
|
|
22
|
+
type: str = attr(name="type")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class PoolCapsEnum(LibvirtXmlModel, tag="enum"):
|
|
26
|
+
name: str = attr(name="name")
|
|
27
|
+
values: list[str] = element(tag="value", default_factory=list)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class PoolCapsOptions(LibvirtXmlModel):
|
|
31
|
+
"""Base of ``<poolOptions>`` and ``<volOptions>``."""
|
|
32
|
+
|
|
33
|
+
default_format: PoolCapsDefaultFormat | None = element(
|
|
34
|
+
tag="defaultFormat", default=None
|
|
35
|
+
)
|
|
36
|
+
enums: list[PoolCapsEnum] = element(tag="enum", default_factory=list)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class PoolOptions(PoolCapsOptions, tag="poolOptions"):
|
|
40
|
+
"""``<poolOptions>``: formats the pool itself can have."""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class VolOptions(PoolCapsOptions, tag="volOptions"):
|
|
44
|
+
"""``<volOptions>``: formats the volumes of the pool can have."""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class PoolCapabilities(LibvirtXmlModel, tag="pool"):
|
|
48
|
+
"""``<pool>``: the capabilities of one pool type."""
|
|
49
|
+
|
|
50
|
+
type: str = attr(name="type")
|
|
51
|
+
supported: Literal["yes", "no"] = attr(name="supported")
|
|
52
|
+
pool_options: PoolOptions | None = element(tag="poolOptions", default=None)
|
|
53
|
+
vol_options: VolOptions | None = element(tag="volOptions", default=None)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class StoragePoolCapabilities(LibvirtXmlModel, tag="storagepoolCapabilities"):
|
|
57
|
+
"""``<storagepoolCapabilities>``: the capabilities of every pool type."""
|
|
58
|
+
|
|
59
|
+
pools: list[PoolCapabilities] = element(tag="pool", default_factory=list)
|