From e68edb3b85cdae1460de1d3052cec6464d2a6ae6 Mon Sep 17 00:00:00 2001 From: Mateo Fernandez Date: Mon, 6 May 2024 04:02:17 +0200 Subject: [PATCH] fix: remove unnecessary async in VMM::new Signed-off-by: Mateo Fernandez --- src/vmm/src/core/vmm.rs | 2 +- src/vmm/src/grpc/server.rs | 4 +--- src/vmm/src/main.rs | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vmm/src/core/vmm.rs b/src/vmm/src/core/vmm.rs index 5e0fe70..d61d2b5 100644 --- a/src/vmm/src/core/vmm.rs +++ b/src/vmm/src/core/vmm.rs @@ -69,7 +69,7 @@ pub struct VMM { impl VMM { /// Create a new VMM. - pub async fn new( + pub fn new( iface_host_addr: Ipv4Addr, netmask: Ipv4Addr, iface_guest_addr: Ipv4Addr, diff --git a/src/vmm/src/grpc/server.rs b/src/vmm/src/grpc/server.rs index a103180..898a60f 100644 --- a/src/vmm/src/grpc/server.rs +++ b/src/vmm/src/grpc/server.rs @@ -212,9 +212,7 @@ impl VmmServiceTrait for VmmService { let initramfs_path = self.get_initramfs(&language, curr_dir.as_os_str())?; - let mut vmm = VMM::new(HOST_IP, HOST_NETMASK, GUEST_IP) - .await - .map_err(VmmErrors::VmmNew)?; + let mut vmm = VMM::new(HOST_IP, HOST_NETMASK, GUEST_IP).map_err(VmmErrors::VmmNew)?; // Configure the VMM parameters might need to be calculated rather than hardcoded vmm.configure(1, 4000, kernel_path, &Some(initramfs_path)) diff --git a/src/vmm/src/main.rs b/src/vmm/src/main.rs index 6e39936..a544d9a 100644 --- a/src/vmm/src/main.rs +++ b/src/vmm/src/main.rs @@ -45,7 +45,6 @@ async fn main() -> Result<(), Box> { cli_args.netmask, cli_args.iface_guest_addr, ) - .await .map_err(VmmErrors::VmmNew) .unwrap();