-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
0014-libxl-add-support-for-xengt-video-device.patch
220 lines (213 loc) · 8.73 KB
/
0014-libxl-add-support-for-xengt-video-device.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
From 12ba2585c1866785b35e06d25efc24d104b42569 Mon Sep 17 00:00:00 2001
From: Ivan Kardykov <[email protected]>
Date: Sat, 19 Nov 2022 23:40:29 +0100
Subject: [PATCH] libxl: add support for xengt video device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Add ability to configure xengt video device with options.
Signed-off-by: Ivan Kardykov <[email protected]>
Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
src/conf/domain_conf.c | 11 +++++++++++
src/conf/domain_conf.h | 4 ++++
src/conf/schemas/domaincommon.rng | 20 ++++++++++++++++++++
src/libxl/libxl_conf.c | 9 +++++++++
src/libxl/libxl_domain.c | 1 +
src/qemu/qemu_command.c | 3 +++
src/qemu/qemu_domain_address.c | 1 +
src/qemu/qemu_monitor_json.c | 2 ++
src/qemu/qemu_process.c | 1 +
9 files changed, 52 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 93daae18f6..d9efdeef11 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -884,6 +884,7 @@ VIR_ENUM_IMPL(virDomainVideo,
"cirrus",
"vmvga",
"xen",
+ "xengt",
"vbox",
"qxl",
"parallels",
@@ -12969,6 +12970,7 @@ virDomainVideoDefaultRAM(const virDomainDef *def,
switch (type) {
case VIR_DOMAIN_VIDEO_TYPE_VGA:
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
if (def->virtType == VIR_DOMAIN_VIRT_VBOX)
return 8 * 1024;
@@ -13117,6 +13119,15 @@ virDomainVideoModelDefParseXML(virDomainVideoDef *def,
if (virXMLPropUInt(node, "vgamem", 10, VIR_XML_PROP_NONE, &def->vgamem) < 0)
return -1;
+ if (virXMLPropUInt(node, "low_gm_sz", 10, VIR_XML_PROP_NONE, &def->low_gm_sz) < 0)
+ return -1;
+
+ if (virXMLPropUInt(node, "high_gm_sz", 10, VIR_XML_PROP_NONE, &def->high_gm_sz) < 0)
+ return -1;
+
+ if (virXMLPropUInt(node, "fence_sz", 10, VIR_XML_PROP_NONE, &def->fence_sz) < 0)
+ return -1;
+
if (virXMLPropUIntDefault(node, "heads", 10, VIR_XML_PROP_NONE, &def->heads, 1) < 0)
return -1;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index b3edac1587..1ee3149603 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1786,6 +1786,7 @@ typedef enum {
VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
VIR_DOMAIN_VIDEO_TYPE_VMVGA,
VIR_DOMAIN_VIDEO_TYPE_XEN,
+ VIR_DOMAIN_VIDEO_TYPE_XENGT,
VIR_DOMAIN_VIDEO_TYPE_VBOX,
VIR_DOMAIN_VIDEO_TYPE_QXL,
VIR_DOMAIN_VIDEO_TYPE_PARALLELS, /* pseudo device for VNC in containers */
@@ -1834,6 +1835,9 @@ struct _virDomainVideoDef {
unsigned int vram64; /* kibibytes (multiples of 1024) */
unsigned int vgamem; /* kibibytes (multiples of 1024) */
unsigned int heads;
+ unsigned int low_gm_sz;
+ unsigned int high_gm_sz;
+ unsigned int fence_sz;
bool primary;
virDomainVideoAccelDef *accel;
virDomainVideoResolutionDef *res;
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
index 44c21582ce..1f0f942065 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -4737,6 +4737,26 @@
</attribute>
</optional>
</group>
+ <group>
+ <attribute name="type">
+ <value>xengt</value>
+ </attribute>
+ <optional>
+ <attribute name="low_gm_sz">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="high_gm_sz">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="fence_sz">
+ <ref name="unsignedInt"/>
+ </attribute>
+ </optional>
+ </group>
</choice>
<optional>
<attribute name="vram">
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 389b6a1411..444e76d117 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -2437,6 +2437,15 @@ libxlMakeVideo(virDomainDef *def, libxl_domain_config *d_config)
return -1;
}
break;
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
+ b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_XENGT;
+ if (def->videos[0]->low_gm_sz)
+ b_info->u.hvm.vgt_low_gm_sz = def->videos[0]->low_gm_sz;
+ if (def->videos[0]->high_gm_sz)
+ b_info->u.hvm.vgt_high_gm_sz = def->videos[0]->high_gm_sz;
+ if (def->videos[0]->fence_sz)
+ b_info->u.hvm.vgt_fence_sz = def->videos[0]->fence_sz;
+ break;
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 1a2487e999..d9f5256f86 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -195,6 +195,7 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDef *dev,
dev->data.video->vram = 8 * 1024;
}
break;
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
if (dev->data.video->vram == 0) {
if (dm_type == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b02b09a825..61beb44260 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -80,6 +80,7 @@ VIR_ENUM_IMPL(qemuVideo,
"cirrus",
"vmware",
"", /* don't support xen */
+ "", /* don't support xengt */
"", /* don't support vbox */
"qxl",
"", /* don't support parallels */
@@ -756,6 +757,7 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps,
break;
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
case VIR_DOMAIN_VIDEO_TYPE_GOP:
@@ -783,6 +785,7 @@ qemuDeviceVideoGetModel(virQEMUCaps *qemuCaps,
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
case VIR_DOMAIN_VIDEO_TYPE_GOP:
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 251f5b7e1a..52e11584b3 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -871,6 +871,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev,
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_QXL:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 89ea33a3ab..0b842838d8 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1803,6 +1803,7 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitor *mon,
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
@@ -1852,6 +1853,7 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitor *mon,
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_VMVGA:
case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 6f5ff93cf6..bce65382d1 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3045,6 +3045,7 @@ qemuProcessUpdateVideoRamSize(virQEMUDriver *driver,
case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
case VIR_DOMAIN_VIDEO_TYPE_XEN:
+ case VIR_DOMAIN_VIDEO_TYPE_XENGT:
case VIR_DOMAIN_VIDEO_TYPE_VBOX:
case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
--
2.45.2