Skip to content

Commit b4de7ae

Browse files
committed
CP-16624 Added new command 'ignore' to ignore control message
You can now use next:ignore to tell the kernel to ignore the next control message that it receives. Signed-off-by: Christian Lindig <[email protected]>
1 parent 3cc88dc commit b4de7ae

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ install: all
1414
ssh $(HOST) "test -d /boot/guest || mkdir /boot/guest"
1515
ssh $(HOST) "cd /boot/guest; rm -f test-vm.xen"
1616
scp src/test-vm.xen.gz $(HOST):/boot/guest
17-
ssh $(HOST) "cd /boot/guest; gunzip test-vm.xen.gz"
1817

1918
remove:
2019
true

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ release. The file goes into `/boot/guest` on a host:
3030

3131
HOST=host
3232
ssh root@$HOST "test -d /boot/guest || mkdir /boot/guest"
33-
scp test-vm.xen root@$HOST:/boot/guest
33+
scp test-vm.xen.gz root@$HOST:/boot/guest
3434

3535
The kernel needs to be registered with Xen on the host. As root on
3636
`$HOST`, do:
3737

3838
xe vm-create name-label=minion
3939
# this echoes a UUID for the new VM named "minion"
40-
xe vm-param-set PV-kernel=/boot/guest/test-vm.xen uuid=$UUID
40+
xe vm-param-set PV-kernel=/boot/guest/test-vm.xen.gz uuid=$UUID
4141

4242
Once installed, use the CLI on the host to operate the VM or use
4343
XenCenter.
@@ -78,6 +78,7 @@ the hypervisor only sends these.
7878
reboot
7979
halt
8080
crash
81+
ignore
8182

8283
## Testing Messages
8384

@@ -88,6 +89,7 @@ The kernel reads messages in "control/testing". Legal messages are:
8889
now:reboot
8990
now:halt
9091
now:crash
92+
now:ignore
9193

9294
Each makes the kernel respond to these immediately. In addition, these
9395
messages are legal:
@@ -97,6 +99,7 @@ messages are legal:
9799
next:reboot
98100
next:halt
99101
next:crash
102+
next:ignore
100103

101104
The next time the kernel receives a shutdown message, it ignores the
102105
message it received and acts on the next:message instead. This permits

src/commands.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type shutdown =
77
| Reboot
88
| Halt
99
| Crash
10+
| Ignore
1011

1112
type testing =
1213
| Now of shutdown

src/commands.mll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
| Reboot
1313
| Halt
1414
| Crash
15+
| Ignore
1516

1617
type testing =
1718
| Now of shutdown
@@ -24,6 +25,7 @@
2425
| "reboot" { Reboot }
2526
| "halt" { Halt }
2627
| "crash" { Crash }
28+
| "ignore" { Ignore }
2729
| _ { raise (Error "unknown shutdown command") }
2830

2931
and testing = parse
@@ -45,6 +47,7 @@
4547
| Reboot -> "reboot"
4648
| Halt -> "halt"
4749
| Crash -> "crash"
50+
| Ignore -> "ignore"
4851

4952
let testing = function
5053
| Now(msg) -> Printf.sprintf "now:%s" (shutdown msg)

src/mirage_vm.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ module Main (C: V1_LWT.CONSOLE) = struct
6262
| CMD.Reboot -> reboot ()
6363
| CMD.Halt -> halt ()
6464
| CMD.Crash -> crash ()
65+
| CMD.Ignore -> return false
6566

6667

67-
(* event loop *)
68+
(* event loop *)
6869
let start c =
6970
OS.Xs.make () >>= fun client ->
7071
let rec loop tick override =

0 commit comments

Comments
 (0)