1
0
mirror of https://github.com/cloud-hypervisor/cloud-hypervisor.git synced 2025-03-07 17:26:14 +00:00

vmm: api: Return a resize error when resize fails

And not a VmCreate one.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
(cherry picked from commit c49e31a6d946c7024cd9b8cdd87eb550c556fee3)
This commit is contained in:
Samuel Ortiz 2020-02-20 11:50:57 +01:00 committed by Rob Bradford
parent f444451a04
commit 3534540e6b

View File

@ -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),