Skip to content

Commit c41c17d

Browse files
authored
Merge pull request #266 from Dstack-TEE/nr-cpus
dstack-mr: Support for more than 255 CPUs
2 parents 680ad6f + 68ad465 commit c41c17d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

dstack-mr/cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ type Bool = bool;
2424
struct MachineConfig {
2525
/// Number of CPUs
2626
#[arg(short, long, default_value = "1")]
27-
cpu: u8,
27+
cpu: u32,
2828

2929
/// Memory size in bytes
3030
#[arg(short, long, default_value = "2G", value_parser = parse_memory_size)]

dstack-mr/src/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use log::debug;
88

99
#[derive(Debug, bon::Builder)]
1010
pub struct Machine<'a> {
11-
pub cpu_count: u8,
11+
pub cpu_count: u32,
1212
pub memory_size: u64,
1313
pub firmware: &'a str,
1414
pub kernel: &'a str,

dstack-types/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ pub struct VmConfig {
131131
pub spec_version: u32,
132132
#[serde(with = "hex_bytes")]
133133
pub os_image_hash: Vec<u8>,
134-
pub cpu_count: u8,
134+
pub cpu_count: u32,
135135
pub memory_size: u64,
136136
// https://github.com/intel-staging/qemu-tdx/issues/1
137137
#[serde(default)]

vmm/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ impl App {
484484
let vm_config = serde_json::to_string(&dstack_types::VmConfig {
485485
spec_version: 1,
486486
os_image_hash,
487-
cpu_count: manifest.vcpu.try_into().context("Too many vCPUs")?,
487+
cpu_count: manifest.vcpu,
488488
memory_size: manifest.memory as u64 * 1024 * 1024,
489489
qemu_single_pass_add_pages: cfg.cvm.qemu_single_pass_add_pages,
490490
pic: cfg.cvm.qemu_pic,

0 commit comments

Comments
 (0)