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,204 @@
|
|
|
1
|
+
"""``<audio>``: host audio backends for the guest's sound devices.
|
|
2
|
+
|
|
3
|
+
One class per backend ``type``; ``Audio`` is their plain union. Each backend
|
|
4
|
+
has an ``<input>`` and an ``<output>`` stream with the same attributes, so the
|
|
5
|
+
stream models are shared by both elements (the field gives the tag).
|
|
6
|
+
|
|
7
|
+
See https://libvirt.org/formatdomain.html#audio-backends
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from typing import Literal
|
|
11
|
+
|
|
12
|
+
from pydantic_xml import attr, element
|
|
13
|
+
|
|
14
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
15
|
+
from libvirtpy.xml._types import YesNo
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"AlsaAudio",
|
|
19
|
+
"AlsaStream",
|
|
20
|
+
"Audio",
|
|
21
|
+
"AudioSettings",
|
|
22
|
+
"AudioStream",
|
|
23
|
+
"CoreaudioAudio",
|
|
24
|
+
"CoreaudioStream",
|
|
25
|
+
"DbusAudio",
|
|
26
|
+
"FileAudio",
|
|
27
|
+
"JackAudio",
|
|
28
|
+
"JackStream",
|
|
29
|
+
"NoneAudio",
|
|
30
|
+
"OssAudio",
|
|
31
|
+
"OssStream",
|
|
32
|
+
"PipewireAudio",
|
|
33
|
+
"PipewireStream",
|
|
34
|
+
"PulseaudioAudio",
|
|
35
|
+
"PulseaudioStream",
|
|
36
|
+
"SdlAudio",
|
|
37
|
+
"SdlStream",
|
|
38
|
+
"SpiceAudio",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class AudioSettings(LibvirtXmlModel, tag="settings"):
|
|
43
|
+
"""``<settings>``: the fixed format of a stream."""
|
|
44
|
+
|
|
45
|
+
frequency: int | None = attr(name="frequency", default=None, ge=0)
|
|
46
|
+
channels: int | None = attr(name="channels", default=None, ge=0)
|
|
47
|
+
format: Literal["s8", "u8", "s16", "u16", "s32", "u32", "f32"] | None = attr(
|
|
48
|
+
name="format", default=None
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class AudioStream(LibvirtXmlModel):
|
|
53
|
+
"""An ``<input>`` or ``<output>`` stream: the attributes every backend has."""
|
|
54
|
+
|
|
55
|
+
mixing_engine: YesNo | None = attr(name="mixingEngine", default=None)
|
|
56
|
+
fixed_settings: YesNo | None = attr(name="fixedSettings", default=None)
|
|
57
|
+
voices: int | None = attr(name="voices", default=None, ge=0)
|
|
58
|
+
buffer_length: int | None = attr(name="bufferLength", default=None, ge=0)
|
|
59
|
+
settings: AudioSettings | None = element(tag="settings", default=None)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class AlsaStream(AudioStream):
|
|
63
|
+
dev: str | None = attr(name="dev", default=None)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class CoreaudioStream(AudioStream):
|
|
67
|
+
buffer_count: int | None = attr(name="bufferCount", default=None, ge=0)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class JackStream(AudioStream):
|
|
71
|
+
server_name: str | None = attr(name="serverName", default=None)
|
|
72
|
+
client_name: str | None = attr(name="clientName", default=None)
|
|
73
|
+
connect_ports: str | None = attr(name="connectPorts", default=None)
|
|
74
|
+
exact_name: YesNo | None = attr(name="exactName", default=None)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class OssStream(AudioStream):
|
|
78
|
+
dev: str | None = attr(name="dev", default=None)
|
|
79
|
+
buffer_count: int | None = attr(name="bufferCount", default=None, ge=0)
|
|
80
|
+
try_poll: YesNo | None = attr(name="tryPoll", default=None)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class PipewireStream(AudioStream):
|
|
84
|
+
name: str | None = attr(name="name", default=None)
|
|
85
|
+
stream_name: str | None = attr(name="streamName", default=None)
|
|
86
|
+
latency: int | None = attr(name="latency", default=None, ge=0)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
class PulseaudioStream(AudioStream):
|
|
90
|
+
name: str | None = attr(name="name", default=None)
|
|
91
|
+
stream_name: str | None = attr(name="streamName", default=None)
|
|
92
|
+
latency: int | None = attr(name="latency", default=None, ge=0)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
class SdlStream(AudioStream):
|
|
96
|
+
buffer_count: int | None = attr(name="bufferCount", default=None, ge=0)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class _AudioBase(LibvirtXmlModel, tag="audio"):
|
|
100
|
+
"""Attributes every ``<audio>`` has."""
|
|
101
|
+
|
|
102
|
+
id: int = attr(name="id", ge=0, le=255)
|
|
103
|
+
timer_period: int | None = attr(
|
|
104
|
+
name="timerPeriod", default=None, ge=0, description="Microseconds."
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class NoneAudio(_AudioBase, tag="audio"):
|
|
109
|
+
"""``type='none'``: audio is discarded."""
|
|
110
|
+
|
|
111
|
+
type: Literal["none"] = attr(name="type")
|
|
112
|
+
input: AudioStream | None = element(tag="input", default=None)
|
|
113
|
+
output: AudioStream | None = element(tag="output", default=None)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class DbusAudio(_AudioBase, tag="audio"):
|
|
117
|
+
"""``type='dbus'``. Since 8.4.0."""
|
|
118
|
+
|
|
119
|
+
type: Literal["dbus"] = attr(name="type")
|
|
120
|
+
input: AudioStream | None = element(tag="input", default=None)
|
|
121
|
+
output: AudioStream | None = element(tag="output", default=None)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class AlsaAudio(_AudioBase, tag="audio"):
|
|
125
|
+
type: Literal["alsa"] = attr(name="type")
|
|
126
|
+
input: AlsaStream | None = element(tag="input", default=None)
|
|
127
|
+
output: AlsaStream | None = element(tag="output", default=None)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class CoreaudioAudio(_AudioBase, tag="audio"):
|
|
131
|
+
type: Literal["coreaudio"] = attr(name="type")
|
|
132
|
+
input: CoreaudioStream | None = element(tag="input", default=None)
|
|
133
|
+
output: CoreaudioStream | None = element(tag="output", default=None)
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class JackAudio(_AudioBase, tag="audio"):
|
|
137
|
+
type: Literal["jack"] = attr(name="type")
|
|
138
|
+
input: JackStream | None = element(tag="input", default=None)
|
|
139
|
+
output: JackStream | None = element(tag="output", default=None)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class OssAudio(_AudioBase, tag="audio"):
|
|
143
|
+
type: Literal["oss"] = attr(name="type")
|
|
144
|
+
try_mmap: YesNo | None = attr(name="tryMMap", default=None)
|
|
145
|
+
exclusive: YesNo | None = attr(name="exclusive", default=None)
|
|
146
|
+
dsp_policy: int | None = attr(name="dspPolicy", default=None)
|
|
147
|
+
input: OssStream | None = element(tag="input", default=None)
|
|
148
|
+
output: OssStream | None = element(tag="output", default=None)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class PipewireAudio(_AudioBase, tag="audio"):
|
|
152
|
+
type: Literal["pipewire"] = attr(name="type")
|
|
153
|
+
runtime_dir: str | None = attr(name="runtimeDir", default=None)
|
|
154
|
+
input: PipewireStream | None = element(tag="input", default=None)
|
|
155
|
+
output: PipewireStream | None = element(tag="output", default=None)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class PulseaudioAudio(_AudioBase, tag="audio"):
|
|
159
|
+
type: Literal["pulseaudio"] = attr(name="type")
|
|
160
|
+
server_name: str | None = attr(name="serverName", default=None)
|
|
161
|
+
input: PulseaudioStream | None = element(tag="input", default=None)
|
|
162
|
+
output: PulseaudioStream | None = element(tag="output", default=None)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class SdlAudio(_AudioBase, tag="audio"):
|
|
166
|
+
type: Literal["sdl"] = attr(name="type")
|
|
167
|
+
driver: Literal["esd", "alsa", "arts", "pulseaudio"] | None = attr(
|
|
168
|
+
name="driver", default=None
|
|
169
|
+
)
|
|
170
|
+
input: SdlStream | None = element(tag="input", default=None)
|
|
171
|
+
output: SdlStream | None = element(tag="output", default=None)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
class SpiceAudio(_AudioBase, tag="audio"):
|
|
175
|
+
"""``type='spice'``: audio goes through the SPICE channel."""
|
|
176
|
+
|
|
177
|
+
type: Literal["spice"] = attr(name="type")
|
|
178
|
+
input: AudioStream | None = element(tag="input", default=None)
|
|
179
|
+
output: AudioStream | None = element(tag="output", default=None)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class FileAudio(_AudioBase, tag="audio"):
|
|
183
|
+
"""``type='file'``: audio is written to a file. Since 7.2.0."""
|
|
184
|
+
|
|
185
|
+
type: Literal["file"] = attr(name="type")
|
|
186
|
+
path: str | None = attr(name="path", default=None)
|
|
187
|
+
input: AudioStream | None = element(tag="input", default=None)
|
|
188
|
+
output: AudioStream | None = element(tag="output", default=None)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
Audio = (
|
|
192
|
+
NoneAudio
|
|
193
|
+
| DbusAudio
|
|
194
|
+
| AlsaAudio
|
|
195
|
+
| CoreaudioAudio
|
|
196
|
+
| JackAudio
|
|
197
|
+
| OssAudio
|
|
198
|
+
| PipewireAudio
|
|
199
|
+
| PulseaudioAudio
|
|
200
|
+
| SdlAudio
|
|
201
|
+
| SpiceAudio
|
|
202
|
+
| FileAudio
|
|
203
|
+
)
|
|
204
|
+
"""Any ``<audio>``; the variant is chosen by its ``type`` attribute."""
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"""Character devices: ``<serial>``, ``<console>``, ``<parallel>``, ``<channel>``.
|
|
2
|
+
|
|
3
|
+
They share one structure: a ``type`` (how the host side is backed), one or
|
|
4
|
+
more ``<source>`` elements, an optional ``<protocol>``, ``<log>`` and a
|
|
5
|
+
``<target>``. The attributes a ``<source>`` uses depend on the ``type`` (``path``
|
|
6
|
+
for ``file``, ``host`` and ``service`` for ``tcp``, ...), but they are all
|
|
7
|
+
optional text attributes of one element, so ``CharDevSource`` is one model
|
|
8
|
+
(libvirt validates the combination). ``Rng`` reuses the same pieces.
|
|
9
|
+
|
|
10
|
+
See https://libvirt.org/formatdomain.html#consoles-serial-parallel-channel-devices
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from typing import Literal
|
|
14
|
+
|
|
15
|
+
from pydantic_xml import attr, element
|
|
16
|
+
|
|
17
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
18
|
+
from libvirtpy.xml._types import OnOff, YesNo
|
|
19
|
+
from libvirtpy.xml.domain.devices.address import Address
|
|
20
|
+
from libvirtpy.xml.domain.devices.common import Alias, DeviceAcpi
|
|
21
|
+
from libvirtpy.xml.domain.devices.graphics import SpiceClipboard, SpiceMouse
|
|
22
|
+
from libvirtpy.xml.domain.storage_source import DeviceSeclabel, Reconnect
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"Channel",
|
|
26
|
+
"ChannelTarget",
|
|
27
|
+
"CharDevLog",
|
|
28
|
+
"CharDevProtocol",
|
|
29
|
+
"CharDevSource",
|
|
30
|
+
"CharDevTarget",
|
|
31
|
+
"CharDevTargetModel",
|
|
32
|
+
"CharDevType",
|
|
33
|
+
"Console",
|
|
34
|
+
"Parallel",
|
|
35
|
+
"Serial",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
CharDevType = Literal[
|
|
39
|
+
"dev",
|
|
40
|
+
"file",
|
|
41
|
+
"pipe",
|
|
42
|
+
"unix",
|
|
43
|
+
"tcp",
|
|
44
|
+
"udp",
|
|
45
|
+
"null",
|
|
46
|
+
"stdio",
|
|
47
|
+
"vc",
|
|
48
|
+
"pty",
|
|
49
|
+
"spicevmc",
|
|
50
|
+
"spiceport",
|
|
51
|
+
"nmdm",
|
|
52
|
+
"qemu-vdagent",
|
|
53
|
+
"dbus",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class CharDevSource(LibvirtXmlModel, tag="source"):
|
|
58
|
+
"""``<source>``: the host side of a character device."""
|
|
59
|
+
|
|
60
|
+
mode: str | None = attr(
|
|
61
|
+
name="mode", default=None, description="``bind``/``connect`` for sockets."
|
|
62
|
+
)
|
|
63
|
+
path: str | None = attr(name="path", default=None)
|
|
64
|
+
host: str | None = attr(name="host", default=None)
|
|
65
|
+
service: str | None = attr(name="service", default=None)
|
|
66
|
+
channel: str | None = attr(name="channel", default=None)
|
|
67
|
+
master: str | None = attr(name="master", default=None)
|
|
68
|
+
slave: str | None = attr(name="slave", default=None)
|
|
69
|
+
append: OnOff | None = attr(name="append", default=None)
|
|
70
|
+
tls: YesNo | None = attr(name="tls", default=None)
|
|
71
|
+
reconnect: Reconnect | None = element(tag="reconnect", default=None)
|
|
72
|
+
seclabels: list[DeviceSeclabel] = element(tag="seclabel", default_factory=list)
|
|
73
|
+
clipboard: SpiceClipboard | None = element(tag="clipboard", default=None)
|
|
74
|
+
mouse: SpiceMouse | None = element(tag="mouse", default=None)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class CharDevProtocol(LibvirtXmlModel, tag="protocol"):
|
|
78
|
+
"""``<protocol>``: the wire protocol of a ``tcp`` device."""
|
|
79
|
+
|
|
80
|
+
type: Literal["raw", "telnet", "telnets", "tls"] | None = attr(
|
|
81
|
+
name="type", default=None
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class CharDevLog(LibvirtXmlModel, tag="log"):
|
|
86
|
+
"""``<log>``: a file that records the device's output."""
|
|
87
|
+
|
|
88
|
+
file: str = attr(name="file")
|
|
89
|
+
append: OnOff | None = attr(name="append", default=None)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class CharDevTargetModel(LibvirtXmlModel, tag="model"):
|
|
93
|
+
"""``<model>`` of a serial target: the emulated UART."""
|
|
94
|
+
|
|
95
|
+
name: Literal[
|
|
96
|
+
"isa-serial",
|
|
97
|
+
"usb-serial",
|
|
98
|
+
"pci-serial",
|
|
99
|
+
"spapr-vty",
|
|
100
|
+
"pl011",
|
|
101
|
+
"16550a",
|
|
102
|
+
"sclpconsole",
|
|
103
|
+
"sclplmconsole",
|
|
104
|
+
"isa-debugcon",
|
|
105
|
+
] = attr(name="name")
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class CharDevTarget(LibvirtXmlModel, tag="target"):
|
|
109
|
+
"""``<target>`` of a ``<serial>``, ``<console>`` or ``<parallel>``.
|
|
110
|
+
|
|
111
|
+
``type`` takes console values (``serial``, ``virtio``, ``xen``, ...) for a
|
|
112
|
+
``<console>`` and serial values (``isa-serial``, ...) for a ``<serial>``.
|
|
113
|
+
"""
|
|
114
|
+
|
|
115
|
+
type: (
|
|
116
|
+
Literal[
|
|
117
|
+
"xen",
|
|
118
|
+
"serial",
|
|
119
|
+
"uml",
|
|
120
|
+
"virtio",
|
|
121
|
+
"lxc",
|
|
122
|
+
"openvz",
|
|
123
|
+
"sclp",
|
|
124
|
+
"sclplm",
|
|
125
|
+
"isa-serial",
|
|
126
|
+
"usb-serial",
|
|
127
|
+
"pci-serial",
|
|
128
|
+
"spapr-vio-serial",
|
|
129
|
+
"system-serial",
|
|
130
|
+
"sclp-serial",
|
|
131
|
+
"isa-debug",
|
|
132
|
+
]
|
|
133
|
+
| None
|
|
134
|
+
) = attr(name="type", default=None)
|
|
135
|
+
port: str | None = attr(name="port", default=None)
|
|
136
|
+
model: CharDevTargetModel | None = element(tag="model", default=None)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class ChannelTarget(LibvirtXmlModel, tag="target"):
|
|
140
|
+
"""``<target>`` of a ``<channel>``: ``guestfwd``, ``virtio`` or ``xen``."""
|
|
141
|
+
|
|
142
|
+
type: Literal["guestfwd", "virtio", "xen"] | None = attr(name="type", default=None)
|
|
143
|
+
address: str | None = attr(
|
|
144
|
+
name="address", default=None, description="``guestfwd`` only."
|
|
145
|
+
)
|
|
146
|
+
port: str | None = attr(name="port", default=None, description="``guestfwd``.")
|
|
147
|
+
name: str | None = attr(name="name", default=None, description="virtio and xen.")
|
|
148
|
+
state: Literal["connected", "disconnected"] | None = attr(
|
|
149
|
+
name="state", default=None
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
class _CharDevBase(LibvirtXmlModel):
|
|
154
|
+
"""Fields of every character device."""
|
|
155
|
+
|
|
156
|
+
type: CharDevType = attr(name="type")
|
|
157
|
+
sources: list[CharDevSource] = element(tag="source", default_factory=list)
|
|
158
|
+
protocol: CharDevProtocol | None = element(tag="protocol", default=None)
|
|
159
|
+
log: CharDevLog | None = element(tag="log", default=None)
|
|
160
|
+
alias: Alias | None = element(tag="alias", default=None)
|
|
161
|
+
address: Address | None = element(tag="address", default=None)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class _PortBase(_CharDevBase):
|
|
165
|
+
"""Fields of the port-like devices (all but ``<channel>``)."""
|
|
166
|
+
|
|
167
|
+
target: CharDevTarget | None = element(tag="target", default=None)
|
|
168
|
+
acpi: DeviceAcpi | None = element(tag="acpi", default=None)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class Serial(_PortBase, tag="serial"):
|
|
172
|
+
"""``<serial>``: a serial port."""
|
|
173
|
+
|
|
174
|
+
tty: str | None = attr(name="tty", default=None)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
class Parallel(_PortBase, tag="parallel"):
|
|
178
|
+
"""``<parallel>``: a parallel port."""
|
|
179
|
+
|
|
180
|
+
tty: str | None = attr(name="tty", default=None)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class Console(_PortBase, tag="console"):
|
|
184
|
+
"""``<console>``: a guest console."""
|
|
185
|
+
|
|
186
|
+
type: CharDevType | None = attr( # type: ignore[assignment] # optional with tty
|
|
187
|
+
name="type", default=None
|
|
188
|
+
)
|
|
189
|
+
tty: str | None = attr(
|
|
190
|
+
name="tty", default=None, description="Host pty of an LXC console."
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class Channel(_CharDevBase, tag="channel"):
|
|
195
|
+
"""``<channel>``: a private host/guest communication channel."""
|
|
196
|
+
|
|
197
|
+
target: ChannelTarget | None = element(tag="target", default=None)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""Elements shared by many devices: ``<alias>``, ``<boot>``, ``<acpi>``.
|
|
2
|
+
|
|
3
|
+
See https://libvirt.org/formatdomain.html#devices
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from pydantic_xml import attr, element
|
|
7
|
+
|
|
8
|
+
from libvirtpy.xml._base import LibvirtXmlModel
|
|
9
|
+
from libvirtpy.xml._types import OnOff
|
|
10
|
+
|
|
11
|
+
__all__ = [
|
|
12
|
+
"Alias",
|
|
13
|
+
"DeviceAcpi",
|
|
14
|
+
"DeviceBoot",
|
|
15
|
+
"DriverIothread",
|
|
16
|
+
"DriverIothreadQueue",
|
|
17
|
+
"DriverIothreads",
|
|
18
|
+
"VirtioDriverOptions",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Alias(LibvirtXmlModel, tag="alias"):
|
|
23
|
+
"""``<alias>``: the device's name. User aliases start with ``ua-``."""
|
|
24
|
+
|
|
25
|
+
name: str = attr(name="name")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DeviceBoot(LibvirtXmlModel, tag="boot"):
|
|
29
|
+
"""``<boot>`` in a device: its place in the boot order."""
|
|
30
|
+
|
|
31
|
+
order: int = attr(name="order", ge=1)
|
|
32
|
+
loadparm: str | None = attr(
|
|
33
|
+
name="loadparm",
|
|
34
|
+
default=None,
|
|
35
|
+
pattern=r"^[a-zA-Z0-9.\s]{1,8}$",
|
|
36
|
+
description="s390 boot selection.",
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class DeviceAcpi(LibvirtXmlModel, tag="acpi"):
|
|
41
|
+
"""``<acpi>`` in a device: its ACPI index or NUMA nodes."""
|
|
42
|
+
|
|
43
|
+
index: int | None = attr(name="index", default=None, ge=0)
|
|
44
|
+
nodeset: str | None = attr(name="nodeset", default=None)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class VirtioDriverOptions(LibvirtXmlModel):
|
|
48
|
+
"""Base for ``<driver>`` elements of virtio devices: their common attributes.
|
|
49
|
+
|
|
50
|
+
See https://libvirt.org/formatdomain.html#virtio-related-options
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
iommu: OnOff | None = attr(name="iommu", default=None)
|
|
54
|
+
ats: OnOff | None = attr(name="ats", default=None)
|
|
55
|
+
packed: OnOff | None = attr(name="packed", default=None)
|
|
56
|
+
page_per_vq: OnOff | None = attr(name="page_per_vq", default=None)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class DriverIothreadQueue(LibvirtXmlModel, tag="queue"):
|
|
60
|
+
"""``<queue>``: a device queue served by the enclosing I/O thread."""
|
|
61
|
+
|
|
62
|
+
id: int = attr(name="id", ge=0)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class DriverIothread(LibvirtXmlModel, tag="iothread"):
|
|
66
|
+
"""``<iothread>`` in a ``<driver>``: one I/O thread and its queues."""
|
|
67
|
+
|
|
68
|
+
id: int = attr(name="id", ge=0)
|
|
69
|
+
queues: list[DriverIothreadQueue] = element(tag="queue", default_factory=list)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class DriverIothreads(LibvirtXmlModel, tag="iothreads"):
|
|
73
|
+
"""``<iothreads>`` in a ``<driver>``: map queues to I/O threads."""
|
|
74
|
+
|
|
75
|
+
iothreads: list[DriverIothread] = element(tag="iothread", default_factory=list)
|