@@ -9,7 +9,7 @@ use feos_proto::vm_service::{
99 net_config, stream_vm_console_request as console_input, vm_service_client:: VmServiceClient ,
1010 AttachConsoleMessage , AttachDiskRequest , AttachNicRequest , ConsoleData , CpuConfig ,
1111 CreateVmRequest , DeleteVmRequest , DiskConfig , GetVmRequest , ListVmsRequest , MemoryConfig ,
12- NetConfig , PauseVmRequest , PingVmRequest , RemoveDiskRequest , RemoveNicRequest , ResumeVmRequest ,
12+ NetConfig , PauseVmRequest , PingVmRequest , RemoveDiskRequest , DetachNicRequest , ResumeVmRequest ,
1313 ShutdownVmRequest , StartVmRequest , StreamVmConsoleRequest , StreamVmEventsRequest , TapConfig ,
1414 VfioPciConfig , VmConfig , VmState , VmStateChangedEvent ,
1515} ;
@@ -185,11 +185,11 @@ pub enum VmCommand {
185185 #[ arg( long, help = "Custom device identifier for the new interface" ) ]
186186 device_id : Option < String > ,
187187 } ,
188- /// Remove a network interface from a VM
189- RemoveNic {
188+ /// Detach a network interface from a VM
189+ DetachNic {
190190 #[ arg( long, required = true , help = "VM identifier" ) ]
191191 vm_id : String ,
192- #[ arg( long, required = true , help = "Device identifier of the NIC to remove " ) ]
192+ #[ arg( long, required = true , help = "Device identifier of the NIC to detach " ) ]
193193 device_id : String ,
194194 } ,
195195}
@@ -282,8 +282,8 @@ pub async fn handle_vm_command(args: VmArgs) -> Result<()> {
282282 )
283283 . await ?
284284 }
285- VmCommand :: RemoveNic { vm_id, device_id } => {
286- remove_nic ( & mut client, vm_id, device_id) . await ?
285+ VmCommand :: DetachNic { vm_id, device_id } => {
286+ detach_nic ( & mut client, vm_id, device_id) . await ?
287287 }
288288 }
289289
@@ -833,16 +833,16 @@ async fn attach_nic(
833833 Ok ( ( ) )
834834}
835835
836- async fn remove_nic (
836+ async fn detach_nic (
837837 client : & mut VmServiceClient < Channel > ,
838838 vm_id : String ,
839839 device_id : String ,
840840) -> Result < ( ) > {
841- let request = RemoveNicRequest {
841+ let request = DetachNicRequest {
842842 vm_id : vm_id. clone ( ) ,
843843 device_id : device_id. clone ( ) ,
844844 } ;
845- client. remove_nic ( request) . await ?;
846- println ! ( "NIC remove request sent for device {device_id} on VM {vm_id}" ) ;
845+ client. detach_nic ( request) . await ?;
846+ println ! ( "NIC detach request sent for device {device_id} on VM {vm_id}" ) ;
847847 Ok ( ( ) )
848848}
0 commit comments