Skip to content

Commit 2c0b48e

Browse files
committed
This patch includes:
1. Device State: CLEAN, DIRTY, SCRUB, BUSY 2. DeviceStateUpdate RPC 3. DeviceChanged Event Signed-off-by: Surbhi Kakarya <surbhi@edera.dev>
1 parent 304a988 commit 2c0b48e

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

protect/control/v1/common.proto

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,14 @@ message OciRegistryAuthentication {
564564
string registry_token = 4;
565565
}
566566
}
567+
568+
message PciDevice {
569+
PciDeviceState state = 1;
570+
}
571+
572+
enum PciDeviceState {
573+
CLEAN = 0;
574+
DIRTY = 1;
575+
SCRUB = 2;
576+
BUSY = 3;
577+
}

protect/control/v1/control.proto

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ service ControlService {
5555
rpc SetHostPowerManagementPolicy(SetHostPowerManagementPolicyRequest) returns (SetHostPowerManagementPolicyReply);
5656

5757
rpc DialNetworkSocket(stream DialNetworkSocketRequest) returns (stream DialNetworkSocketReply);
58+
rpc DeviceStateUpdate(DeviceStateRequest) returns (DeviceStateReply);
5859
}
5960

6061
message GetHostStatusRequest {}
@@ -69,6 +70,13 @@ message GetHostStatusReply {
6970
optional uint64 hyp_free_mem = 7;
7071
}
7172

73+
message DeviceStateRequest {
74+
string name = 1;
75+
protect.common.v1.PciDevice state = 2;
76+
}
77+
78+
message DeviceStateReply {}
79+
7280
message CreateZoneRequest {
7381
ZoneSpec spec = 1;
7482
}
@@ -394,6 +402,7 @@ message WatchEventsReply {
394402
oneof event {
395403
ZoneChangedEvent zone_changed = 1;
396404
WorkloadChangedEvent workload_changed = 2;
405+
DeviceChangedEvent device_changed = 3;
397406
}
398407
}
399408

@@ -405,6 +414,10 @@ message WorkloadChangedEvent {
405414
Workload workload = 1;
406415
}
407416

417+
message DeviceChangedEvent {
418+
protect.common.v1.DeviceReferenceSpec device = 1;
419+
}
420+
408421
message ReadZoneMetricsRequest {
409422
string zone_id = 1;
410423
}

0 commit comments

Comments
 (0)