vmm: Add HTTP API to resize the VM

Currently only increasing the number of vCPUs is supported but in the
future it will be extended.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-11-26 16:46:10 +00:00
parent e7d4eae527
commit 86339b4cb4
6 changed files with 117 additions and 3 deletions

View File

@@ -3,7 +3,9 @@
// SPDX-License-Identifier: Apache-2.0
//
use crate::api::http_endpoint::{VmActionHandler, VmCreate, VmInfo, VmmPing, VmmShutdown};
use crate::api::http_endpoint::{
VmActionHandler, VmCreate, VmInfo, VmResize, VmmPing, VmmShutdown,
};
use crate::api::{ApiRequest, VmAction};
use crate::{Error, Result};
use micro_http::{HttpServer, MediaType, Request, Response, StatusCode, Version};
@@ -59,6 +61,7 @@ lazy_static! {
r.routes.insert(endpoint!("/vm.reboot"), Box::new(VmActionHandler::new(VmAction::Reboot)));
r.routes.insert(endpoint!("/vmm.shutdown"), Box::new(VmmShutdown {}));
r.routes.insert(endpoint!("/vmm.ping"), Box::new(VmmPing {}));
r.routes.insert(endpoint!("/vm.resize"), Box::new(VmResize {}));
r
};