mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +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>
This commit is contained in:
parent
ebc6391bea
commit
c49e31a6d9
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user