mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: api: Refactor generic action handler
Rather than save the save a function pointer and use that instead the underlying action. This is useful for two reasons: 1. We can ensure that we generate HttpErrors in the same way as the other endpoints where API error variant should be determined by the request being made not the underlying error. 2. It can be extended to handle other generic actions where the function prototype differs slightly. As result of this refactoring it was found that the "vm.delete" endpoint was not connected so address that issue. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -34,6 +34,9 @@ pub enum HttpError {
|
||||
/// Could not boot a VM
|
||||
VmBoot(ApiError),
|
||||
|
||||
/// Could not delete a VM
|
||||
VmDelete(ApiError),
|
||||
|
||||
/// Could not get the VM information
|
||||
VmInfo(ApiError),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user