Skip to content
57 changes: 53 additions & 4 deletions protect/control/v1/common.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
syntax = "proto3";

Check failure on line 1 in protect/control/v1/common.proto

View workflow job for this annotation

GitHub Actions / buf

Previously present message "DeviceInfo" was deleted from file.

package protect.control.v1;

Expand Down Expand Up @@ -151,7 +151,7 @@
}

message DeviceReferenceSpec {
string name = 1;
string id = 1;

Check failure on line 154 in protect/control/v1/common.proto

View workflow job for this annotation

GitHub Actions / buf

Field "1" on message "DeviceReferenceSpec" changed name from "name" to "id".

Check failure on line 154 in protect/control/v1/common.proto

View workflow job for this annotation

GitHub Actions / buf

Field "1" with name "id" on message "DeviceReferenceSpec" changed option "json_name" from "name" to "id".
}

message WorkloadBlockDeviceSpec {
Expand Down Expand Up @@ -489,10 +489,59 @@
bool is_bytes = 3;
}

message DeviceInfo {
message PciDeviceSpec {
string location = 1;
bool permissive = 2;
bool msi_translate = 3;
bool power_management = 4;
PciDeviceRdmReservePolicy rdm_reserve_policy = 5;
}

enum PciDeviceRdmReservePolicy {
PCI_DEVICE_RDM_RESERVE_POLICY_UNKNOWN = 0;
PCI_DEVICE_RDM_RESERVE_POLICY_STRICT = 1;
PCI_DEVICE_RDM_RESERVE_POLICY_RELAXED = 2;
}

message BlockDeviceSpec {
string device_path = 1;
}

message DeviceSpec {
string name = 1;
bool claimed = 2;
string owner_zone = 3;
oneof device_type {
PciDeviceSpec pci = 2;
BlockDeviceSpec block = 3;
}
repeated string modules = 4;
repeated KernelModuleParameter module_parameters = 5;
}

enum DeviceState {
DEVICE_STATE_UNKNOWN = 0;
DEVICE_STATE_AVAILABLE = 1;
DEVICE_STATE_TAINTED = 2;
DEVICE_STATE_USED = 3;
DEVICE_STATE_DESTROYING = 4;
DEVICE_STATE_DESTROYED = 5;
DEVICE_STATE_CREATING = 6;
DEVICE_STATE_FAILED = 7;
}

message DeviceStatus {
DeviceState state = 1;
string zone_id = 2;
DeviceErrorStatus error_status = 3;
}

message DeviceErrorStatus {
string message = 1;
}

message Device {
string id = 1;
DeviceSpec spec = 2;
DeviceStatus status = 3;
}

message ZoneScratchDiskSpec {
Expand Down
50 changes: 49 additions & 1 deletion protect/control/v1/control.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
rpc SnoopIdm(SnoopIdmRequest) returns (stream SnoopIdmReply);
rpc GetHostCpuTopology(GetHostCpuTopologyRequest) returns (GetHostCpuTopologyReply);

rpc CreateDevice(CreateDeviceRequest) returns (CreateDeviceReply);
rpc ListDevices(ListDevicesRequest) returns (ListDevicesReply);
rpc GetDevice(GetDeviceRequest) returns (GetDeviceReply);
rpc UpdateDeviceState(UpdateDeviceStateRequest) returns (UpdateDeviceStateReply);
rpc DestroyDevice(DestroyDeviceRequest) returns (DestroyDeviceReply);
rpc ResolveDeviceIds(ResolveDeviceIdsRequest) returns (ResolveDeviceIdsReply);

rpc CreateNetworkReservation(CreateNetworkReservationRequest) returns (CreateNetworkReservationReply);
rpc DestroyNetworkReservation(DestroyNetworkReservationRequest) returns (DestroyNetworkReservationReply);
Expand Down Expand Up @@ -69,6 +74,13 @@
optional uint64 hyp_free_mem = 7;
}

message UpdateDeviceStateRequest {
string device_id = 1;
DeviceState state = 2;
}

message UpdateDeviceStateReply {}

message CreateZoneRequest {
ZoneSpec spec = 1;
}
Expand Down Expand Up @@ -394,6 +406,7 @@
oneof event {
ZoneChangedEvent zone_changed = 1;
WorkloadChangedEvent workload_changed = 2;
DeviceChangedEvent device_changed = 3;
}
}

Expand All @@ -405,6 +418,10 @@
Workload workload = 1;
}

message DeviceChangedEvent {
Device device = 1;
}

message ReadZoneMetricsRequest {
string zone_id = 1;
}
Expand Down Expand Up @@ -475,9 +492,10 @@

message ListDevicesRequest {}

message ListDevicesReply {
repeated DeviceInfo devices = 1;
reserved 1;
repeated Device devices = 2;
}

Check failure on line 498 in protect/control/v1/control.proto

View workflow job for this annotation

GitHub Actions / buf

Previously present field "1" with name "devices" on message "ListDevicesReply" was deleted.

message GetHostCpuTopologyRequest {}

Expand Down Expand Up @@ -613,3 +631,33 @@
message DialNetworkSocketReply {
DialNetworkSocketData data = 1;
}

message CreateDeviceRequest {
DeviceSpec spec = 1;
}

message CreateDeviceReply {
string device_id = 1;
}

message DestroyDeviceRequest {
string device_id = 1;
}

message DestroyDeviceReply {}

message ResolveDeviceIdsRequest {
string name = 1;
}

message ResolveDeviceIdsReply {
repeated string device_ids = 1;
}

message GetDeviceRequest {
string device_id = 1;
}

message GetDeviceReply {
Device device = 1;
}
Loading