Lines Matching +full:add +full:- +full:user +full:- +full:device
3 // SPDX-License-Identifier: Apache-2.0
45 #[error("Error parsing device syntax")]
55 #[error("Error parsing user device syntax")]
57 #[error("Error parsing vDPA device syntax")]
78 fn vmm_ping(&self) -> zbus::Result<String>; in vmm_ping()
79 fn vmm_shutdown(&self) -> zbus::Result<()>; in vmm_shutdown()
80 fn vm_add_device(&self, device_config: &str) -> zbus::Result<Optional<String>>; in vm_add_device()
81 fn vm_add_disk(&self, disk_config: &str) -> zbus::Result<Optional<String>>; in vm_add_disk()
82 fn vm_add_fs(&self, fs_config: &str) -> zbus::Result<Optional<String>>; in vm_add_fs()
83 fn vm_add_net(&self, net_config: &str) -> zbus::Result<Optional<String>>; in vm_add_net()
84 fn vm_add_pmem(&self, pmem_config: &str) -> zbus::Result<Optional<String>>; in vm_add_pmem()
85 fn vm_add_user_device(&self, vm_add_user_device: &str) -> zbus::Result<Optional<String>>; in vm_add_user_device()
86 fn vm_add_vdpa(&self, vdpa_config: &str) -> zbus::Result<Optional<String>>; in vm_add_vdpa()
87 fn vm_add_vsock(&self, vsock_config: &str) -> zbus::Result<Optional<String>>; in vm_add_vsock()
88 fn vm_boot(&self) -> zbus::Result<()>; in vm_boot()
89 fn vm_coredump(&self, vm_coredump_data: &str) -> zbus::Result<()>; in vm_coredump()
90 fn vm_counters(&self) -> zbus::Result<Optional<String>>; in vm_counters()
91 fn vm_create(&self, vm_config: &str) -> zbus::Result<()>; in vm_create()
92 fn vm_delete(&self) -> zbus::Result<()>; in vm_delete()
93 fn vm_info(&self) -> zbus::Result<String>; in vm_info()
94 fn vm_pause(&self) -> zbus::Result<()>; in vm_pause()
95 fn vm_power_button(&self) -> zbus::Result<()>; in vm_power_button()
96 fn vm_reboot(&self) -> zbus::Result<()>; in vm_reboot()
97 fn vm_remove_device(&self, vm_remove_device: &str) -> zbus::Result<()>; in vm_remove_device()
98 fn vm_resize(&self, vm_resize: &str) -> zbus::Result<()>; in vm_resize()
99 fn vm_resize_zone(&self, vm_resize_zone: &str) -> zbus::Result<()>; in vm_resize_zone()
100 fn vm_restore(&self, restore_config: &str) -> zbus::Result<()>; in vm_restore()
101 fn vm_receive_migration(&self, receive_migration_data: &str) -> zbus::Result<()>; in vm_receive_migration()
102 fn vm_send_migration(&self, receive_migration_data: &str) -> zbus::Result<()>; in vm_send_migration()
103 fn vm_resume(&self) -> zbus::Result<()>; in vm_resume()
104 fn vm_shutdown(&self) -> zbus::Result<()>; in vm_shutdown()
105 fn vm_snapshot(&self, vm_snapshot_config: &str) -> zbus::Result<()>; in vm_snapshot()
110 fn new_connection(name: &'a str, path: &'a str, system_bus: bool) -> Result<Self, zbus::Error> { in new_connection()
123 fn print_response(&self, result: zbus::Result<Optional<String>>) -> ApiResult { in print_response()
133 fn api_vmm_ping(&self) -> ApiResult { in api_vmm_ping()
139 fn api_vmm_shutdown(&self) -> ApiResult { in api_vmm_shutdown()
143 fn api_vm_add_device(&self, device_config: &str) -> ApiResult { in api_vm_add_device()
147 fn api_vm_add_disk(&self, disk_config: &str) -> ApiResult { in api_vm_add_disk()
151 fn api_vm_add_fs(&self, fs_config: &str) -> ApiResult { in api_vm_add_fs()
155 fn api_vm_add_net(&self, net_config: &str) -> ApiResult { in api_vm_add_net()
159 fn api_vm_add_pmem(&self, pmem_config: &str) -> ApiResult { in api_vm_add_pmem()
163 fn api_vm_add_user_device(&self, vm_add_user_device: &str) -> ApiResult { in api_vm_add_user_device()
167 fn api_vm_add_vdpa(&self, vdpa_config: &str) -> ApiResult { in api_vm_add_vdpa()
171 fn api_vm_add_vsock(&self, vsock_config: &str) -> ApiResult { in api_vm_add_vsock()
175 fn api_vm_boot(&self) -> ApiResult { in api_vm_boot()
179 fn api_vm_coredump(&self, vm_coredump_data: &str) -> ApiResult { in api_vm_coredump()
184 fn api_vm_counters(&self) -> ApiResult { in api_vm_counters()
188 fn api_vm_create(&self, vm_config: &str) -> ApiResult { in api_vm_create()
192 fn api_vm_delete(&self) -> ApiResult { in api_vm_delete()
196 fn api_vm_info(&self) -> ApiResult { in api_vm_info()
202 fn api_vm_pause(&self) -> ApiResult { in api_vm_pause()
206 fn api_vm_power_button(&self) -> ApiResult { in api_vm_power_button()
210 fn api_vm_reboot(&self) -> ApiResult { in api_vm_reboot()
214 fn api_vm_remove_device(&self, vm_remove_device: &str) -> ApiResult { in api_vm_remove_device()
219 fn api_vm_resize(&self, vm_resize: &str) -> ApiResult { in api_vm_resize()
223 fn api_vm_resize_zone(&self, vm_resize_zone: &str) -> ApiResult { in api_vm_resize_zone()
228 fn api_vm_restore(&self, restore_config: &str) -> ApiResult { in api_vm_restore()
233 fn api_vm_receive_migration(&self, receive_migration_data: &str) -> ApiResult { in api_vm_receive_migration()
238 fn api_vm_send_migration(&self, send_migration_data: &str) -> ApiResult { in api_vm_send_migration()
243 fn api_vm_resume(&self) -> ApiResult { in api_vm_resume()
247 fn api_vm_shutdown(&self) -> ApiResult { in api_vm_shutdown()
251 fn api_vm_snapshot(&self, vm_snapshot_config: &str) -> ApiResult { in api_vm_snapshot()
258 fn do_command(&mut self, matches: &ArgMatches) -> ApiResult { in do_command()
267 fn rest_api_do_command(matches: &ArgMatches, socket: &mut UnixStream) -> ApiResult { in rest_api_do_command()
275 Some("shutdown-vmm") => simple_api_full_command(socket, "PUT", "vmm.shutdown", None) in rest_api_do_command()
280 Some("power-button") => { in rest_api_do_command()
281 simple_api_command(socket, "PUT", "power-button", None).map_err(Error::HttpApiClient) in rest_api_do_command()
322 Some("resize-zone") => { in rest_api_do_command()
325 .subcommand_matches("resize-zone") in rest_api_do_command()
330 .subcommand_matches("resize-zone") in rest_api_do_command()
335 simple_api_command(socket, "PUT", "resize-zone", Some(&resize_zone)) in rest_api_do_command()
338 Some("add-device") => { in rest_api_do_command()
341 .subcommand_matches("add-device") in rest_api_do_command()
346 simple_api_command(socket, "PUT", "add-device", Some(&device_config)) in rest_api_do_command()
349 Some("remove-device") => { in rest_api_do_command()
352 .subcommand_matches("remove-device") in rest_api_do_command()
357 simple_api_command(socket, "PUT", "remove-device", Some(&remove_device_data)) in rest_api_do_command()
360 Some("add-disk") => { in rest_api_do_command()
363 .subcommand_matches("add-disk") in rest_api_do_command()
368 simple_api_command(socket, "PUT", "add-disk", Some(&disk_config)) in rest_api_do_command()
371 Some("add-fs") => { in rest_api_do_command()
374 .subcommand_matches("add-fs") in rest_api_do_command()
379 simple_api_command(socket, "PUT", "add-fs", Some(&fs_config)) in rest_api_do_command()
382 Some("add-pmem") => { in rest_api_do_command()
385 .subcommand_matches("add-pmem") in rest_api_do_command()
390 simple_api_command(socket, "PUT", "add-pmem", Some(&pmem_config)) in rest_api_do_command()
393 Some("add-net") => { in rest_api_do_command()
396 .subcommand_matches("add-net") in rest_api_do_command()
401 simple_api_command_with_fds(socket, "PUT", "add-net", Some(&net_config), fds) in rest_api_do_command()
404 Some("add-user-device") => { in rest_api_do_command()
407 .subcommand_matches("add-user-device") in rest_api_do_command()
412 simple_api_command(socket, "PUT", "add-user-device", Some(&device_config)) in rest_api_do_command()
415 Some("add-vdpa") => { in rest_api_do_command()
418 .subcommand_matches("add-vdpa") in rest_api_do_command()
423 simple_api_command(socket, "PUT", "add-vdpa", Some(&vdpa_config)) in rest_api_do_command()
426 Some("add-vsock") => { in rest_api_do_command()
429 .subcommand_matches("add-vsock") in rest_api_do_command()
434 simple_api_command(socket, "PUT", "add-vsock", Some(&vsock_config)) in rest_api_do_command()
470 Some("send-migration") => { in rest_api_do_command()
473 .subcommand_matches("send-migration") in rest_api_do_command()
478 .subcommand_matches("send-migration") in rest_api_do_command()
482 simple_api_command(socket, "PUT", "send-migration", Some(&send_migration_data)) in rest_api_do_command()
485 Some("receive-migration") => { in rest_api_do_command()
488 .subcommand_matches("receive-migration") in rest_api_do_command()
496 "receive-migration", in rest_api_do_command()
516 fn dbus_api_do_command(matches: &ArgMatches, proxy: &DBusApi1ProxyBlocking<'_>) -> ApiResult { in dbus_api_do_command()
520 Some("shutdown-vmm") => proxy.api_vmm_shutdown(), in dbus_api_do_command()
522 Some("power-button") => proxy.api_vm_power_button(), in dbus_api_do_command()
549 Some("resize-zone") => { in dbus_api_do_command()
552 .subcommand_matches("resize-zone") in dbus_api_do_command()
557 .subcommand_matches("resize-zone") in dbus_api_do_command()
564 Some("add-device") => { in dbus_api_do_command()
567 .subcommand_matches("add-device") in dbus_api_do_command()
574 Some("remove-device") => { in dbus_api_do_command()
577 .subcommand_matches("remove-device") in dbus_api_do_command()
584 Some("add-disk") => { in dbus_api_do_command()
587 .subcommand_matches("add-disk") in dbus_api_do_command()
594 Some("add-fs") => { in dbus_api_do_command()
597 .subcommand_matches("add-fs") in dbus_api_do_command()
604 Some("add-pmem") => { in dbus_api_do_command()
607 .subcommand_matches("add-pmem") in dbus_api_do_command()
614 Some("add-net") => { in dbus_api_do_command()
617 .subcommand_matches("add-net") in dbus_api_do_command()
624 Some("add-user-device") => { in dbus_api_do_command()
627 .subcommand_matches("add-user-device") in dbus_api_do_command()
634 Some("add-vdpa") => { in dbus_api_do_command()
637 .subcommand_matches("add-vdpa") in dbus_api_do_command()
644 Some("add-vsock") => { in dbus_api_do_command()
647 .subcommand_matches("add-vsock") in dbus_api_do_command()
684 Some("send-migration") => { in dbus_api_do_command()
687 .subcommand_matches("send-migration") in dbus_api_do_command()
692 .subcommand_matches("send-migration") in dbus_api_do_command()
698 Some("receive-migration") => { in dbus_api_do_command()
701 .subcommand_matches("receive-migration") in dbus_api_do_command()
726 ) -> Result<String, Error> { in resize_config()
764 fn resize_zone_config(id: &str, size: &str) -> Result<String, Error> { in resize_zone_config()
776 fn add_device_config(config: &str) -> Result<String, Error> { in add_device_config()
783 fn add_user_device_config(config: &str) -> Result<String, Error> { in add_user_device_config()
790 fn remove_device_config(id: &str) -> String { in remove_device_config()
796 fn add_disk_config(config: &str) -> Result<String, Error> { in add_disk_config()
803 fn add_fs_config(config: &str) -> Result<String, Error> { in add_fs_config()
810 fn add_pmem_config(config: &str) -> Result<String, Error> { in add_pmem_config()
817 fn add_net_config(config: &str) -> Result<(String, Vec<i32>), Error> { in add_net_config()
830 fn add_vdpa_config(config: &str) -> Result<String, Error> { in add_vdpa_config()
837 fn add_vsock_config(config: &str) -> Result<String, Error> { in add_vsock_config()
844 fn snapshot_config(url: &str) -> String { in snapshot_config()
852 fn restore_config(config: &str) -> Result<(String, Vec<i32>), Error> { in restore_config()
868 fn coredump_config(destination_url: &str) -> String { in coredump_config()
876 fn receive_migration_data(url: &str) -> String { in receive_migration_data()
884 fn send_migration_data(url: &str, local: bool) -> String { in send_migration_data()
893 fn create_data(path: &str) -> Result<String, Error> { in create_data()
895 if path == "-" { in create_data()
908 /// This is the order used in the `--help` output.
909 fn get_cli_args() -> Box<[Arg]> { in get_cli_args()
911 Arg::new("api-socket") in get_cli_args()
912 .long("api-socket") in get_cli_args()
916 Arg::new("dbus-object-path") in get_cli_args()
917 .long("dbus-object-path") in get_cli_args()
921 Arg::new("dbus-service-name") in get_cli_args()
922 .long("dbus-service-name") in get_cli_args()
926 Arg::new("dbus-system-bus") in get_cli_args()
927 .long("dbus-system-bus") in get_cli_args()
938 /// This is the order used in the `--help` output.
939 fn get_cli_commands_sorted() -> Box<[Command]> { in get_cli_commands_sorted()
941 Command::new("add-device").about("Add VFIO device").arg( in get_cli_commands_sorted()
946 Command::new("add-disk") in get_cli_commands_sorted()
947 .about("Add block device") in get_cli_commands_sorted()
949 Command::new("add-fs") in get_cli_commands_sorted()
950 .about("Add virtio-fs backed fs device") in get_cli_commands_sorted()
956 Command::new("add-net") in get_cli_commands_sorted()
957 .about("Add network device") in get_cli_commands_sorted()
959 Command::new("add-pmem") in get_cli_commands_sorted()
960 .about("Add persistent memory device") in get_cli_commands_sorted()
966 Command::new("add-user-device") in get_cli_commands_sorted()
967 .about("Add userspace device") in get_cli_commands_sorted()
973 Command::new("add-vdpa") in get_cli_commands_sorted()
974 .about("Add vDPA device") in get_cli_commands_sorted()
976 Command::new("add-vsock") in get_cli_commands_sorted()
977 .about("Add vsock device") in get_cli_commands_sorted()
986 .arg(Arg::new("path").index(1).default_value("-")), in get_cli_commands_sorted()
992 Command::new("power-button").about("Trigger a power button in the VM"), in get_cli_commands_sorted()
994 Command::new("receive-migration") in get_cli_commands_sorted()
1001 Command::new("remove-device") in get_cli_commands_sorted()
1002 .about("Remove VFIO and PCI device") in get_cli_commands_sorted()
1024 Command::new("resize-zone") in get_cli_commands_sorted()
1046 Command::new("send-migration") in get_cli_commands_sorted()
1060 Command::new("shutdown-vmm").about("Shutdown the VMM"), in get_cli_commands_sorted()
1074 let app = Command::new("ch-remote") in main()
1077 .about("Remotely control a cloud-hypervisor VMM.") in main()
1086 matches.get_one::<String>("api-socket"), in main()
1088 matches.get_one::<String>("dbus-service-name"), in main()
1090 matches.get_one::<String>("dbus-object-path"), in main()
1113 matches.get_flag("dbus-system-bus"), in main()
1117 eprintln!("Error creating D-Bus proxy: {e}"); in main()
1124 "`api-socket` and (dbus-service-name or dbus-object-path) are mutually exclusive" in main()
1129 …println!("Please either provide the api-socket option or dbus-service-name and dbus-object-path op… in main()
1136 fn join_strs(mut acc: String, next: String) -> String { in main()
1156 ) -> Option<String> { in main()
1196 "ch-remote", in main()