@@ -12,7 +12,6 @@ mod command_line;
1212use std:: collections:: BTreeMap ;
1313use std:: ffi:: { OsStr , OsString } ;
1414use std:: fmt;
15- use std:: ops:: RangeInclusive ;
1615use std:: path:: { Path , PathBuf } ;
1716use std:: time:: Duration ;
1817
@@ -27,7 +26,9 @@ use crate::hex::{parse_hex, write_hex};
2726use crate :: net:: Ipv4Cidr ;
2827use crate :: protocol:: cmdline:: { self , Parameter } ;
2928use crate :: protocol:: maps:: HostMap ;
30- use crate :: protocol:: root:: { ImageFormat , Journal , OverlayMode , RootImage , RootLayout , RootUpper } ;
29+ use crate :: protocol:: root:: {
30+ ImageFormat , Journal , OverlayMode , RAM_UPPER_CAPS , RootImage , RootLayout , RootUpper ,
31+ } ;
3132use crate :: protocol:: view:: { self , MAX_HOSTNAME_BYTES , View } ;
3233
3334pub ( crate ) use self :: command_line:: check_argument_nuls;
@@ -47,9 +48,6 @@ const OPENVMM_COMMAND_LINE_RESERVE: usize = 2048;
4748/// that [`Ipv4Cidr::parse`] reads.
4849pub const DEFAULT_GUEST_NETWORK : & str = "10.0.0.2/24" ;
4950
50- /// The caps of a RAM upper that [`VmConfig::check`] accepts, in percent of the VM's memory.
51- const RAM_UPPER_CAPS : RangeInclusive < u8 > = 1 ..=90 ;
52-
5351/// The names of the cold boot tokens that OpenVMM's machine profile owns and supplies itself,
5452/// beside the `virtfs_*` ones that NVX reserves: the consoles, device discovery, the NIC's
5553/// bootstrap, the processor capacity, the capture tier, and the workload's identity and lifecycle.
@@ -1129,8 +1127,10 @@ impl LayeredRoot {
11291127 if !RAM_UPPER_CAPS . contains ( max_memory_percent) =>
11301128 {
11311129 Err ( Error :: unsupported ( format ! (
1132- "the RAM upper's cap of {max_memory_percent}% of the VM's memory is not 1 to \
1133- 90%"
1130+ "the RAM upper's cap of {max_memory_percent}% of the VM's memory is not {} to \
1131+ {}%",
1132+ RAM_UPPER_CAPS . start( ) ,
1133+ RAM_UPPER_CAPS . end( )
11341134 ) ) )
11351135 }
11361136 _ => Ok ( ( ) ) ,
0 commit comments