@@ -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 , DetachNicRequest , ResumeVmRequest ,
12+ NetConfig , PauseVmRequest , PingVmRequest , DetachDiskRequest , DetachNicRequest , ResumeVmRequest ,
1313 ShutdownVmRequest , StartVmRequest , StreamVmConsoleRequest , StreamVmEventsRequest , TapConfig ,
1414 VfioPciConfig , VmConfig , VmState , VmStateChangedEvent ,
1515} ;
@@ -153,14 +153,14 @@ pub enum VmCommand {
153153 #[ arg( long, required = true , help = "Path to the disk image file" ) ]
154154 path : String ,
155155 } ,
156- /// Remove a disk from a virtual machine
157- RemoveDisk {
156+ /// Detach a disk from a virtual machine
157+ DetachDisk {
158158 #[ arg( long, required = true , help = "VM identifier" ) ]
159159 vm_id : String ,
160160 #[ arg(
161161 long,
162162 required = true ,
163- help = "Device identifier of the disk to remove "
163+ help = "Device identifier of the disk to detach "
164164 ) ]
165165 device_id : String ,
166166 } ,
@@ -262,8 +262,8 @@ pub async fn handle_vm_command(args: VmArgs) -> Result<()> {
262262 VmCommand :: Events { vm_id } => watch_events ( & mut client, vm_id) . await ?,
263263 VmCommand :: Console { vm_id } => console_vm ( & mut client, vm_id) . await ?,
264264 VmCommand :: AttachDisk { vm_id, path } => attach_disk ( & mut client, vm_id, path) . await ?,
265- VmCommand :: RemoveDisk { vm_id, device_id } => {
266- remove_disk ( & mut client, vm_id, device_id) . await ?
265+ VmCommand :: DetachDisk { vm_id, device_id } => {
266+ detach_disk ( & mut client, vm_id, device_id) . await ?
267267 }
268268 VmCommand :: AttachNic {
269269 vm_id,
@@ -783,17 +783,17 @@ async fn attach_disk(
783783 Ok ( ( ) )
784784}
785785
786- async fn remove_disk (
786+ async fn detach_disk (
787787 client : & mut VmServiceClient < Channel > ,
788788 vm_id : String ,
789789 device_id : String ,
790790) -> Result < ( ) > {
791- let request = RemoveDiskRequest {
791+ let request = DetachDiskRequest {
792792 vm_id : vm_id. clone ( ) ,
793793 device_id : device_id. clone ( ) ,
794794 } ;
795- client. remove_disk ( request) . await ?;
796- println ! ( "Disk remove request sent for device {device_id} on VM {vm_id}" ) ;
795+ client. detach_disk ( request) . await ?;
796+ println ! ( "Disk detach request sent for device {device_id} on VM {vm_id}" ) ;
797797 Ok ( ( ) )
798798}
799799
0 commit comments