mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: api: Use a common handler for data actions too
Like the actions that don't take data such as "pause" or "resume" use a common handler implementation to remove duplicated code for handling simple endpoints like the hotplug ones. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
@@ -149,18 +149,18 @@ pub struct VmmPingResponse {
|
||||
pub version: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, Serialize, Default)]
|
||||
pub struct VmResizeData {
|
||||
pub desired_vcpus: Option<u8>,
|
||||
pub desired_ram: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, Serialize, Default)]
|
||||
pub struct VmRemoveDeviceData {
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Serialize)]
|
||||
#[derive(Clone, Deserialize, Serialize, Default)]
|
||||
pub struct VmSnapshotConfig {
|
||||
/// The snapshot destination URL
|
||||
pub destination_url: String,
|
||||
@@ -384,7 +384,6 @@ pub fn vm_resume(api_evt: EventFd, api_sender: Sender<ApiRequest>) -> ApiResult<
|
||||
vm_action(api_evt, api_sender, VmAction::Resume)
|
||||
}
|
||||
|
||||
|
||||
pub fn vm_snapshot(
|
||||
api_evt: EventFd,
|
||||
api_sender: Sender<ApiRequest>,
|
||||
|
||||
Reference in New Issue
Block a user