runtime: qemu: tdx: Support mrconfigid / mrowner/ mrownerconfig

This is a quick and simple pre-req for supporting initData, which will
take advantage of the mrconfigid in the TDX case.

While already adding mrconfigid, which is hardcoded empty right now,
let's do the same for mrowner and mrownerconfig, and leave it prepared
for future expansions.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
This commit is contained in:
Fabiano Fidêncio
2024-09-06 14:44:59 +02:00
parent 8285957678
commit 7818484120

View File

@@ -437,6 +437,9 @@ type SocketAddress struct {
type TdxQomObject struct {
QomType string `json:"qom-type"`
Id string `json:"id"`
MrConfigId string `json:"mrconfigid,omitempty"`
MrOwner string `json:"mrowner,omitempty"`
MrOwnerConfig string `json:"mrownerconfig,omitempty"`
QuoteGenerationSocket SocketAddress `json:"quote-generation-socket"`
Debug *bool `json:"debug,omitempty"`
}
@@ -465,7 +468,14 @@ func (this *TdxQomObject) String() string {
func prepareTDXObject(object Object) string {
qgsSocket := SocketAddress{"vsock", fmt.Sprint(VsockHostCid), fmt.Sprint(object.QgsPort)}
tdxObject := TdxQomObject{string(object.Type), object.ID, qgsSocket, nil}
tdxObject := TdxQomObject{
string(object.Type), // qom-type
object.ID, // id
"", // mrconfigid
"", // mrowner
"", // mrownerconfig
qgsSocket, // quote-generation-socket
nil}
if object.Debug {
*tdxObject.Debug = true