forked from nrgaway/qubes-core-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0019-libxl-add-support-for-qubes-graphic-device.patch
185 lines (173 loc) · 6.43 KB
/
0019-libxl-add-support-for-qubes-graphic-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
From c10a662d6515a3d1f9e2aba21fef4049304e8ddb Mon Sep 17 00:00:00 2001
From: HW42 <hw42@ipsumj.de>
Date: Sat, 22 Apr 2017 08:57:58 +0200
Subject: [PATCH] libxl: add support for qubes graphic device
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Invisible Things Lab
Cc: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 9 +++++++++
src/conf/domain_conf.h | 1 +
src/libxl/libxl_conf.c | 6 ++++++
src/qemu/qemu_command.c | 2 ++
src/qemu/qemu_process.c | 4 ++++
tests/domaincapsschemadata/full.xml | 1 +
7 files changed, 28 insertions(+)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index c58a39e..abbd8b8 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3198,6 +3198,11 @@
</attribute>
</optional>
</group>
+ <group>
+ <attribute name="type">
+ <value>qubes</value>
+ </attribute>
+ </group>
</choice>
</element>
</define>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6e6abbb..e34835f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -575,6 +575,7 @@ VIR_ENUM_IMPL(virDomainGraphics, VIR_DOMAIN_GRAPHICS_TYPE_LAST,
"vnc",
"rdp",
"desktop",
+ "qubes",
"spice")
VIR_ENUM_IMPL(virDomainGraphicsListen, VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST,
@@ -1324,6 +1325,9 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def)
virDomainGraphicsAuthDefClear(&def->data.spice.auth);
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
+ break;
+
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -12555,6 +12559,8 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
if (virDomainGraphicsDefParseXMLDesktop(def, node) < 0)
goto error;
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
+ break;
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
if (virDomainGraphicsDefParseXMLSpice(def, node, ctxt, flags) < 0)
goto error;
@@ -23530,6 +23536,9 @@ virDomainGraphicsDefFormat(virBufferPtr buf,
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
+ break;
+
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
if (!glisten) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index d952a22..d5eab96 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1378,6 +1378,7 @@ typedef enum {
VIR_DOMAIN_GRAPHICS_TYPE_VNC,
VIR_DOMAIN_GRAPHICS_TYPE_RDP,
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP,
+ VIR_DOMAIN_GRAPHICS_TYPE_QUBES,
VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
VIR_DOMAIN_GRAPHICS_TYPE_LAST
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index cb8c642..b501bba 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1284,6 +1284,9 @@ libxlMakeVfb(virPortAllocatorPtr graphicsports,
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
+ libxl_defbool_set(&x_vfb->vnc.enable, false);
+ libxl_defbool_set(&x_vfb->sdl.enable, false);
}
return 0;
@@ -1362,6 +1365,9 @@ libxlMakeBuildInfoVfb(virPortAllocatorPtr graphicsports,
unsigned short port;
virDomainGraphicsListenDefPtr glisten = NULL;
+ if (l_vfb->type == VIR_DOMAIN_GRAPHICS_TYPE_QUBES)
+ libxl_defbool_set(&b_info->u.hvm.qubes_gui, true);
+
if (l_vfb->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE)
continue;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 813a851..2130f1e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8185,6 +8185,7 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported graphics type '%s'"),
@@ -9771,6 +9772,7 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver,
break;
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index c19bd29..266b640 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4242,6 +4242,7 @@ qemuProcessGraphicsReservePorts(virQEMUDriverPtr driver,
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -4280,6 +4281,7 @@ qemuProcessGraphicsAllocatePorts(virQEMUDriverPtr driver,
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -4342,6 +4344,7 @@ qemuProcessGraphicsSetupListen(virQEMUDriverPtr driver,
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
@@ -4629,6 +4632,7 @@ qemuProcessStartValidateGraphics(virDomainObjPtr vm)
case VIR_DOMAIN_GRAPHICS_TYPE_SDL:
case VIR_DOMAIN_GRAPHICS_TYPE_RDP:
case VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP:
+ case VIR_DOMAIN_GRAPHICS_TYPE_QUBES:
case VIR_DOMAIN_GRAPHICS_TYPE_LAST:
break;
}
diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemadata/full.xml
index 82a9232..5c15fff 100644
--- a/tests/domaincapsschemadata/full.xml
+++ b/tests/domaincapsschemadata/full.xml
@@ -57,6 +57,7 @@
<value>vnc</value>
<value>rdp</value>
<value>desktop</value>
+ <value>qubes</value>
<value>spice</value>
</enum>
</graphics>
--
2.7.4