Skip to content

Commit 0011f40

Browse files
committed
kms: Allow default values in VmConfig
1 parent 88b6ae8 commit 0011f40

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

dstack-types/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,19 @@ pub struct VmConfig {
134134
pub cpu_count: u8,
135135
pub memory_size: u64,
136136
// https://github.com/intel-staging/qemu-tdx/issues/1
137+
#[serde(default)]
137138
pub qemu_single_pass_add_pages: bool,
139+
#[serde(default)]
138140
pub pic: bool,
141+
#[serde(default)]
139142
pub pci_hole64_size: u64,
143+
#[serde(default)]
140144
pub hugepages: bool,
145+
#[serde(default)]
141146
pub num_gpus: u32,
147+
#[serde(default)]
142148
pub num_nvswitches: u32,
149+
#[serde(default)]
143150
pub hotplug_off: bool,
144151
}
145152

kms/src/main_service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use scale::Decode;
2424
use serde::{Deserialize, Serialize};
2525
use sha2::Digest;
2626
use tokio::{io::AsyncWriteExt, process::Command};
27-
use tracing::info;
27+
use tracing::{debug, info};
2828
use upgrade_authority::BootInfo;
2929

3030
use crate::{
@@ -429,6 +429,7 @@ impl RpcHandler {
429429
.as_td10()
430430
.context("Failed to decode TD report")?;
431431
let app_info = att.decode_app_info(use_boottime_mr)?;
432+
debug!("vm_config: {vm_config}");
432433
let vm_config: VmConfig =
433434
serde_json::from_str(vm_config).context("Failed to decode VM config")?;
434435
let os_image_hash = vm_config.os_image_hash.clone();

0 commit comments

Comments
 (0)