From 3534540e6b0981f6b25017a52a68ab957cc95762 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Thu, 20 Feb 2020 11:50:57 +0100 Subject: [PATCH] vmm: api: Return a resize error when resize fails And not a VmCreate one. Signed-off-by: Samuel Ortiz (cherry picked from commit c49e31a6d946c7024cd9b8cdd87eb550c556fee3) --- vmm/src/api/http_endpoint.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vmm/src/api/http_endpoint.rs b/vmm/src/api/http_endpoint.rs index bab243df4..615f16a30 100644 --- a/vmm/src/api/http_endpoint.rs +++ b/vmm/src/api/http_endpoint.rs @@ -44,6 +44,9 @@ pub enum HttpError { /// Could not act on a VM VmAction(ApiError), + /// Could not resize a VM + VmResize(ApiError), + /// Could not shut the VMM down VmmShutdown(ApiError), @@ -244,7 +247,7 @@ impl EndpointHandler for VmResize { // Call vm_resize() match vm_resize(api_notifier, api_sender, Arc::new(vm_resize_data)) - .map_err(HttpError::VmCreate) + .map_err(HttpError::VmResize) { Ok(_) => Response::new(Version::Http11, StatusCode::NoContent), Err(e) => error_response(e, StatusCode::InternalServerError),