-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5440 from psafont/private/paus/split-guard
CA-385323: Enable creating domain sockets while xapi isn't running
- Loading branch information
Showing
8 changed files
with
101 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
+++ | ||
title = "Xapi-guard" | ||
weight = 50 | ||
+++ | ||
|
||
The `xapi-guard` daemon is the component in the xapi toolstack that is responsible for handling persistence requests from VMs (domains). | ||
Currently these are UEFI vars and vTPM updates. | ||
|
||
The code is in `ocaml/xapi-guard`. | ||
When the daemon managed only with UEFI updates it was called `varstored-guard`. | ||
Some files and package names still use the previous name. | ||
|
||
Principles | ||
---------- | ||
1. Calls from domains must be limited in privilege to do certain API calls, and | ||
to read and write from their corresponding VM in xapi's database only. | ||
2. Xenopsd is able to control xapi-guard through message switch, this access is | ||
not limited. | ||
3. Listening to domain socket is restored whenever the daemon restarts to minimize disruption of running domains. | ||
|
||
|
||
Overview | ||
-------- | ||
|
||
Xapi-guard forwards calls from domains to xapi to persist UEFI variables, and update vTPMs. | ||
To do this, it listens to 1 socket per service (varstored, or swtpm) per domain. | ||
To create these sockets before the domains are running, it listens to a message-switch socket. | ||
This socket listens to calls from xenopsd, which orchestrates the domain creation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
) | ||
(library | ||
(name xapi_guard) | ||
(modules dorpc) | ||
(modules dorpc types) | ||
(libraries | ||
rpclib.core | ||
lwt | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Service = struct | ||
type t = Varstored | Swtpm [@@deriving rpcty] | ||
|
||
let to_string = function Varstored -> "Varstored" | Swtpm -> "Swtpm" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Service : sig | ||
type t = Varstored | Swtpm | ||
|
||
val typ_of : t Rpc.Types.typ | ||
|
||
val to_string : t -> string | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters