File tree Expand file tree Collapse file tree
openvmm/openvmm_hypervisors/src
vmm_tests/vmm_tests/tests/tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,28 @@ pub fn mshv_partition_scrub_available() -> bool {
8080 }
8181}
8282
83+ /// Returns whether WHP supports nested partition reset on this machine.
84+ pub fn whp_nested_reset_available ( ) -> bool {
85+ #[ cfg( all(
86+ target_os = "windows" ,
87+ feature = "virt_whp" ,
88+ guest_is_native,
89+ guest_arch = "x86_64"
90+ ) ) ]
91+ {
92+ virt_whp:: is_nested_reset_available ( )
93+ }
94+ #[ cfg( not( all(
95+ target_os = "windows" ,
96+ feature = "virt_whp" ,
97+ guest_is_native,
98+ guest_arch = "x86_64"
99+ ) ) ) ]
100+ {
101+ false
102+ }
103+ }
104+
83105#[ expect( clippy:: allow_attributes, reason = "lots of conditions" ) ]
84106#[ allow( dead_code) ]
85107pub ( crate ) fn parse_bool_param ( key : & str , val : & str ) -> anyhow:: Result < bool > {
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ impl HostContext {
170170 let nested_reset_supported = match openvmm_hypervisor {
171171 Some ( OpenVmmHypervisor :: Kvm ) => openvmm_hypervisors:: kvm_nested_state_available ( ) ,
172172 Some ( OpenVmmHypervisor :: Mshv ) => openvmm_hypervisors:: mshv_partition_scrub_available ( ) ,
173+ Some ( OpenVmmHypervisor :: Whp ) => openvmm_hypervisors:: whp_nested_reset_available ( ) ,
173174 _ => false ,
174175 } ;
175176
Original file line number Diff line number Diff line change @@ -971,6 +971,12 @@ pub fn is_available() -> Result<bool, Error> {
971971 whp:: capabilities:: hypervisor_present ( ) . for_op ( "query hypervisor presence" )
972972}
973973
974+ /// Returns whether WHP can reset partitions with nested virtualization enabled.
975+ #[ cfg( guest_arch = "x86_64" ) ]
976+ pub fn is_nested_reset_available ( ) -> bool {
977+ whp:: capabilities:: reset_partition ( )
978+ }
979+
974980/// The prototype partition.
975981pub struct WhpProtoPartition < ' a > {
976982 vtl0 : VtlPartition ,
Original file line number Diff line number Diff line change 33
44//! Nested vm host definitions
55
6- #[ cfg( target_os = "linux" ) ]
76use anyhow:: Context as _;
87use petri:: PetriVmBuilder ;
98#[ cfg( target_os = "linux" ) ]
109use petri:: PetriVmmBackend ;
1110use petri:: openvmm:: OpenVmmPetriBackend ;
12- #[ cfg( target_os = "linux" ) ]
1311use petri_artifacts_vmm_test:: artifacts:: host_tools:: NEXTEST_VMM_TESTS_ARCHIVE_LINUX_X64_MUSL ;
1412
1513pub ( crate ) async fn vm_host ( config : PetriVmBuilder < OpenVmmPetriBackend > ) -> anyhow:: Result < ( ) > {
@@ -151,7 +149,6 @@ async fn reboot_nested_virt(config: PetriVmBuilder<OpenVmmPetriBackend>) -> anyh
151149
152150/// Reboot a Linux L2 three times. The `reboot_l1` variant reruns this after
153151/// rebooting L1, proving L2 can launch after previously used nested state resets.
154- #[ cfg( target_os = "linux" ) ]
155152#[ vmm_test_macros:: vmm_test(
156153 nested(
157154 ( vm_host, openvmm_linux_direct_x64) ,
You can’t perform that action at this time.
0 commit comments