Skip to content

Commit 437e4b7

Browse files
committed
to-disk: Add --composefs-native
Mirroring the bootc option. Though I'm trying to get rid of this and have it be autodetected. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 1acf965 commit 437e4b7

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

crates/kit/src/install_options.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use clap::Parser;
1212
/// These options control filesystem configuration and storage paths
1313
/// for bootc installation commands. Use `#[clap(flatten)]` to include
1414
/// these in command-specific option structures.
15-
#[derive(Debug, Parser, Clone)]
15+
#[derive(Debug, Default, Parser, Clone)]
1616
pub struct InstallOptions {
1717
/// Root filesystem type (overrides bootc image default)
1818
#[clap(long, help = "Root filesystem type (e.g. ext4, xfs, btrfs)")]
@@ -28,6 +28,10 @@ pub struct InstallOptions {
2828
help = "Path to host container storage (auto-detected if not specified)"
2929
)]
3030
pub storage_path: Option<Utf8PathBuf>,
31+
32+
/// Default to composefs-native storage
33+
#[clap(long)]
34+
pub composefs_native: bool,
3135
}
3236

3337
impl InstallOptions {
@@ -45,6 +49,10 @@ impl InstallOptions {
4549
args.push(root_size.clone());
4650
}
4751

52+
if self.composefs_native {
53+
args.push("--composefs-native".to_owned());
54+
}
55+
4856
args
4957
}
5058
}

crates/kit/src/libvirt/run.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ pub fn run(global_opts: &crate::libvirt::LibvirtOptions, opts: LibvirtRunOpts) -
139139
format: crate::to_disk::Format::Raw, // Default to raw format
140140
install: InstallOptions {
141141
filesystem: Some(opts.filesystem.clone()),
142-
root_size: None,
143-
storage_path: None,
142+
..Default::default()
144143
},
145144
common: CommonVmOpts {
146145
memory: opts.memory.clone(),

crates/kit/src/to_disk.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,7 @@ mod tests {
490490
label: Default::default(),
491491
install: InstallOptions {
492492
filesystem: Some("ext4".to_string()),
493-
root_size: None,
494-
storage_path: None,
493+
..Default::default()
495494
},
496495
disk_size: Some("10G".to_string()),
497496
format: Format::Raw,
@@ -509,8 +508,7 @@ mod tests {
509508
label: Default::default(),
510509
install: InstallOptions {
511510
filesystem: Some("ext4".to_string()),
512-
root_size: None,
513-
storage_path: None,
511+
..Default::default()
514512
},
515513
disk_size: Some("5120M".to_string()),
516514
format: Format::Raw,

docs/src/man/bcvk-libvirt-create.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ Create and start domains from uploaded bootc volumes
8181

8282
Path to host container storage (auto-detected if not specified)
8383

84+
**--composefs-native**
85+
86+
Default to composefs-native storage
87+
8488
**--disk-size**=*DISK_SIZE*
8589

8690
Size of the disk image for automatic upload (e.g., '20G', '10240M')

docs/src/man/bcvk-libvirt-upload.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Upload bootc disk images to libvirt with metadata annotations
4545

4646
Path to host container storage (auto-detected if not specified)
4747

48+
**--composefs-native**
49+
50+
Default to composefs-native storage
51+
4852
**--memory**=*MEMORY*
4953

5054
Memory size (e.g. 4G, 2048M, or plain number for MB)

docs/src/man/bcvk-to-disk.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ The installation process:
4747

4848
Path to host container storage (auto-detected if not specified)
4949

50+
**--composefs-native**
51+
52+
Default to composefs-native storage
53+
5054
**--disk-size**=*DISK_SIZE*
5155

5256
Disk size to create (e.g. 10G, 5120M, or plain number for bytes)

0 commit comments

Comments
 (0)