forked from QubesOS/qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch-0001-xenconsoled-install-xenstore-watch-for-all-supported.patch
74 lines (64 loc) · 2.33 KB
/
patch-0001-xenconsoled-install-xenstore-watch-for-all-supported.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
From c3b0257205bc9944521196dc925037936c58e680 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?=
<marmarek@invisiblethingslab.com>
Date: Fri, 27 Jul 2018 00:03:11 +0200
Subject: [PATCH 1/7] xenconsoled: install xenstore watch for all supported
consoles
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>
Not only for the primary one (/local/domain/<domid>/console path).
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
tools/console/daemon/io.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index a43c57edad..c7e4fa87e2 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -791,24 +791,24 @@ static int console_create_ring(struct console *con)
return err;
}
-static bool watch_domain(struct domain *dom, bool watch)
+static int watch_domain(struct console *con, struct domain *dom, void **data)
{
+ bool watch = data;
char domid_str[3 + MAX_STRLEN(dom->domid)];
bool success;
- struct console *con = &dom->console[0];
snprintf(domid_str, sizeof(domid_str), "dom%u", dom->domid);
if (watch) {
success = xs_watch(xs, con->xspath, domid_str);
if (success)
- console_iter_int_arg1(dom, console_create_ring);
+ console_create_ring(con);
else
xs_unwatch(xs, con->xspath, domid_str);
} else {
success = xs_unwatch(xs, con->xspath, domid_str);
}
- return success;
+ return !success;
}
static int console_init(struct console *con, struct domain *dom, void **data)
@@ -878,7 +878,7 @@ static struct domain *create_domain(int domid)
if (console_iter_int_arg3(dom, console_init, (void **)&con_type))
goto out;
- if (!watch_domain(dom, true))
+ if (console_iter_int_arg3(dom, watch_domain, (void**)true))
goto out;
dom->next = dom_head;
@@ -952,7 +952,7 @@ static void console_close_evtchn(struct console *con)
static void shutdown_domain(struct domain *d)
{
d->is_dead = true;
- watch_domain(d, false);
+ console_iter_int_arg3(d, watch_domain, (void**)false);
console_iter_void_arg1(d, console_unmap_interface);
console_iter_void_arg1(d, console_close_evtchn);
}
--
2.25.4