Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Velickovic <[email protected]>
  • Loading branch information
Ivan-Velickovic committed Jul 8, 2024
1 parent 85a18a1 commit 5c6fd2c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/virtio/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,14 @@ pub fn build(b: *Build) void {
// Create virtual disk if it doesn't exist or if the user wants to create a new one
const made_virtdisk = blk: {
if (mkvirtdisk_option or !fileExists(b.getInstallPath(.prefix, virtdisk_name))) {
// TODO: Make these configurable options
// Depends on the number of clients, right now we always have two clients.
const num_part = 2;
const logical_size = 512;
const blk_mem = 2101248;
_, virtdisk = libvmm_mod.mkvirtdisk(b, num_part, logical_size, blk_mem);
// Configurable for the user
// Default to 512 bytes
const logical_size = b.option(usize, "virtdisk_logical_size", "Logical size for the virtual disk") orelse 512;
// Default to 2MB
const capacity = b.option(usize, "virtdisk_capacity", "Capacity of the virtual disk") orelse 2 * 1024 * 1024;
_, virtdisk = libvmm_mod.mkvirtdisk(b, num_part, logical_size, capacity);
break :blk true;
} else {
break :blk false;
Expand Down

0 comments on commit 5c6fd2c

Please sign in to comment.