Lines Matching +full:power +full:- +full:button
3 // SPDX-License-Identifier: Apache-2.0
79 fn vmm_ping(&self) -> zbus::Result<String>; in vmm_ping()
80 fn vmm_shutdown(&self) -> zbus::Result<()>; in vmm_shutdown()
81 fn vm_add_device(&self, device_config: &str) -> zbus::Result<Optional<String>>; in vm_add_device()
82 fn vm_add_disk(&self, disk_config: &str) -> zbus::Result<Optional<String>>; in vm_add_disk()
83 fn vm_add_fs(&self, fs_config: &str) -> zbus::Result<Optional<String>>; in vm_add_fs()
84 fn vm_add_net(&self, net_config: &str) -> zbus::Result<Optional<String>>; in vm_add_net()
85 fn vm_add_pmem(&self, pmem_config: &str) -> zbus::Result<Optional<String>>; in vm_add_pmem()
86 fn vm_add_user_device(&self, vm_add_user_device: &str) -> zbus::Result<Optional<String>>; in vm_add_user_device()
87 fn vm_add_vdpa(&self, vdpa_config: &str) -> zbus::Result<Optional<String>>; in vm_add_vdpa()
88 fn vm_add_vsock(&self, vsock_config: &str) -> zbus::Result<Optional<String>>; in vm_add_vsock()
89 fn vm_boot(&self) -> zbus::Result<()>; in vm_boot()
90 fn vm_coredump(&self, vm_coredump_data: &str) -> zbus::Result<()>; in vm_coredump()
91 fn vm_counters(&self) -> zbus::Result<Optional<String>>; in vm_counters()
92 fn vm_create(&self, vm_config: &str) -> zbus::Result<()>; in vm_create()
93 fn vm_delete(&self) -> zbus::Result<()>; in vm_delete()
94 fn vm_info(&self) -> zbus::Result<String>; in vm_info()
95 fn vm_pause(&self) -> zbus::Result<()>; in vm_pause()
96 fn vm_power_button(&self) -> zbus::Result<()>; in vm_power_button()
97 fn vm_reboot(&self) -> zbus::Result<()>; in vm_reboot()
98 fn vm_remove_device(&self, vm_remove_device: &str) -> zbus::Result<()>; in vm_remove_device()
99 fn vm_resize(&self, vm_resize: &str) -> zbus::Result<()>; in vm_resize()
100 fn vm_resize_zone(&self, vm_resize_zone: &str) -> zbus::Result<()>; in vm_resize_zone()
101 fn vm_restore(&self, restore_config: &str) -> zbus::Result<()>; in vm_restore()
102 fn vm_receive_migration(&self, receive_migration_data: &str) -> zbus::Result<()>; in vm_receive_migration()
103 fn vm_send_migration(&self, receive_migration_data: &str) -> zbus::Result<()>; in vm_send_migration()
104 fn vm_resume(&self) -> zbus::Result<()>; in vm_resume()
105 fn vm_shutdown(&self) -> zbus::Result<()>; in vm_shutdown()
106 fn vm_snapshot(&self, vm_snapshot_config: &str) -> zbus::Result<()>; in vm_snapshot()
111 fn new_connection(name: &'a str, path: &'a str, system_bus: bool) -> Result<Self, zbus::Error> { in new_connection()
124 fn print_response(&self, result: zbus::Result<Optional<String>>) -> ApiResult { in print_response()
134 fn api_vmm_ping(&self) -> ApiResult { in api_vmm_ping()
140 fn api_vmm_shutdown(&self) -> ApiResult { in api_vmm_shutdown()
144 fn api_vm_add_device(&self, device_config: &str) -> ApiResult { in api_vm_add_device()
148 fn api_vm_add_disk(&self, disk_config: &str) -> ApiResult { in api_vm_add_disk()
152 fn api_vm_add_fs(&self, fs_config: &str) -> ApiResult { in api_vm_add_fs()
156 fn api_vm_add_net(&self, net_config: &str) -> ApiResult { in api_vm_add_net()
160 fn api_vm_add_pmem(&self, pmem_config: &str) -> ApiResult { in api_vm_add_pmem()
164 fn api_vm_add_user_device(&self, vm_add_user_device: &str) -> ApiResult { in api_vm_add_user_device()
168 fn api_vm_add_vdpa(&self, vdpa_config: &str) -> ApiResult { in api_vm_add_vdpa()
172 fn api_vm_add_vsock(&self, vsock_config: &str) -> ApiResult { in api_vm_add_vsock()
176 fn api_vm_boot(&self) -> ApiResult { in api_vm_boot()
180 fn api_vm_coredump(&self, vm_coredump_data: &str) -> ApiResult { in api_vm_coredump()
185 fn api_vm_counters(&self) -> ApiResult { in api_vm_counters()
189 fn api_vm_create(&self, vm_config: &str) -> ApiResult { in api_vm_create()
193 fn api_vm_delete(&self) -> ApiResult { in api_vm_delete()
197 fn api_vm_info(&self) -> ApiResult { in api_vm_info()
203 fn api_vm_pause(&self) -> ApiResult { in api_vm_pause()
207 fn api_vm_power_button(&self) -> ApiResult { in api_vm_power_button()
211 fn api_vm_reboot(&self) -> ApiResult { in api_vm_reboot()
215 fn api_vm_remove_device(&self, vm_remove_device: &str) -> ApiResult { in api_vm_remove_device()
220 fn api_vm_resize(&self, vm_resize: &str) -> ApiResult { in api_vm_resize()
224 fn api_vm_resize_zone(&self, vm_resize_zone: &str) -> ApiResult { in api_vm_resize_zone()
229 fn api_vm_restore(&self, restore_config: &str) -> ApiResult { in api_vm_restore()
234 fn api_vm_receive_migration(&self, receive_migration_data: &str) -> ApiResult { in api_vm_receive_migration()
239 fn api_vm_send_migration(&self, send_migration_data: &str) -> ApiResult { in api_vm_send_migration()
244 fn api_vm_resume(&self) -> ApiResult { in api_vm_resume()
248 fn api_vm_shutdown(&self) -> ApiResult { in api_vm_shutdown()
252 fn api_vm_snapshot(&self, vm_snapshot_config: &str) -> ApiResult { in api_vm_snapshot()
259 fn do_command(&mut self, matches: &ArgMatches) -> ApiResult { in do_command()
268 fn rest_api_do_command(matches: &ArgMatches, socket: &mut UnixStream) -> ApiResult { in rest_api_do_command()
276 Some("shutdown-vmm") => simple_api_full_command(socket, "PUT", "vmm.shutdown", None) in rest_api_do_command()
281 Some("power-button") => { in rest_api_do_command()
282 simple_api_command(socket, "PUT", "power-button", None).map_err(Error::HttpApiClient) in rest_api_do_command()
323 Some("resize-zone") => { in rest_api_do_command()
326 .subcommand_matches("resize-zone") in rest_api_do_command()
331 .subcommand_matches("resize-zone") in rest_api_do_command()
336 simple_api_command(socket, "PUT", "resize-zone", Some(&resize_zone)) in rest_api_do_command()
339 Some("add-device") => { in rest_api_do_command()
342 .subcommand_matches("add-device") in rest_api_do_command()
347 simple_api_command(socket, "PUT", "add-device", Some(&device_config)) in rest_api_do_command()
350 Some("remove-device") => { in rest_api_do_command()
353 .subcommand_matches("remove-device") in rest_api_do_command()
358 simple_api_command(socket, "PUT", "remove-device", Some(&remove_device_data)) in rest_api_do_command()
361 Some("add-disk") => { in rest_api_do_command()
364 .subcommand_matches("add-disk") in rest_api_do_command()
369 simple_api_command(socket, "PUT", "add-disk", Some(&disk_config)) in rest_api_do_command()
372 Some("add-fs") => { in rest_api_do_command()
375 .subcommand_matches("add-fs") in rest_api_do_command()
380 simple_api_command(socket, "PUT", "add-fs", Some(&fs_config)) in rest_api_do_command()
383 Some("add-pmem") => { in rest_api_do_command()
386 .subcommand_matches("add-pmem") in rest_api_do_command()
391 simple_api_command(socket, "PUT", "add-pmem", Some(&pmem_config)) in rest_api_do_command()
394 Some("add-net") => { in rest_api_do_command()
397 .subcommand_matches("add-net") in rest_api_do_command()
402 simple_api_command_with_fds(socket, "PUT", "add-net", Some(&net_config), fds) in rest_api_do_command()
405 Some("add-user-device") => { in rest_api_do_command()
408 .subcommand_matches("add-user-device") in rest_api_do_command()
413 simple_api_command(socket, "PUT", "add-user-device", Some(&device_config)) in rest_api_do_command()
416 Some("add-vdpa") => { in rest_api_do_command()
419 .subcommand_matches("add-vdpa") in rest_api_do_command()
424 simple_api_command(socket, "PUT", "add-vdpa", Some(&vdpa_config)) in rest_api_do_command()
427 Some("add-vsock") => { in rest_api_do_command()
430 .subcommand_matches("add-vsock") in rest_api_do_command()
435 simple_api_command(socket, "PUT", "add-vsock", Some(&vsock_config)) in rest_api_do_command()
471 Some("send-migration") => { in rest_api_do_command()
474 .subcommand_matches("send-migration") in rest_api_do_command()
479 .subcommand_matches("send-migration") in rest_api_do_command()
483 simple_api_command(socket, "PUT", "send-migration", Some(&send_migration_data)) in rest_api_do_command()
486 Some("receive-migration") => { in rest_api_do_command()
489 .subcommand_matches("receive-migration") in rest_api_do_command()
497 "receive-migration", in rest_api_do_command()
517 fn dbus_api_do_command(matches: &ArgMatches, proxy: &DBusApi1ProxyBlocking<'_>) -> ApiResult { in dbus_api_do_command()
521 Some("shutdown-vmm") => proxy.api_vmm_shutdown(), in dbus_api_do_command()
523 Some("power-button") => proxy.api_vm_power_button(), in dbus_api_do_command()
550 Some("resize-zone") => { in dbus_api_do_command()
553 .subcommand_matches("resize-zone") in dbus_api_do_command()
558 .subcommand_matches("resize-zone") in dbus_api_do_command()
565 Some("add-device") => { in dbus_api_do_command()
568 .subcommand_matches("add-device") in dbus_api_do_command()
575 Some("remove-device") => { in dbus_api_do_command()
578 .subcommand_matches("remove-device") in dbus_api_do_command()
585 Some("add-disk") => { in dbus_api_do_command()
588 .subcommand_matches("add-disk") in dbus_api_do_command()
595 Some("add-fs") => { in dbus_api_do_command()
598 .subcommand_matches("add-fs") in dbus_api_do_command()
605 Some("add-pmem") => { in dbus_api_do_command()
608 .subcommand_matches("add-pmem") in dbus_api_do_command()
615 Some("add-net") => { in dbus_api_do_command()
618 .subcommand_matches("add-net") in dbus_api_do_command()
625 Some("add-user-device") => { in dbus_api_do_command()
628 .subcommand_matches("add-user-device") in dbus_api_do_command()
635 Some("add-vdpa") => { in dbus_api_do_command()
638 .subcommand_matches("add-vdpa") in dbus_api_do_command()
645 Some("add-vsock") => { in dbus_api_do_command()
648 .subcommand_matches("add-vsock") in dbus_api_do_command()
685 Some("send-migration") => { in dbus_api_do_command()
688 .subcommand_matches("send-migration") in dbus_api_do_command()
693 .subcommand_matches("send-migration") in dbus_api_do_command()
699 Some("receive-migration") => { in dbus_api_do_command()
702 .subcommand_matches("receive-migration") in dbus_api_do_command()
727 ) -> Result<String, Error> { in resize_config()
765 fn resize_zone_config(id: &str, size: &str) -> Result<String, Error> { in resize_zone_config()
777 fn add_device_config(config: &str) -> Result<String, Error> { in add_device_config()
784 fn add_user_device_config(config: &str) -> Result<String, Error> { in add_user_device_config()
791 fn remove_device_config(id: &str) -> String { in remove_device_config()
797 fn add_disk_config(config: &str) -> Result<String, Error> { in add_disk_config()
804 fn add_fs_config(config: &str) -> Result<String, Error> { in add_fs_config()
811 fn add_pmem_config(config: &str) -> Result<String, Error> { in add_pmem_config()
818 fn add_net_config(config: &str) -> Result<(String, Vec<i32>), Error> { in add_net_config()
831 fn add_vdpa_config(config: &str) -> Result<String, Error> { in add_vdpa_config()
838 fn add_vsock_config(config: &str) -> Result<String, Error> { in add_vsock_config()
845 fn snapshot_config(url: &str) -> String { in snapshot_config()
853 fn restore_config(config: &str) -> Result<(String, Vec<i32>), Error> { in restore_config()
869 fn coredump_config(destination_url: &str) -> String { in coredump_config()
877 fn receive_migration_data(url: &str) -> String { in receive_migration_data()
885 fn send_migration_data(url: &str, local: bool) -> String { in send_migration_data()
894 fn create_data(path: &str) -> Result<String, Error> { in create_data()
896 if path == "-" { in create_data()
909 /// This is the order used in the `--help` output.
910 fn get_cli_args() -> Box<[Arg]> { in get_cli_args()
912 Arg::new("api-socket") in get_cli_args()
913 .long("api-socket") in get_cli_args()
917 Arg::new("dbus-object-path") in get_cli_args()
918 .long("dbus-object-path") in get_cli_args()
922 Arg::new("dbus-service-name") in get_cli_args()
923 .long("dbus-service-name") in get_cli_args()
927 Arg::new("dbus-system-bus") in get_cli_args()
928 .long("dbus-system-bus") in get_cli_args()
939 /// This is the order used in the `--help` output.
940 fn get_cli_commands_sorted() -> Box<[Command]> { in get_cli_commands_sorted()
942 Command::new("add-device").about("Add VFIO device").arg( in get_cli_commands_sorted()
947 Command::new("add-disk") in get_cli_commands_sorted()
950 Command::new("add-fs") in get_cli_commands_sorted()
951 .about("Add virtio-fs backed fs device") in get_cli_commands_sorted()
957 Command::new("add-net") in get_cli_commands_sorted()
960 Command::new("add-pmem") in get_cli_commands_sorted()
967 Command::new("add-user-device") in get_cli_commands_sorted()
974 Command::new("add-vdpa") in get_cli_commands_sorted()
977 Command::new("add-vsock") in get_cli_commands_sorted()
987 .arg(Arg::new("path").index(1).default_value("-")), in get_cli_commands_sorted()
993 Command::new("power-button").about("Trigger a power button in the VM"), in get_cli_commands_sorted()
995 Command::new("receive-migration") in get_cli_commands_sorted()
1002 Command::new("remove-device") in get_cli_commands_sorted()
1025 Command::new("resize-zone") in get_cli_commands_sorted()
1047 Command::new("send-migration") in get_cli_commands_sorted()
1061 Command::new("shutdown-vmm").about("Shutdown the VMM"), in get_cli_commands_sorted()
1076 let app = Command::new("ch-remote") in main()
1079 .about("Remotely control a cloud-hypervisor VMM.") in main()
1088 matches.get_one::<String>("api-socket"), in main()
1090 matches.get_one::<String>("dbus-service-name"), in main()
1092 matches.get_one::<String>("dbus-object-path"), in main()
1115 matches.get_flag("dbus-system-bus"), in main()
1119 error!("Error creating D-Bus proxy: {e}"); in main()
1126 "`api-socket` and (dbus-service-name or dbus-object-path) are mutually exclusive" in main()
1131 …error!("Please either provide the api-socket option or dbus-service-name and dbus-object-path opti… in main()
1138 fn join_strs(mut acc: String, next: String) -> String { in main()
1158 ) -> Option<String> { in main()
1198 "ch-remote", in main()