Skip to content

Commit 3b75cb1

Browse files
Andrew Jonesandreeaflorescu
authored andcommitted
aarch64: Fix create_vm_with_ipa_size test
When KVM doesn't support Cap::ArmVmIPASize the VMM must use a KVM type of zero. Also fix a comment for get_host_ipa_limit. Signed-off-by: Andrew Jones <drjones@redhat.com>
1 parent e188905 commit 3b75cb1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ioctls/system.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl Kvm {
9898

9999
/// AArch64 specific call to get the host Intermediate Physical Address space limit.
100100
///
101-
/// Returns 0 if the capability is not available and an integer larger than 32 otherwise.
101+
/// Returns 0 if the capability is not available and an integer >= 32 otherwise.
102102
#[cfg(any(target_arch = "aarch64"))]
103103
pub fn get_host_ipa_limit(&self) -> i32 {
104104
self.check_extension_int(Cap::ArmVmIPASize)
@@ -632,8 +632,8 @@ mod tests {
632632
.create_vm_with_ipa_size((host_ipa_limit + 1) as u32)
633633
.is_err());
634634
} else {
635-
// Unsupported, here we can test with the default value 40.
636-
assert!(kvm.create_vm_with_ipa_size(40).is_err());
635+
// Unsupported, we can't provide an IPA size. Only KVM type=0 works.
636+
assert!(kvm.create_vm_with_type(0).is_err());
637637
}
638638
}
639639

0 commit comments

Comments
 (0)