Skip to content

Commit 24e8927

Browse files
committed
xenopsd: make vncterm less errorprone
Previous match had a wildcard which made it easy to miss added cases, change it so all the guest types have to be enumerated. Signed-off-by: Pau Ruiz Safont <[email protected]>
1 parent 6ba6544 commit 24e8927

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

ocaml/xenopsd/xc/xenops_server_xen.ml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,11 +2313,12 @@ module VM = struct
23132313
)
23142314
(create_device_model_config vm vmextra vbds vifs vgpus vusbs) ;
23152315
match vm.Vm.ty with
2316-
| Vm.PV {vncterm= true; vncterm_ip= ip; _}
2317-
| Vm.PVH {vncterm= true; vncterm_ip= ip; _}
2318-
| Vm.PVinPVH {vncterm= true; vncterm_ip= ip; _} ->
2319-
Service.PV_Vnc.start ~xs ?ip di.Xenctrl.domid
2320-
| _ ->
2316+
| PV {vncterm; vncterm_ip= ip; _}
2317+
| PVH {vncterm; vncterm_ip= ip; _}
2318+
| PVinPVH {vncterm; vncterm_ip= ip; _} ->
2319+
if vncterm then
2320+
Service.PV_Vnc.start ~xs ?ip di.Xenctrl.domid
2321+
| HVM _ ->
23212322
()
23222323
with Device.Ioemu_failed (name, msg) ->
23232324
raise (Xenopsd_error (Failed_to_start_emulator (vm.Vm.id, name, msg)))

0 commit comments

Comments
 (0)