kata-ctl: direct-volume: add Add and Remove handlers

This commit adds direct-volume command handlers for kata-ctl,
 including add, remove, stats and resize. Stats and resize
makes HTTP over UDS calls to runtime-rs while add and remove
 runs locally on the host.

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>

kata-ctl: direct-volume: add Add and Remove handlers

This commit adds direct-volume command handlers for kata-ctl,
 including add, remove, stats and resize. Stats and resize
makes HTTP over UDS calls to runtime-rs while add and remove
 runs locally on the host.

Fixes #5341

Signed-off-by: Tingzhou Yuan <tzyuan15@bu.edu>
This commit is contained in:
Tingzhou Yuan
2022-12-06 06:15:50 +00:00
parent 2d4b2cf72c
commit 8451db7c0c
10 changed files with 840 additions and 24 deletions

View File

@@ -20,8 +20,8 @@ pub use types::{
GetIPTablesResponse, GuestDetailsResponse, HealthCheckResponse, IPAddress, IPFamily, Interface,
Interfaces, ListProcessesRequest, MemHotplugByProbeRequest, OnlineCPUMemRequest,
OomEventResponse, ReadStreamRequest, ReadStreamResponse, RemoveContainerRequest,
ReseedRandomDevRequest, Route, Routes, SetGuestDateTimeRequest, SetIPTablesRequest,
SetIPTablesResponse, SignalProcessRequest, StatsContainerResponse, Storage,
ReseedRandomDevRequest, ResizeVolumeRequest, Route, Routes, SetGuestDateTimeRequest,
SetIPTablesRequest, SetIPTablesResponse, SignalProcessRequest, StatsContainerResponse, Storage,
TtyWinResizeRequest, UpdateContainerRequest, UpdateInterfaceRequest, UpdateRoutesRequest,
VersionCheckResponse, WaitProcessRequest, WaitProcessResponse, WriteStreamRequest,
WriteStreamResponse,

View File

@@ -7,7 +7,7 @@
use anyhow::{anyhow, Result};
use std::convert::TryFrom;
use serde::Deserialize;
use serde::{Deserialize, Serialize};
#[derive(PartialEq, Clone, Default)]
pub struct Empty {}
@@ -561,6 +561,14 @@ pub struct OomEventResponse {
pub container_id: String,
}
// ResizeVolumeRequest is also the common struct for serialization and deserialization with json
// between shim-client HTTP calls to the shim-mgmt-server
#[derive(Serialize, Deserialize, PartialEq, Clone, Default, Debug)]
pub struct ResizeVolumeRequest {
pub volume_guest_path: String,
pub size: u64,
}
#[cfg(test)]
mod test {
use std::convert::TryFrom;