@@ -20,16 +20,16 @@ use self::boot_source::BootSourceBody;
2020use self :: logger:: APILoggerDescription ;
2121use self :: net:: NetworkInterfaceBody ;
2222
23- pub type SyncOutcomeSender = oneshot:: Sender < Box < GenerateResponse + Send > > ;
24- pub type SyncOutcomeReceiver = oneshot:: Receiver < Box < GenerateResponse + Send > > ;
23+ pub type OutcomeSender = oneshot:: Sender < Box < GenerateResponse + Send > > ;
24+ pub type OutcomeReceiver = oneshot:: Receiver < Box < GenerateResponse + Send > > ;
2525
2626pub enum ParsedRequest {
2727 Dummy ,
2828 GetInstanceInfo ,
2929 GetMMDS ,
3030 PatchMMDS ( Value ) ,
3131 PutMMDS ( Value ) ,
32- Sync ( SyncRequest , SyncOutcomeReceiver ) ,
32+ Sync ( VmmAction , OutcomeReceiver ) ,
3333}
3434
3535pub trait IntoParsedRequest {
@@ -67,21 +67,21 @@ impl GenerateResponse for () {
6767
6868// This enum contains messages for the VMM which represent sync requests. They each contain various
6969// bits of information (ids, paths, etc.), together with an OutcomeSender, which is always present.
70- pub enum SyncRequest {
71- GetMachineConfiguration ( SyncOutcomeSender ) ,
72- PatchDrive ( String , String , SyncOutcomeSender ) , // drive_id, path_on_host, channel
73- PutBootSource ( BootSourceBody , SyncOutcomeSender ) ,
74- PutDrive ( BlockDeviceConfig , SyncOutcomeSender ) ,
75- PutLogger ( APILoggerDescription , SyncOutcomeSender ) ,
76- PutMachineConfiguration ( MachineConfiguration , SyncOutcomeSender ) ,
77- PutNetworkInterface ( NetworkInterfaceBody , SyncOutcomeSender ) ,
78- RescanBlockDevice ( String , SyncOutcomeSender ) ,
79- StartInstance ( SyncOutcomeSender ) ,
70+ pub enum VmmAction {
71+ ConfigureBootSource ( BootSourceBody , OutcomeSender ) ,
72+ ConfigureLogger ( APILoggerDescription , OutcomeSender ) ,
73+ GetMachineConfiguration ( OutcomeSender ) ,
74+ InsertBlockDevice ( BlockDeviceConfig , OutcomeSender ) ,
75+ InsertNetworkDevice ( NetworkInterfaceBody , OutcomeSender ) ,
76+ RescanBlockDevice ( String , OutcomeSender ) ,
77+ StartMicroVm ( OutcomeSender ) ,
78+ SetVmConfiguration ( MachineConfiguration , OutcomeSender ) ,
79+ UpdateDrivePath ( String , String , OutcomeSender ) , // drive_id, path_on_host, channel
8080}
8181
82- impl fmt:: Debug for SyncRequest {
82+ impl fmt:: Debug for VmmAction {
8383 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
84- write ! ( f, "SyncRequest " )
84+ write ! ( f, "VmmActions " )
8585 }
8686}
8787
@@ -196,38 +196,38 @@ mod tests {
196196
197197 // Implementation for the "==" operator.
198198 // Can't derive PartialEq directly because the sender members can't be compared.
199- impl PartialEq for SyncRequest {
200- fn eq ( & self , other : & SyncRequest ) -> bool {
199+ impl PartialEq for VmmAction {
200+ fn eq ( & self , other : & VmmAction ) -> bool {
201201 match ( self , other) {
202202 (
203- & SyncRequest :: PatchDrive ( ref drive_id, ref path_on_host, _) ,
204- & SyncRequest :: PatchDrive ( ref other_drive_id, ref other_path_on_host, _) ,
203+ & VmmAction :: UpdateDrivePath ( ref drive_id, ref path_on_host, _) ,
204+ & VmmAction :: UpdateDrivePath ( ref other_drive_id, ref other_path_on_host, _) ,
205205 ) => drive_id == other_drive_id && path_on_host == other_path_on_host,
206206 (
207- & SyncRequest :: PutBootSource ( ref bsb, _) ,
208- & SyncRequest :: PutBootSource ( ref other_bsb, _) ,
207+ & VmmAction :: ConfigureBootSource ( ref bsb, _) ,
208+ & VmmAction :: ConfigureBootSource ( ref other_bsb, _) ,
209209 ) => bsb == other_bsb,
210210 (
211- & SyncRequest :: PutDrive ( ref ddesc, _) ,
212- & SyncRequest :: PutDrive ( ref other_ddesc, _) ,
211+ & VmmAction :: InsertBlockDevice ( ref ddesc, _) ,
212+ & VmmAction :: InsertBlockDevice ( ref other_ddesc, _) ,
213213 ) => ddesc == other_ddesc,
214214 (
215- & SyncRequest :: PutLogger ( ref logdesc, _) ,
216- & SyncRequest :: PutLogger ( ref other_logdesc, _) ,
215+ & VmmAction :: ConfigureLogger ( ref logdesc, _) ,
216+ & VmmAction :: ConfigureLogger ( ref other_logdesc, _) ,
217217 ) => logdesc == other_logdesc,
218218 (
219- & SyncRequest :: PutMachineConfiguration ( ref mcb, _) ,
220- & SyncRequest :: PutMachineConfiguration ( ref other_mcb, _) ,
219+ & VmmAction :: SetVmConfiguration ( ref mcb, _) ,
220+ & VmmAction :: SetVmConfiguration ( ref other_mcb, _) ,
221221 ) => mcb == other_mcb,
222222 (
223- & SyncRequest :: PutNetworkInterface ( ref netif, _) ,
224- & SyncRequest :: PutNetworkInterface ( ref other_netif, _) ,
223+ & VmmAction :: InsertNetworkDevice ( ref netif, _) ,
224+ & VmmAction :: InsertNetworkDevice ( ref other_netif, _) ,
225225 ) => netif == other_netif,
226226 (
227- & SyncRequest :: RescanBlockDevice ( ref req, _) ,
228- & SyncRequest :: RescanBlockDevice ( ref other_req, _) ,
227+ & VmmAction :: RescanBlockDevice ( ref req, _) ,
228+ & VmmAction :: RescanBlockDevice ( ref other_req, _) ,
229229 ) => req == other_req,
230- ( & SyncRequest :: StartInstance ( _) , & SyncRequest :: StartInstance ( _) ) => true ,
230+ ( & VmmAction :: StartMicroVm ( _) , & VmmAction :: StartMicroVm ( _) ) => true ,
231231 _ => false ,
232232 }
233233 }
0 commit comments