vmm: api: Introduce new "remove-device" HTTP endpoint

This commit introduces the new command "remove-device" that will let a
user hot-unplug a VFIO PCI device from an already running VM.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-03-09 11:49:15 +01:00
committed by Rob Bradford
parent 991f3bb5da
commit 6cbdb9aa47
8 changed files with 175 additions and 17 deletions

View File

@@ -4,7 +4,7 @@
//
use crate::api::http_endpoint::{
VmActionHandler, VmAddDevice, VmCreate, VmInfo, VmResize, VmmPing, VmmShutdown,
VmActionHandler, VmAddDevice, VmCreate, VmInfo, VmRemoveDevice, VmResize, VmmPing, VmmShutdown,
};
use crate::api::{ApiRequest, VmAction};
use crate::{Error, Result};
@@ -63,6 +63,7 @@ lazy_static! {
r.routes.insert(endpoint!("/vmm.ping"), Box::new(VmmPing {}));
r.routes.insert(endpoint!("/vm.resize"), Box::new(VmResize {}));
r.routes.insert(endpoint!("/vm.add-device"), Box::new(VmAddDevice {}));
r.routes.insert(endpoint!("/vm.remove-device"), Box::new(VmRemoveDevice {}));
r
};