package qmp

  1. Overview
  2. Docs
type enabled = {
  1. enabled : bool;
    (*

    feature is present and turned on

    *)
  2. present : bool;
    (*

    feature is present (but may not be turned on)

    *)
}
type vnc = {
  1. enabled : bool;
  2. auth : string;
  3. family : string;
  4. service : int;
  5. host : string;
}
type xen_platform_pv_driver_info = {
  1. product_num : int;
  2. build_num : int;
}
type fd_info = {
  1. fd : int;
  2. fdset_id : int;
}
type char_device = {
  1. label : string;
  2. filename : string;
  3. frontend_open : bool;
}
type qom = {
  1. name : string;
  2. ty : string;
}

QOM properties - https://wiki.qemu.org/index.php/Documentation https://qemu.weilnetz.de/doc/qemu-qmp-ref.html

module Device : sig ... end
type device_add_t = {
  1. driver : string;
  2. device : Device.t;
}
type result =
  1. | Name_list of string list
  2. | Enabled of enabled
  3. | Status of string
  4. | Vnc of vnc
  5. | Xen_platform_pv_driver_info of xen_platform_pv_driver_info
  6. | Hotpluggable_cpus of Device.VCPU.hotpluggable_t list
  7. | Fd_info of fd_info
  8. | Unit
  9. | Qom of qom list
  10. | Char_devices of char_device list

A successful RPC result

type greeting = {
  1. major : int;
    (*

    qemu major version

    *)
  2. minor : int;
    (*

    qemu minor version

    *)
  3. micro : int;
    (*

    qemu micro version

    *)
  4. package : string;
    (*

    some information about the (binary?) package

    *)
}
type event_data =
  1. | RTC_CHANGE of int64
    (*

    emitted when the guest changes the RTC time

    *)
  2. | XEN_PLATFORM_PV_DRIVER_INFO of xen_platform_pv_driver_info
    (*

    emitted when the XEN PV driver writes build number to io-port 0x10, marking the end of the preamble

    *)
type event = {
  1. timestamp : int * int;
    (*

    time the event occurred in (seconds, microseconds)

    *)
  2. event : string;
    (*

    type of event

    *)
  3. data : event_data option;
}
type error = {
  1. cls : string;
  2. descr : string;
}
type id = string

identifier used to match responses with original requests

type medium = {
  1. medium_device : string;
  2. medium_filename : string;
  3. medium_format : string option;
}
type command =
  1. | Qmp_capabilities
  2. | Query_commands
  3. | Query_kvm
  4. | Query_status
  5. | Query_vnc
  6. | Query_xen_platform_pv_driver_info
  7. | Query_hotpluggable_cpus
  8. | Query_migratable
  9. | Query_pci
  10. | Query_chardev
  11. | Stop
  12. | Cont
  13. | Eject of string * bool option
  14. | Change of string * string * string option
  15. | System_powerdown
  16. | Xen_save_devices_state of string
  17. | Xen_load_devices_state of string
  18. | Xen_set_global_dirty_log of bool
  19. | Add_fd of int option
  20. | Remove_fd of int
  21. | Blockdev_change_medium of medium
  22. | Device_add of device_add_t
  23. | Device_del of string
  24. | Qom_list of string
    (*

    commands that may be sent to qemu

    *)
type message =
  1. | Greeting of greeting
  2. | Command of id option * command
  3. | Error of id option * error
  4. | Success of id option * result
  5. | Event of event
    (*

    an individual message sent or received to or from qemu

    *)
val _JSONParsing : string
val message_of_string : string -> message
val string_of_message : message -> string
val json_of_message : message -> Yojson.Safe.t
OCaml

Innovation. Community. Security.