QEMU/KVM virtual machine management via QMP
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): resolve E410/E415 doc style issues

Add missing periods to doc comments, fix [name] format mismatches,
and add pp pretty-printer to Publicsuffix.t.

+125 -148
+6 -6
lib/vm.mli
··· 107 107 (** Running VM handle *) 108 108 109 109 val config : t -> Config.t 110 - (** Get VM configuration *) 110 + (** Get VM configuration. *) 111 111 112 112 (** {1 Lifecycle} *) 113 113 ··· 133 133 (** {1 Status} *) 134 134 135 135 val query_status : t -> (Qmp_protocol.Status.t, string) result 136 - (** Query VM status (running, paused, etc.) *) 136 + (** Query VM status (running, paused, etc.). *) 137 137 138 138 (** {1 Control} *) 139 139 140 140 val stop : t -> (unit, string) result 141 - (** Pause VM execution *) 141 + (** Pause VM execution. *) 142 142 143 143 val cont : t -> (unit, string) result 144 - (** Resume VM execution *) 144 + (** Resume VM execution. *) 145 145 146 146 val shutdown : t -> (unit, string) result 147 - (** Request graceful shutdown (ACPI power button) *) 147 + (** Request graceful shutdown (ACPI power button). *) 148 148 149 149 val quit : t -> (unit, string) result 150 - (** Force quit QEMU immediately *) 150 + (** Force quit QEMU immediately. *)
+1 -1
test/dune
··· 1 1 (test 2 - (name test_qemu) 2 + (name test) 3 3 (libraries qemu alcotest))
+3
test/test.ml
··· 1 + let () = 2 + Alcotest.run "qemu" 3 + [ Test_qemu.suite; Test_qmp_protocol.suite; Test_vm.suite ]
+4 -14
test/test_qemu.ml
··· 606 606 Alcotest.test_case "config kernel boot" `Quick test_config_kernel_boot; 607 607 ] 608 608 609 - let () = 610 - Alcotest.run "qemu" 611 - ([ 612 - ("greeting", greeting_tests); 613 - ("success", success_tests); 614 - ("error", error_tests); 615 - ("event", event_tests); 616 - ("command", command_tests); 617 - ("status", status_tests); 618 - ("version", version_tests); 619 - ("session", session_tests); 620 - ("config", config_tests); 621 - ] 622 - @ Test_qmp_protocol.suite @ Test_vm.suite) 609 + let suite = 610 + ( "qemu", 611 + greeting_tests @ success_tests @ error_tests @ event_tests @ command_tests 612 + @ status_tests @ version_tests @ session_tests @ config_tests )
+56 -68
test/test_qmp_protocol.ml
··· 339 339 (* {1 Test suites} *) 340 340 341 341 let suite = 342 - [ 343 - ( "version_codec", 344 - [ 345 - Alcotest.test_case "make roundtrip" `Quick test_version_make_roundtrip; 346 - Alcotest.test_case "high numbers" `Quick test_version_high_numbers; 347 - Alcotest.test_case "jsont from JSON" `Quick test_version_jsont_from_json; 348 - Alcotest.test_case "extra fields ignored" `Quick 349 - test_version_extra_fields_ignored; 350 - ] ); 351 - ( "greeting_extended", 352 - [ 353 - Alcotest.test_case "QEMU 9.0 (qmp-spec.rst)" `Quick test_greeting_qemu9; 354 - Alcotest.test_case "multiple capabilities" `Quick 355 - test_greeting_multiple_caps; 356 - ] ); 357 - ( "message", 358 - [ 359 - Alcotest.test_case "malformed JSON" `Quick test_message_malformed_json; 360 - Alcotest.test_case "empty object" `Quick test_message_empty_object; 361 - Alcotest.test_case "unknown toplevel key" `Quick 362 - test_message_unknown_toplevel; 363 - Alcotest.test_case "null" `Quick test_message_null; 364 - Alcotest.test_case "array" `Quick test_message_array; 365 - Alcotest.test_case "empty string" `Quick test_message_empty_string; 366 - Alcotest.test_case "success with extra fields" `Quick 367 - test_message_success_extra_fields; 368 - ] ); 369 - ( "command_args", 370 - [ 371 - Alcotest.test_case "with arguments" `Quick test_command_with_arguments; 372 - Alcotest.test_case "with id and arguments" `Quick 373 - test_command_with_id_and_arguments; 374 - Alcotest.test_case "blockdev-add nested args" `Quick 375 - test_command_blockdev_add; 376 - ] ); 377 - ( "run_state", 378 - [ 379 - Alcotest.test_case "unknown string" `Quick test_run_state_unknown_string; 380 - Alcotest.test_case "pp singlestep" `Quick test_status_pp_singlestep; 381 - Alcotest.test_case "pp no singlestep" `Quick 382 - test_status_pp_no_singlestep; 383 - Alcotest.test_case "io-error" `Quick test_status_io_error; 384 - Alcotest.test_case "guest-panicked" `Quick test_status_guest_panicked; 385 - ] ); 386 - ( "error_classes", 387 - [ 388 - Alcotest.test_case "DeviceNotActive" `Quick test_error_device_not_active; 389 - Alcotest.test_case "DeviceNotFound" `Quick test_error_device_not_found; 390 - Alcotest.test_case "Error.pp" `Quick test_error_pp; 391 - ] ); 392 - ( "timestamp", 393 - [ 394 - Alcotest.test_case "zero" `Quick test_timestamp_to_float_zero; 395 - Alcotest.test_case "seconds only" `Quick 396 - test_timestamp_to_float_only_seconds; 397 - Alcotest.test_case "microseconds only" `Quick 398 - test_timestamp_to_float_only_microseconds; 399 - Alcotest.test_case "combined" `Quick test_timestamp_to_float_combined; 400 - Alcotest.test_case "jsont roundtrip" `Quick 401 - test_timestamp_jsont_roundtrip; 402 - ] ); 403 - ( "event_data", 404 - [ 405 - Alcotest.test_case "BLOCK_JOB_COMPLETED" `Quick 406 - test_event_with_complex_data; 407 - Alcotest.test_case "GUEST_PANICKED" `Quick test_event_guest_panicked; 408 - ] ); 409 - ] 342 + ( "qmp_protocol", 343 + [ 344 + Alcotest.test_case "version make roundtrip" `Quick 345 + test_version_make_roundtrip; 346 + Alcotest.test_case "version high numbers" `Quick test_version_high_numbers; 347 + Alcotest.test_case "version jsont from JSON" `Quick 348 + test_version_jsont_from_json; 349 + Alcotest.test_case "version extra fields ignored" `Quick 350 + test_version_extra_fields_ignored; 351 + Alcotest.test_case "greeting QEMU 9.0" `Quick test_greeting_qemu9; 352 + Alcotest.test_case "greeting multiple capabilities" `Quick 353 + test_greeting_multiple_caps; 354 + Alcotest.test_case "message malformed JSON" `Quick 355 + test_message_malformed_json; 356 + Alcotest.test_case "message empty object" `Quick test_message_empty_object; 357 + Alcotest.test_case "message unknown toplevel key" `Quick 358 + test_message_unknown_toplevel; 359 + Alcotest.test_case "message null" `Quick test_message_null; 360 + Alcotest.test_case "message array" `Quick test_message_array; 361 + Alcotest.test_case "message empty string" `Quick test_message_empty_string; 362 + Alcotest.test_case "message success extra fields" `Quick 363 + test_message_success_extra_fields; 364 + Alcotest.test_case "command with arguments" `Quick 365 + test_command_with_arguments; 366 + Alcotest.test_case "command with id and arguments" `Quick 367 + test_command_with_id_and_arguments; 368 + Alcotest.test_case "command blockdev-add nested args" `Quick 369 + test_command_blockdev_add; 370 + Alcotest.test_case "run_state unknown string" `Quick 371 + test_run_state_unknown_string; 372 + Alcotest.test_case "run_state pp singlestep" `Quick 373 + test_status_pp_singlestep; 374 + Alcotest.test_case "run_state pp no singlestep" `Quick 375 + test_status_pp_no_singlestep; 376 + Alcotest.test_case "run_state io-error" `Quick test_status_io_error; 377 + Alcotest.test_case "run_state guest-panicked" `Quick 378 + test_status_guest_panicked; 379 + Alcotest.test_case "error DeviceNotActive" `Quick 380 + test_error_device_not_active; 381 + Alcotest.test_case "error DeviceNotFound" `Quick 382 + test_error_device_not_found; 383 + Alcotest.test_case "error Error.pp" `Quick test_error_pp; 384 + Alcotest.test_case "timestamp zero" `Quick test_timestamp_to_float_zero; 385 + Alcotest.test_case "timestamp seconds only" `Quick 386 + test_timestamp_to_float_only_seconds; 387 + Alcotest.test_case "timestamp microseconds only" `Quick 388 + test_timestamp_to_float_only_microseconds; 389 + Alcotest.test_case "timestamp combined" `Quick 390 + test_timestamp_to_float_combined; 391 + Alcotest.test_case "timestamp jsont roundtrip" `Quick 392 + test_timestamp_jsont_roundtrip; 393 + Alcotest.test_case "event_data BLOCK_JOB_COMPLETED" `Quick 394 + test_event_with_complex_data; 395 + Alcotest.test_case "event_data GUEST_PANICKED" `Quick 396 + test_event_guest_panicked; 397 + ] )
+1
test/test_qmp_protocol.mli
··· 1 + val suite : string * unit Alcotest.test_case list
+53 -59
test/test_vm.ml
··· 613 613 (* {1 Test suites} *) 614 614 615 615 let suite = 616 - [ 617 - ( "config_builder", 618 - [ 619 - Alcotest.test_case "default name" `Quick test_default_name; 620 - Alcotest.test_case "default cpus" `Quick test_default_cpus; 621 - Alcotest.test_case "default memory" `Quick test_default_memory; 622 - Alcotest.test_case "default has qmp" `Quick test_default_has_qmp; 623 - Alcotest.test_case "default serial" `Quick test_default_serial_stdio; 624 - Alcotest.test_case "default display none" `Quick 625 - test_default_display_none; 626 - Alcotest.test_case "with_cpus" `Quick test_with_cpus; 627 - Alcotest.test_case "with_memory_mb" `Quick test_with_memory_mb; 628 - Alcotest.test_case "with_machine" `Quick test_with_machine; 629 - Alcotest.test_case "with_cpu" `Quick test_with_cpu; 630 - Alcotest.test_case "with_arch x86_64" `Quick test_with_arch_x86_64; 631 - Alcotest.test_case "with_arch aarch64" `Quick test_with_arch_aarch64; 632 - Alcotest.test_case "with_accel KVM" `Quick test_with_accel_kvm; 633 - Alcotest.test_case "with_accel HVF" `Quick test_with_accel_hvf; 634 - Alcotest.test_case "with_accel TCG" `Quick test_with_accel_tcg; 635 - Alcotest.test_case "with_kvm deprecated" `Quick test_with_kvm_deprecated; 636 - Alcotest.test_case "extra args" `Quick test_extra_args; 637 - ] ); 638 - ( "to_args", 639 - [ 640 - Alcotest.test_case "network user" `Quick test_network_user; 641 - Alcotest.test_case "network tap" `Quick test_network_tap; 642 - Alcotest.test_case "network tap with script" `Quick 643 - test_network_tap_with_script; 644 - Alcotest.test_case "network bridge" `Quick test_network_bridge; 645 - Alcotest.test_case "display none" `Quick test_display_none; 646 - Alcotest.test_case "display gtk" `Quick test_display_gtk; 647 - Alcotest.test_case "display sdl" `Quick test_display_sdl; 648 - Alcotest.test_case "display vnc" `Quick test_display_vnc; 649 - Alcotest.test_case "display spice" `Quick test_display_spice; 650 - Alcotest.test_case "serial stdio" `Quick test_serial_stdio; 651 - Alcotest.test_case "serial pty" `Quick test_serial_pty; 652 - Alcotest.test_case "serial none" `Quick test_serial_none; 653 - Alcotest.test_case "serial socket" `Quick test_serial_socket; 654 - Alcotest.test_case "qmp socket default" `Quick test_qmp_socket_default; 655 - Alcotest.test_case "qmp socket custom" `Quick test_qmp_socket_custom; 656 - Alcotest.test_case "disk qcow2" `Quick test_disk_qcow2; 657 - Alcotest.test_case "disk raw" `Quick test_disk_raw; 658 - Alcotest.test_case "disk auto" `Quick test_disk_auto; 659 - Alcotest.test_case "disk readonly" `Quick test_disk_readonly; 660 - Alcotest.test_case "disk readwrite" `Quick test_disk_readwrite; 661 - Alcotest.test_case "virtio suffix virt" `Quick test_virtio_suffix_virt; 662 - Alcotest.test_case "virtio suffix q35" `Quick test_virtio_suffix_q35; 663 - Alcotest.test_case "chardev socket server" `Quick test_chardev_socket; 664 - Alcotest.test_case "chardev socket client" `Quick test_chardev_client; 665 - Alcotest.test_case "channel" `Quick test_channel; 666 - Alcotest.test_case "no kernel no args" `Quick 667 - test_no_kernel_no_kernel_args; 668 - Alcotest.test_case "no disks no drive" `Quick test_no_disks_no_drive; 669 - Alcotest.test_case "multiple disks ordering" `Quick 670 - test_multiple_disks_ordering; 671 - Alcotest.test_case "aarch64 kernel boot" `Quick test_aarch64_kernel_boot; 672 - Alcotest.test_case "x86_64 kvm disk" `Quick test_x86_64_kvm_disk; 673 - ] ); 674 - ] 616 + ( "vm", 617 + [ 618 + Alcotest.test_case "default name" `Quick test_default_name; 619 + Alcotest.test_case "default cpus" `Quick test_default_cpus; 620 + Alcotest.test_case "default memory" `Quick test_default_memory; 621 + Alcotest.test_case "default has qmp" `Quick test_default_has_qmp; 622 + Alcotest.test_case "default serial" `Quick test_default_serial_stdio; 623 + Alcotest.test_case "default display none" `Quick test_default_display_none; 624 + Alcotest.test_case "with_cpus" `Quick test_with_cpus; 625 + Alcotest.test_case "with_memory_mb" `Quick test_with_memory_mb; 626 + Alcotest.test_case "with_machine" `Quick test_with_machine; 627 + Alcotest.test_case "with_cpu" `Quick test_with_cpu; 628 + Alcotest.test_case "with_arch x86_64" `Quick test_with_arch_x86_64; 629 + Alcotest.test_case "with_arch aarch64" `Quick test_with_arch_aarch64; 630 + Alcotest.test_case "with_accel KVM" `Quick test_with_accel_kvm; 631 + Alcotest.test_case "with_accel HVF" `Quick test_with_accel_hvf; 632 + Alcotest.test_case "with_accel TCG" `Quick test_with_accel_tcg; 633 + Alcotest.test_case "with_kvm deprecated" `Quick test_with_kvm_deprecated; 634 + Alcotest.test_case "extra args" `Quick test_extra_args; 635 + Alcotest.test_case "network user" `Quick test_network_user; 636 + Alcotest.test_case "network tap" `Quick test_network_tap; 637 + Alcotest.test_case "network tap with script" `Quick 638 + test_network_tap_with_script; 639 + Alcotest.test_case "network bridge" `Quick test_network_bridge; 640 + Alcotest.test_case "display none" `Quick test_display_none; 641 + Alcotest.test_case "display gtk" `Quick test_display_gtk; 642 + Alcotest.test_case "display sdl" `Quick test_display_sdl; 643 + Alcotest.test_case "display vnc" `Quick test_display_vnc; 644 + Alcotest.test_case "display spice" `Quick test_display_spice; 645 + Alcotest.test_case "serial stdio" `Quick test_serial_stdio; 646 + Alcotest.test_case "serial pty" `Quick test_serial_pty; 647 + Alcotest.test_case "serial none" `Quick test_serial_none; 648 + Alcotest.test_case "serial socket" `Quick test_serial_socket; 649 + Alcotest.test_case "qmp socket default" `Quick test_qmp_socket_default; 650 + Alcotest.test_case "qmp socket custom" `Quick test_qmp_socket_custom; 651 + Alcotest.test_case "disk qcow2" `Quick test_disk_qcow2; 652 + Alcotest.test_case "disk raw" `Quick test_disk_raw; 653 + Alcotest.test_case "disk auto" `Quick test_disk_auto; 654 + Alcotest.test_case "disk readonly" `Quick test_disk_readonly; 655 + Alcotest.test_case "disk readwrite" `Quick test_disk_readwrite; 656 + Alcotest.test_case "virtio suffix virt" `Quick test_virtio_suffix_virt; 657 + Alcotest.test_case "virtio suffix q35" `Quick test_virtio_suffix_q35; 658 + Alcotest.test_case "chardev socket server" `Quick test_chardev_socket; 659 + Alcotest.test_case "chardev socket client" `Quick test_chardev_client; 660 + Alcotest.test_case "channel" `Quick test_channel; 661 + Alcotest.test_case "no kernel no args" `Quick 662 + test_no_kernel_no_kernel_args; 663 + Alcotest.test_case "no disks no drive" `Quick test_no_disks_no_drive; 664 + Alcotest.test_case "multiple disks ordering" `Quick 665 + test_multiple_disks_ordering; 666 + Alcotest.test_case "aarch64 kernel boot" `Quick test_aarch64_kernel_boot; 667 + Alcotest.test_case "x86_64 kvm disk" `Quick test_x86_64_kvm_disk; 668 + ] )
+1
test/test_vm.mli
··· 1 + val suite : string * unit Alcotest.test_case list