mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
arch: use hypervsisor::new in test cases
Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -650,8 +650,7 @@ mod tests {
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let hv = hypervisor::new().unwrap();
|
||||
let vm = hv.create_vm().unwrap();
|
||||
let gic = create_gic(&vm, 1, false).unwrap();
|
||||
assert!(create_fdt(
|
||||
|
||||
@@ -177,8 +177,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_create_gic() {
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let hv = hypervisor::new().unwrap();
|
||||
let vm = hv.create_vm().unwrap();
|
||||
|
||||
assert!(create_gic(&vm, 1, false).is_ok());
|
||||
|
||||
@@ -163,8 +163,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_setup_regs() {
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let hv = hypervisor::new().unwrap();
|
||||
let vm = hv.create_vm().unwrap();
|
||||
let vcpu = vm.create_vcpu(0).unwrap();
|
||||
let mut regions = Vec::new();
|
||||
@@ -182,8 +181,7 @@ mod tests {
|
||||
}
|
||||
#[test]
|
||||
fn test_read_mpidr() {
|
||||
let kvm = hypervisor::kvm::KvmHypervisor::new().unwrap();
|
||||
let hv: Arc<dyn hypervisor::Hypervisor> = Arc::new(kvm);
|
||||
let hv = hypervisor::new().unwrap();
|
||||
let vm = hv.create_vm().unwrap();
|
||||
let vcpu = vm.create_vcpu(0).unwrap();
|
||||
let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default();
|
||||
|
||||
Reference in New Issue
Block a user