mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +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 c49e31a6d9
)
This commit is contained in:
parent
f444451a04
commit
3534540e6b
@ -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…
Reference in New Issue
Block a user