libs: Add AddSwapPath to service AgentService

AddSwap send the pci path to guest kernel to let it add swap device.
But some mmio device doesn't have pci path.  To support it add
AddSwapPath send virt_path to guest kernel as swap device.

Fixes: #10988

Signed-off-by: Hui Zhu <teawater@antgroup.com>
This commit is contained in:
Hui Zhu
2025-03-06 11:36:08 +08:00
parent 7787340ab6
commit 93cd30862d
7 changed files with 93 additions and 43 deletions

View File

@@ -74,6 +74,7 @@ service AgentService {
rpc CopyFile(CopyFileRequest) returns (google.protobuf.Empty);
rpc GetOOMEvent(GetOOMEventRequest) returns (OOMEvent);
rpc AddSwap(AddSwapRequest) returns (google.protobuf.Empty);
rpc AddSwapPath(AddSwapPathRequest) returns (google.protobuf.Empty);
rpc GetVolumeStats(VolumeStatsRequest) returns (VolumeStatsResponse);
rpc ResizeVolume(ResizeVolumeRequest) returns (google.protobuf.Empty);
rpc SetPolicy(SetPolicyRequest) returns (google.protobuf.Empty);
@@ -595,6 +596,10 @@ message AddSwapRequest {
repeated uint32 PCIPath = 1;
}
message AddSwapPathRequest {
string path = 1;
}
message GetMetricsRequest {}
message Metrics {