forked from nrgaway/qubes-core-libvirt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0008-libxl-add-linux-stubdom-support.patch
93 lines (85 loc) · 3.51 KB
/
0008-libxl-add-linux-stubdom-support.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
From 94e42b3c7ddafc4e111c2aeb5e5f9c20937f6321 Mon Sep 17 00:00:00 2001
From: HW42 <hw42@ipsumj.de>
Date: Sat, 22 Apr 2017 08:56:59 +0200
Subject: [PATCH] libxl: add linux stubdom support
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 | 2 ++
src/conf/domain_conf.c | 3 ++-
src/conf/domain_conf.h | 1 +
src/libxl/libxl_conf.c | 8 +++++++-
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index a8d12f3730..f7cc3e2ac9 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -3470,6 +3470,7 @@
<choice>
<value>qemu</value>
<value>stubdom</value>
+ <value>stubdom-linux</value>
</choice>
</attribute>
</optional>
@@ -3485,6 +3486,7 @@
<choice>
<value>qemu</value>
<value>stubdom</value>
+ <value>stubdom-linux</value>
</choice>
</attribute>
<empty/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 99bee990d5..111767b552 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1148,7 +1148,8 @@ VIR_ENUM_IMPL(virDomainDiskTray,
VIR_ENUM_IMPL(virDomainEmulatorType,
VIR_DOMAIN_EMULATOR_TYPE_LAST,
"qemu",
- "stubdom");
+ "stubdom",
+ "stubdom-linux");
VIR_ENUM_IMPL(virDomainRNGModel,
VIR_DOMAIN_RNG_MODEL_LAST,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index bf73602c00..672dded2a5 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2210,6 +2210,7 @@ struct _virBlkioDevice {
typedef enum {
VIR_DOMAIN_EMULATOR_TYPE_DEFAULT,
VIR_DOMAIN_EMULATOR_TYPE_STUBDOM,
+ VIR_DOMAIN_EMULATOR_TYPE_STUBDOM_LINUX,
VIR_DOMAIN_EMULATOR_TYPE_LAST
} virDomainEmulatorType;
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0b2ea0331e..007ceb902a 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -591,6 +591,11 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
b_info->device_model = g_strdup(def->emulator);
b_info->device_model_version = libxlDomainGetEmulatorType(def);
+ } else {
+ if (def->emulator_type == VIR_DOMAIN_EMULATOR_TYPE_STUBDOM)
+ b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+ else if (def->emulator_type == VIR_DOMAIN_EMULATOR_TYPE_STUBDOM_LINUX)
+ b_info->device_model_version = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
}
/* In case of stubdom there will be two qemu instances:
@@ -599,7 +604,8 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
* Emulator path control only the second one. It makes a perfect sense
* to use <emulator type='stubdom'/> (yes, without emulator path).
*/
- if (def->emulator_type == VIR_DOMAIN_EMULATOR_TYPE_STUBDOM)
+ if (def->emulator_type == VIR_DOMAIN_EMULATOR_TYPE_STUBDOM ||
+ def->emulator_type == VIR_DOMAIN_EMULATOR_TYPE_STUBDOM_LINUX)
libxl_defbool_set(&b_info->device_model_stubdomain, 1);
if (def->emulator_cmdline && def->emulator_cmdline[0]) {
--
2.25.4