1 HXCOMM Use
DEFHEADING() to define headings
in both help text and texi
2 HXCOMM Text between STEXI and ETEXI are copied to texi version and
3 HXCOMM discarded from C version
4 HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
5 HXCOMM does not show up
in the other formats
.
6 HXCOMM
DEF(command
, args
, callback, arg_string
, help
) is used to construct
7 HXCOMM monitor commands
8 HXCOMM HXCOMM can be used
for comments
, discarded from both texi and C
11 QMP Supported Commands
12 ----------------------
14 This document describes all commands currently supported by QMP
.
16 Most of the time their usage is exactly the same as
in the user Monitor
, this
17 means that any other document which also describe
commands (the manpage
,
18 QEMU
's manual, etc) can and should be consulted.
20 QMP has two types of commands: regular and query commands. Regular commands
21 usually change the Virtual Machine's state someway
, while query commands just
22 return information
. The sections below are divided accordingly
.
24 It
's important to observe that all communication examples are formatted in
25 a reader-friendly way, so that they're easier to understand
. However
, in real
26 protocol usage
, they
're emitted as a single line.
28 Also, the following notation is used to denote data flow:
30 -> data issued by the Client
31 <- Server data response
33 Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
34 information on the Server command and response formats.
36 NOTE: This document is temporary and will be replaced soon.
38 1. Stability Considerations
39 ===========================
41 The current QMP command set (described in this file) may be useful for a
42 number of use cases, however it's limited and several commands have bad
43 defined semantics
, specially with regard to command completion
.
45 These problems are going to be solved incrementally
in the next QEMU releases
46 and we
're going to establish a deprecation policy for badly defined commands.
48 If you're planning to adopt QMP
, please observe the following
:
50 1. The deprecation policy will take efect and be documented soon
, please
51 check the documentation of each used command as soon as a
new release of
54 2. DO NOT rely on anything which is not explicit documented
56 3. Errors
, in special
, are not documented
. Applications should NOT check
57 for specific errors classes or
data (it
's strongly recommended to only
58 check for the "error" key)
63 Server's responses
in the examples below are always a success response
, please
64 refer to the QMP specification
for more details on error responses
.
74 .args_type
= "name:s?",
76 .help
= "show the help",
77 .mhandler
.cmd
= do_help_cmd
,
81 @item help or ?
[@
var{cmd
}]
83 Show the help
for all commands or just
for command @
var{cmd
}.
88 .args_type
= "device:B",
89 .params
= "device|all",
90 .help
= "commit changes to the disk images (if -snapshot is used) or backing files",
91 .mhandler
.cmd
= do_commit
,
97 Commit changes to the disk
images (if -snapshot is used
) or backing files
.
104 .help
= "quit the emulator",
105 .user_print
= monitor_user_noop
,
106 .mhandler
.cmd_new
= do_quit
,
124 -> { "execute": "quit" }
131 .args_type
= "force:-f,device:B",
132 .params
= "[-f] device",
133 .help
= "eject a removable medium (use -f to force it)",
134 .user_print
= monitor_user_noop
,
135 .mhandler
.cmd_new
= do_eject
,
139 @item eject
[-f
] @
var{device
}
141 Eject a removable
medium (use
-f to force it
).
147 Eject a removable medium
.
151 - force
: force
ejection (json
-bool
, optional
)
152 - device
: device
name (json
-string
)
156 -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
159 Note
: The
"force" argument defaults to
false.
165 .args_type
= "device:B,target:F,arg:s?",
166 .params
= "device filename [format]",
167 .help
= "change a removable medium, optional format",
168 .user_print
= monitor_user_noop
,
169 .mhandler
.cmd_new
= do_change
,
173 @item change @
var{device
} @
var{setting
}
176 Change the configuration of a device
.
179 @item change @
var{diskdevice
} @
var{filename
} [@
var{format
}]
180 Change the medium
for a removable disk device to point to @
var{filename
}. eg
183 (qemu
) change ide1
-cd0
/path
/to
/some
.iso
186 @
var{format
} is optional
.
188 @item change vnc @
var{display
},@
var{options
}
189 Change the configuration of the VNC server
. The valid syntax
for @
var{display
}
190 and @
var{options
} are described at @ref
{sec_invocation
}. eg
193 (qemu
) change vnc localhost
:1
196 @item change vnc password
[@
var{password
}]
198 Change the password associated with the VNC server
. If the
new password is not
199 supplied
, the monitor will prompt
for it to be entered
. VNC passwords are only
200 significant up to
8 letters
. eg
203 (qemu
) change vnc password
213 Change a removable medium or VNC configuration
.
217 - "device": device
name (json
-string
)
218 - "target": filename or
item (json
-string
)
219 - "arg": additional
argument (json
-string
, optional
)
223 1. Change a removable medium
225 -> { "execute": "change",
226 "arguments": { "device": "ide1-cd0",
227 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
230 2. Change VNC password
232 -> { "execute": "change",
233 "arguments": { "device": "vnc", "target": "password",
240 .name
= "screendump",
241 .args_type
= "filename:F",
242 .params
= "filename",
243 .help
= "save screen into PPM image 'filename'",
244 .user_print
= monitor_user_noop
,
245 .mhandler
.cmd_new
= do_screen_dump
,
249 @item screendump @
var{filename
}
251 Save screen into PPM image @
var{filename
}.
257 Save screen into PPM image
.
261 - "filename": file
path (json
-string
)
265 -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
272 .args_type
= "filename:F",
273 .params
= "filename",
274 .help
= "output logs to 'filename'",
275 .mhandler
.cmd
= do_logfile
,
279 @item logfile @
var{filename
}
281 Output logs to @
var{filename
}.
284 #ifdef CONFIG_SIMPLE_TRACE
286 .name
= "trace-event",
287 .args_type
= "name:s,option:b",
288 .params
= "name on|off",
289 .help
= "changes status of a specific trace event",
290 .mhandler
.cmd
= do_change_trace_event_state
,
296 changes status of a
trace event
302 .args_type
= "items:s",
303 .params
= "item1[,...]",
304 .help
= "activate logging of the specified items to '/tmp/qemu.log'",
305 .mhandler
.cmd
= do_log
,
309 @item log @
var{item1
}[,...]
311 Activate logging of the specified items to @file
{/tmp
/qemu
.log
}.
316 .args_type
= "name:s?",
317 .params
= "[tag|id]",
318 .help
= "save a VM snapshot. If no tag or id are provided, a new snapshot is created",
319 .mhandler
.cmd
= do_savevm
,
323 @item savevm
[@
var{tag
}|@
var{id
}]
325 Create a snapshot of the whole virtual machine
. If @
var{tag
} is
326 provided
, it is used as human readable identifier
. If there is already
327 a snapshot with the same tag or ID
, it is replaced
. More info at
333 .args_type
= "name:s",
335 .help
= "restore a VM snapshot from its tag or id",
336 .mhandler
.cmd
= do_loadvm
,
340 @item loadvm @
var{tag
}|@
var{id
}
342 Set the whole virtual machine to the snapshot identified by the tag
343 @
var{tag
} or the unique snapshot ID @
var{id
}.
348 .args_type
= "name:s",
350 .help
= "delete a VM snapshot from its tag or id",
351 .mhandler
.cmd
= do_delvm
,
355 @item delvm @
var{tag
}|@
var{id
}
357 Delete the snapshot identified by @
var{tag
} or @
var{id
}.
361 .name
= "singlestep",
362 .args_type
= "option:s?",
363 .params
= "[on|off]",
364 .help
= "run emulation in singlestep mode or switch to normal mode",
365 .mhandler
.cmd
= do_singlestep
,
369 @item singlestep
[off
]
371 Run the emulation
in single step mode
.
372 If called with option off
, the emulation returns to normal mode
.
379 .help
= "stop emulation",
380 .user_print
= monitor_user_noop
,
381 .mhandler
.cmd_new
= do_stop
,
399 -> { "execute": "stop" }
408 .help
= "resume emulation",
409 .user_print
= monitor_user_noop
,
410 .mhandler
.cmd_new
= do_cont
,
428 -> { "execute": "cont" }
435 .args_type
= "device:s?",
436 .params
= "[device]",
437 .help
= "start gdbserver on given device (default 'tcp::1234'), stop with 'none'",
438 .mhandler
.cmd
= do_gdbserver
,
442 @item gdbserver
[@
var{port
}]
444 Start gdbserver
session (default @
var{port
}=1234)
449 .args_type
= "fmt:/,addr:l",
450 .params
= "/fmt addr",
451 .help
= "virtual memory dump starting at 'addr'",
452 .mhandler
.cmd
= do_memory_dump
,
456 @item x
/fmt @
var{addr
}
458 Virtual memory dump starting at @
var{addr
}.
463 .args_type
= "fmt:/,addr:l",
464 .params
= "/fmt addr",
465 .help
= "physical memory dump starting at 'addr'",
466 .mhandler
.cmd
= do_physical_memory_dump
,
470 @item xp
/@
var{fmt
} @
var{addr
}
472 Physical memory dump starting at @
var{addr
}.
474 @
var{fmt
} is a format which tells the command how to format the
475 data
. Its syntax is
: @option
{/@
{count@
}@
{format@
}@
{size@
}}
479 is the number of items to be dumped
.
482 can be
x (hex
), d (signed decimal
), u (unsigned decimal
), o (octal
),
483 c (char
) or
i (asm instruction
).
486 can be
b (8 bits
), h (16 bits
), w (32 bits
) or
g (64 bits
). On x86
,
487 @code
{h
} or @code
{w
} can be specified with the @code
{i
} format to
488 respectively select
16 or
32 bit code instruction size
.
495 Dump
10 instructions at the current instruction pointer
:
500 0x90107065: lea
0x0(%esi
,1),%esi
501 0x90107069: lea
0x0(%edi
,1),%edi
503 0x90107071: jmp
0x90107080
511 Dump
80 16 bit values at the start of the video memory
.
513 (qemu
) xp
/80hx
0xb8000
514 0x000b8000: 0x0b50 0x0b6c 0x0b65 0x0b78 0x0b38 0x0b36 0x0b2f 0x0b42
515 0x000b8010: 0x0b6f 0x0b63 0x0b68 0x0b73 0x0b20 0x0b56 0x0b47 0x0b41
516 0x000b8020: 0x0b42 0x0b69 0x0b6f 0x0b73 0x0b20 0x0b63 0x0b75 0x0b72
517 0x000b8030: 0x0b72 0x0b65 0x0b6e 0x0b74 0x0b2d 0x0b63 0x0b76 0x0b73
518 0x000b8040: 0x0b20 0x0b30 0x0b35 0x0b20 0x0b4e 0x0b6f 0x0b76 0x0b20
519 0x000b8050: 0x0b32 0x0b30 0x0b30 0x0b33 0x0720 0x0720 0x0720 0x0720
520 0x000b8060: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
521 0x000b8070: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
522 0x000b8080: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
523 0x000b8090: 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720 0x0720
530 .args_type
= "fmt:/,val:l",
531 .params
= "/fmt expr",
532 .help
= "print expression value (use $reg for CPU register access)",
533 .mhandler
.cmd
= do_print
,
537 @item p or print
/@
var{fmt
} @
var{expr
}
540 Print expression value
. Only the @
var{format
} part of @
var{fmt
} is
546 .args_type
= "fmt:/,addr:i,index:i.",
547 .params
= "/fmt addr",
548 .help
= "I/O port read",
549 .mhandler
.cmd
= do_ioport_read
,
558 .args_type
= "fmt:/,addr:i,val:i",
559 .params
= "/fmt addr value",
560 .help
= "I/O port write",
561 .mhandler
.cmd
= do_ioport_write
,
570 .args_type
= "string:s,hold_time:i?",
571 .params
= "keys [hold_ms]",
572 .help
= "send keys to the VM (e.g. 'sendkey ctrl-alt-f1', default hold time=100 ms)",
573 .mhandler
.cmd
= do_sendkey
,
577 @item sendkey @
var{keys
}
580 Send @
var{keys
} to the emulator
. @
var{keys
} could be the name of the
581 key or @code
{#
} followed by the raw value
in either decimal or hexadecimal
582 format
. Use @code
{-} to press several keys simultaneously
. Example
:
587 This command is useful to send keys that your graphical user
interface
588 intercepts at low level
, such as @code
{ctrl
-alt
-f1
} in X Window
.
592 .name
= "system_reset",
595 .help
= "reset the system",
596 .user_print
= monitor_user_noop
,
597 .mhandler
.cmd_new
= do_system_reset
,
616 -> { "execute": "system_reset" }
622 .name
= "system_powerdown",
625 .help
= "send system power down event",
626 .user_print
= monitor_user_noop
,
627 .mhandler
.cmd_new
= do_system_powerdown
,
631 @item system_powerdown
632 @findex system_powerdown
634 Power down the
system (if supported
).
640 Send system power down event
.
646 -> { "execute": "system_powerdown" }
653 .args_type
= "start:i,size:i",
654 .params
= "addr size",
655 .help
= "compute the checksum of a memory region",
656 .mhandler
.cmd
= do_sum
,
660 @item sum @
var{addr
} @
var{size
}
663 Compute the checksum of a memory region
.
668 .args_type
= "devname:s",
670 .help
= "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')",
671 .mhandler
.cmd
= do_usb_add
,
675 @item usb_add @
var{devname
}
678 Add the USB device @
var{devname
}. For details of available devices see
684 .args_type
= "devname:s",
686 .help
= "remove USB device 'bus.addr'",
687 .mhandler
.cmd
= do_usb_del
,
691 @item usb_del @
var{devname
}
694 Remove the USB device @
var{devname
} from the QEMU virtual USB
695 hub
. @
var{devname
} has the syntax @code
{bus
.addr
}. Use the monitor
696 command @code
{info usb
} to see the devices you can remove
.
700 .name
= "device_add",
701 .args_type
= "device:O",
702 .params
= "driver[,prop=value][,...]",
703 .help
= "add device, like -device on the command line",
704 .user_print
= monitor_user_noop
,
705 .mhandler
.cmd_new
= do_device_add
,
709 @item device_add @
var{config
}
722 - "driver": the name of the
new device
's driver (json-string)
723 - "bus": the device's parent
bus (device tree path
, json
-string
, optional
)
724 - "id": the device
's ID, must be unique (json-string)
729 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
734 (1) For detailed information about this command, please refer to the
735 'docs
/qdev
-device
-use
.txt
' file.
737 (2) It's possible to list device properties by running QEMU with the
738 "-device DEVICE,\?" command
-line argument
, where DEVICE is the device
's name
743 .name = "device_del",
746 .help = "remove device",
747 .user_print = monitor_user_noop,
748 .mhandler.cmd_new = do_device_del,
752 @item device_del @var{id}
755 Remove device @var{id}.
765 - "id": the device's
ID (json
-string
)
769 -> { "execute": "device_del", "arguments": { "id": "net1" } }
776 .args_type
= "index:i",
778 .help
= "set the default CPU",
779 .user_print
= monitor_user_noop
,
780 .mhandler
.cmd_new
= do_cpu_set
,
784 @item cpu @
var{index
}
796 - "index": the CPU
's index (json-int)
800 -> { "execute": "cpu", "arguments": { "index": 0 } }
803 Note: CPUs' indexes are obtained with the
'query-cpus' command
.
808 .name
= "mouse_move",
809 .args_type
= "dx_str:s,dy_str:s,dz_str:s?",
810 .params
= "dx dy [dz]",
811 .help
= "send mouse move events",
812 .mhandler
.cmd
= do_mouse_move
,
816 @item mouse_move @
var{dx
} @
var{dy
} [@
var{dz
}]
818 Move the active mouse to the specified coordinates @
var{dx
} @
var{dy
}
819 with optional scroll axis @
var{dz
}.
823 .name
= "mouse_button",
824 .args_type
= "button_state:i",
826 .help
= "change mouse button state (1=L, 2=M, 4=R)",
827 .mhandler
.cmd
= do_mouse_button
,
831 @item mouse_button @
var{val
}
833 Change the active mouse button state @
var{val
} (1=L
, 2=M
, 4=R
).
838 .args_type
= "index:i",
840 .help
= "set which mouse device receives events",
841 .mhandler
.cmd
= do_mouse_set
,
845 @item mouse_set @
var{index
}
847 Set which mouse device receives events at given @
var{index
}, index
856 .name
= "wavcapture",
857 .args_type
= "path:F,freq:i?,bits:i?,nchannels:i?",
858 .params
= "path [frequency [bits [channels]]]",
859 .help
= "capture audio to a wave file (default frequency=44100 bits=16 channels=2)",
860 .mhandler
.cmd
= do_wav_capture
,
864 @item wavcapture @
var{filename
} [@
var{frequency
} [@
var{bits
} [@
var{channels
}]]]
866 Capture audio into @
var{filename
}. Using sample rate @
var{frequency
}
867 bits per sample @
var{bits
} and number of channels @
var{channels
}.
871 @item Sample rate
= 44100 Hz
- CD quality
873 @item Number of channels
= 2 - Stereo
879 .name
= "stopcapture",
881 .params
= "capture index",
882 .help
= "stop capture",
883 .mhandler
.cmd
= do_stop_capture
,
887 @item stopcapture @
var{index
}
889 Stop capture with a given @
var{index
}, index can be obtained with
897 .args_type
= "val:l,size:i,filename:s",
898 .params
= "addr size file",
899 .help
= "save to disk virtual memory dump starting at 'addr' of size 'size'",
900 .user_print
= monitor_user_noop
,
901 .mhandler
.cmd_new
= do_memory_save
,
905 @item memsave @
var{addr
} @
var{size
} @
var{file
}
907 save to disk virtual memory dump starting at @
var{addr
} of size @
var{size
}.
913 Save to disk virtual memory dump starting at
'val' of size
'size'.
917 - "val": the starting
address (json
-int
)
918 - "size": the memory size
, in bytes (json
-int
)
919 - "filename": file
path (json
-string
)
923 -> { "execute": "memsave",
924 "arguments": { "val": 10,
926 "filename": "/tmp/virtual-mem-dump" } }
929 Note
: Depends on the current CPU
.
935 .args_type
= "val:l,size:i,filename:s",
936 .params
= "addr size file",
937 .help
= "save to disk physical memory dump starting at 'addr' of size 'size'",
938 .user_print
= monitor_user_noop
,
939 .mhandler
.cmd_new
= do_physical_memory_save
,
943 @item pmemsave @
var{addr
} @
var{size
} @
var{file
}
945 save to disk physical memory dump starting at @
var{addr
} of size @
var{size
}.
951 Save to disk physical memory dump starting at
'val' of size
'size'.
955 - "val": the starting
address (json
-int
)
956 - "size": the memory size
, in bytes (json
-int
)
957 - "filename": file
path (json
-string
)
961 -> { "execute": "pmemsave",
962 "arguments": { "val": 10,
964 "filename": "/tmp/physical-mem-dump" } }
971 .args_type
= "bootdevice:s",
972 .params
= "bootdevice",
973 .help
= "define new values for the boot device list",
974 .mhandler
.cmd
= do_boot_set
,
978 @item boot_set @
var{bootdevicelist
}
981 Define
new values
for the boot device list
. Those values will
override
982 the values specified on the command line through the @code
{-boot
} option
.
984 The values that can be specified
here depend on the machine type
, but are
985 the same that can be specified
in the @code
{-boot
} command line option
.
988 #
if defined(TARGET_I386
)
991 .args_type
= "cpu_index:i",
993 .help
= "inject an NMI on the given CPU",
994 .mhandler
.cmd
= do_inject_nmi
,
1000 Inject an NMI on the given
CPU (x86 only
).
1005 .args_type
= "detach:-d,blk:-b,inc:-i,uri:s",
1006 .params
= "[-d] [-b] [-i] uri",
1007 .help
= "migrate to URI (using -d to not wait for completion)"
1008 "\n\t\t\t -b for migration without shared storage with"
1009 " full copy of disk\n\t\t\t -i for migration without "
1010 "shared storage with incremental copy of disk "
1011 "(base image shared between src and destination)",
1012 .user_print
= monitor_user_noop
,
1013 .mhandler
.cmd_new
= do_migrate
,
1018 @item migrate
[-d
] [-b
] [-i
] @
var{uri
}
1020 Migrate to @
var{uri
} (using -d to not wait
for completion
).
1021 -b
for migration with full copy of disk
1022 -i
for migration with incremental copy of
disk (base image is shared
)
1032 - "blk": block migration
, full disk
copy (json
-bool
, optional
)
1033 - "inc": incremental disk
copy (json
-bool
, optional
)
1034 - "uri": Destination
URI (json
-string
)
1038 -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
1043 (1) The
'query-migrate' command should be used to check migration
's progress
1044 and final result (this information is provided by the 'status
' member)
1045 (2) All boolean arguments default to false
1046 (3) The user Monitor's
"detach" argument is invalid
in QMP and should not
1052 .name
= "migrate_cancel",
1055 .help
= "cancel the current VM migration",
1056 .user_print
= monitor_user_noop
,
1057 .mhandler
.cmd_new
= do_migrate_cancel
,
1061 @item migrate_cancel
1062 @findex migrate_cancel
1063 Cancel the current VM migration
.
1069 Cancel the current migration
.
1075 -> { "execute": "migrate_cancel" }
1081 .name
= "migrate_set_speed",
1082 .args_type
= "value:f",
1084 .help
= "set maximum speed (in bytes) for migrations",
1085 .user_print
= monitor_user_noop
,
1086 .mhandler
.cmd_new
= do_migrate_set_speed
,
1090 @item migrate_set_speed @
var{value
}
1091 @findex migrate_set_speed
1092 Set maximum speed to @
var{value
} (in bytes
) for migrations
.
1098 Set maximum speed
for migrations
.
1102 - "value": maximum speed
, in bytes per
second (json
-number
)
1106 -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
1112 .name
= "migrate_set_downtime",
1113 .args_type
= "value:T",
1115 .help
= "set maximum tolerated downtime (in seconds) for migrations",
1116 .user_print
= monitor_user_noop
,
1117 .mhandler
.cmd_new
= do_migrate_set_downtime
,
1121 @item migrate_set_downtime @
var{second
}
1122 @findex migrate_set_downtime
1123 Set maximum tolerated
downtime (in seconds
) for migration
.
1126 migrate_set_downtime
1127 --------------------
1129 Set maximum tolerated
downtime (in seconds
) for migrations
.
1133 - "value": maximum
downtime (json
-number
)
1137 -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
1142 #
if defined(TARGET_I386
)
1144 .name
= "drive_add",
1145 .args_type
= "pci_addr:s,opts:s",
1146 .params
= "[[<domain>:]<bus>:]<slot>\n"
1147 "[file=file][,if=type][,bus=n]\n"
1148 "[,unit=m][,media=d][index=i]\n"
1149 "[,cyls=c,heads=h,secs=s[,trans=t]]\n"
1150 "[snapshot=on|off][,cache=on|off]",
1151 .help
= "add drive to PCI storage controller",
1152 .mhandler
.cmd
= drive_hot_add
,
1159 Add drive to PCI storage controller
.
1162 #
if defined(TARGET_I386
)
1165 .args_type
= "pci_addr:s,type:s,opts:s?",
1166 .params
= "auto|[[<domain>:]<bus>:]<slot> nic|storage [[vlan=n][,macaddr=addr][,model=type]] [file=file][,if=type][,bus=nr]...",
1167 .help
= "hot-add PCI device",
1168 .mhandler
.cmd
= pci_device_hot_add
,
1178 #
if defined(TARGET_I386
)
1181 .args_type
= "pci_addr:s",
1182 .params
= "[[<domain>:]<bus>:]<slot>",
1183 .help
= "hot remove PCI device",
1184 .mhandler
.cmd
= do_pci_device_hot_remove
,
1191 Hot remove PCI device
.
1195 .name
= "host_net_add",
1196 .args_type
= "device:s,opts:s?",
1197 .params
= "tap|user|socket|vde|dump [options]",
1198 .help
= "add host VLAN client",
1199 .mhandler
.cmd
= net_host_device_add
,
1204 @findex host_net_add
1205 Add host VLAN client
.
1209 .name
= "host_net_remove",
1210 .args_type
= "vlan_id:i,device:s",
1211 .params
= "vlan_id name",
1212 .help
= "remove host VLAN client",
1213 .mhandler
.cmd
= net_host_device_remove
,
1217 @item host_net_remove
1218 @findex host_net_remove
1219 Remove host VLAN client
.
1223 .name
= "netdev_add",
1224 .args_type
= "netdev:O",
1225 .params
= "[user|tap|socket],id=str[,prop=value][,...]",
1226 .help
= "add host network device",
1227 .user_print
= monitor_user_noop
,
1228 .mhandler
.cmd_new
= do_netdev_add
,
1234 Add host network device
.
1240 Add host network device
.
1244 - "type": the device type
, "tap", "user", ... (json
-string
)
1245 - "id": the device
's ID, must be unique (json-string)
1250 -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
1253 Note: The supported device options are the same ones supported by the '-net
'
1254 command-line argument, which are listed in the '-help
' output or QEMU's
1260 .name
= "netdev_del",
1261 .args_type
= "id:s",
1263 .help
= "remove host network device",
1264 .user_print
= monitor_user_noop
,
1265 .mhandler
.cmd_new
= do_netdev_del
,
1271 Remove host network device
.
1277 Remove host network device
.
1281 - "id": the device
's ID, must be unique (json-string)
1285 -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
1292 .name = "hostfwd_add",
1293 .args_type = "arg1:s,arg2:s?,arg3:s?",
1294 .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport",
1295 .help = "redirect TCP or UDP connections from host to guest (requires -net user)",
1296 .mhandler.cmd = net_slirp_hostfwd_add,
1302 Redirect TCP or UDP connections from host to guest (requires -net user).
1307 .name = "hostfwd_remove",
1308 .args_type = "arg1:s,arg2:s?,arg3:s?",
1309 .params = "[vlan_id name] [tcp|udp]:[hostaddr]:hostport",
1310 .help = "remove host-to-guest TCP or UDP redirection",
1311 .mhandler.cmd = net_slirp_hostfwd_remove,
1316 @item hostfwd_remove
1317 @findex hostfwd_remove
1318 Remove host-to-guest TCP or UDP redirection.
1323 .args_type = "value:M",
1325 .help = "request VM to change its memory allocation (in MB)",
1326 .user_print = monitor_user_noop,
1327 .mhandler.cmd_async = do_balloon,
1328 .flags = MONITOR_CMD_ASYNC,
1332 @item balloon @var{value}
1334 Request VM to change its memory allocation to @var{value} (in MB).
1340 Request VM to change its memory allocation (in bytes).
1344 - "value": New memory allocation (json-int)
1348 -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1355 .args_type = "name:s,up:b",
1356 .params = "name on|off",
1357 .help = "change the link status of a network adapter",
1358 .user_print = monitor_user_noop,
1359 .mhandler.cmd_new = do_set_link,
1363 @item set_link @var{name} [on|off]
1365 Switch link @var{name} on (i.e. up) or off (i.e. down).
1371 Change the link status of a network adapter.
1375 - "name": network device name (json-string)
1376 - "up": status is up (json-bool)
1380 -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1386 .name = "watchdog_action",
1387 .args_type = "action:s",
1388 .params = "[reset|shutdown|poweroff|pause|debug|none]",
1389 .help = "change watchdog action",
1390 .mhandler.cmd = do_watchdog_action,
1394 @item watchdog_action
1395 @findex watchdog_action
1396 Change watchdog action.
1401 .args_type = "aclname:s",
1402 .params = "aclname",
1403 .help = "list rules in the access control list",
1404 .mhandler.cmd = do_acl_show,
1408 @item acl_show @var{aclname}
1410 List all the matching rules in the access control list, and the default
1411 policy. There are currently two named access control lists,
1412 @var{vnc.x509dname} and @var{vnc.username} matching on the x509 client
1413 certificate distinguished name, and SASL username respectively.
1417 .name = "acl_policy",
1418 .args_type = "aclname:s,policy:s",
1419 .params = "aclname allow|deny",
1420 .help = "set default access control list policy",
1421 .mhandler.cmd = do_acl_policy,
1425 @item acl_policy @var{aclname} @code{allow|deny}
1427 Set the default access control list policy, used in the event that
1428 none of the explicit rules match. The default policy at startup is
1434 .args_type = "aclname:s,match:s,policy:s,index:i?",
1435 .params = "aclname match allow|deny [index]",
1436 .help = "add a match rule to the access control list",
1437 .mhandler.cmd = do_acl_add,
1441 @item acl_add @var{aclname} @var{match} @code{allow|deny} [@var{index}]
1443 Add a match rule to the access control list, allowing or denying access.
1444 The match will normally be an exact username or x509 distinguished name,
1445 but can optionally include wildcard globs. eg @code{*@@EXAMPLE.COM} to
1446 allow all users in the @code{EXAMPLE.COM} kerberos realm. The match will
1447 normally be appended to the end of the ACL, but can be inserted
1448 earlier in the list if the optional @var{index} parameter is supplied.
1452 .name = "acl_remove",
1453 .args_type = "aclname:s,match:s",
1454 .params = "aclname match",
1455 .help = "remove a match rule from the access control list",
1456 .mhandler.cmd = do_acl_remove,
1460 @item acl_remove @var{aclname} @var{match}
1462 Remove the specified match rule from the access control list.
1466 .name = "acl_reset",
1467 .args_type = "aclname:s",
1468 .params = "aclname",
1469 .help = "reset the access control list",
1470 .mhandler.cmd = do_acl_reset,
1474 @item acl_reset @var{aclname}
1476 Remove all matches from the access control list, and set the default
1477 policy back to @code{deny}.
1480 #if defined(TARGET_I386)
1484 .args_type = "cpu_index:i,bank:i,status:l,mcg_status:l,addr:l,misc:l",
1485 .params = "cpu bank status mcgstatus addr misc",
1486 .help = "inject a MCE on the given CPU",
1487 .mhandler.cmd = do_inject_mce,
1492 @item mce @var{cpu} @var{bank} @var{status} @var{mcgstatus} @var{addr} @var{misc}
1494 Inject an MCE on the given CPU (x86 only).
1499 .args_type = "fdname:s",
1500 .params = "getfd name",
1501 .help = "receive a file descriptor via SCM rights and assign it a name",
1502 .user_print = monitor_user_noop,
1503 .mhandler.cmd_new = do_getfd,
1507 @item getfd @var{fdname}
1509 If a file descriptor is passed alongside this command using the SCM_RIGHTS
1510 mechanism on unix sockets, it is stored using the name @var{fdname} for
1511 later use by other monitor commands.
1517 Receive a file descriptor via SCM rights and assign it a name.
1521 - "fdname": file descriptor name (json-string)
1525 -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1532 .args_type = "fdname:s",
1533 .params = "closefd name",
1534 .help = "close a file descriptor previously passed via SCM rights",
1535 .user_print = monitor_user_noop,
1536 .mhandler.cmd_new = do_closefd,
1540 @item closefd @var{fdname}
1542 Close the file descriptor previously assigned to @var{fdname} using the
1543 @code{getfd} command. This is only needed if the file descriptor was never
1544 used by another monitor command.
1550 Close a file descriptor previously passed via SCM rights.
1554 - "fdname": file descriptor name (json-string)
1558 -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1564 .name = "block_passwd",
1565 .args_type = "device:B,password:s",
1566 .params = "block_passwd device password",
1567 .help = "set the password of encrypted block devices",
1568 .user_print = monitor_user_noop,
1569 .mhandler.cmd_new = do_block_set_passwd,
1573 @item block_passwd @var{device} @var{password}
1574 @findex block_passwd
1575 Set the encrypted device @var{device} password to @var{password}
1581 Set the password of encrypted block devices.
1585 - "device": device name (json-string)
1586 - "password": password (json-string)
1590 -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1591 "password": "12345" } }
1597 .name = "qmp_capabilities",
1600 .help = "enable QMP capabilities",
1601 .user_print = monitor_user_noop,
1602 .mhandler.cmd_new = do_qmp_capabilities,
1606 @item qmp_capabilities
1607 @findex qmp_capabilities
1608 Enable the specified QMP capabilities
1614 Enable QMP capabilities.
1620 -> { "execute": "qmp_capabilities" }
1623 Note: This command must be issued before issuing any other command.
1628 HXCOMM Keep the 'info
' command at the end!
1629 HXCOMM This is required for the QMP documentation layout.
1640 .args_type = "item:s?",
1641 .params = "[subcommand]",
1642 .help = "show various information about the system state",
1643 .user_print = monitor_user_noop,
1644 .mhandler.cmd_new = do_info,
1648 @item info @var{subcommand}
1650 Show various information about the system state.
1654 show the version of QEMU
1662 Return a json-object with the following information:
1664 - "qemu": A json-object containing three integer values:
1665 - "major": QEMU's major
version (json
-int
)
1666 - "minor": QEMU
's minor version (json-int)
1667 - "micro": QEMU's micro
version (json
-int
)
1668 - "package": package's version (json-string)
1672 -> { "execute": "query-version" }
1688 list QMP available commands
1694 List QMP available commands.
1696 Each command is represented by a json-object, the returned value is a json-array
1699 Each json-object contain:
1701 - "name": command's
name (json
-string
)
1705 -> { "execute": "query-commands" }
1709 "name":"query-balloon"
1712 "name":"system_powerdown"
1717 Note
: This example has been shortened as the real response is too long
.
1723 show the various VLANs and the associated devices
1728 show the character devices
1734 Each device is represented by a json
-object
. The returned value is a json
-array
1737 Each json
-object contain the following
:
1739 - "label": device
's label (json-string)
1740 - "filename": device's
file (json
-string
)
1744 -> { "execute": "query-chardev" }
1762 show the block devices
1768 Show the block devices
.
1770 Each block device information is stored
in a json
-object and the returned value
1771 is a json
-array of all devices
.
1773 Each json
-object contain the following
:
1775 - "device": device
name (json
-string
)
1776 - "type": device
type (json
-string
)
1777 - Possible values
: "hd", "cdrom", "floppy", "unknown"
1778 - "removable": true if the device is removable
, false otherwise (json
-bool
)
1779 - "locked": true if the device is locked
, false otherwise (json
-bool
)
1780 - "inserted": only present
if the device is inserted
, it is a json
-object
1781 containing the following
:
1782 - "file": device file
name (json
-string
)
1783 - "ro": true if read
-only
, false otherwise (json
-bool
)
1784 - "drv": driver format
name (json
-string
)
1785 - Possible values
: "blkdebug", "bochs", "cloop", "cow", "dmg",
1786 "file", "file", "ftp", "ftps", "host_cdrom",
1787 "host_device", "host_floppy", "http", "https",
1788 "nbd", "parallels", "qcow", "qcow2", "raw",
1789 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1790 - "backing_file": backing file
name (json
-string
, optional
)
1791 - "encrypted": true if encrypted
, false otherwise (json
-bool
)
1795 -> { "execute": "query-block" }
1799 "device":"ide0-hd0",
1806 "file":"disks/test.img"
1811 "device":"ide1-cd0",
1834 @item info blockstats
1835 show block device statistics
1841 Show block device statistics
.
1843 Each device statistic information is stored
in a json
-object and the returned
1844 value is a json
-array of all devices
.
1846 Each json
-object contain the following
:
1848 - "device": device
name (json
-string
)
1849 - "stats": A json
-object with the statistics information
, it contains
:
1850 - "rd_bytes": bytes
read (json
-int
)
1851 - "wr_bytes": bytes
written (json
-int
)
1852 - "rd_operations": read
operations (json
-int
)
1853 - "wr_operations": write
operations (json
-int
)
1854 - "wr_highest_offset": Highest offset of a sector written since the
1855 BlockDriverState has been
opened (json
-int
)
1856 - "parent": Contains recursively the statistics of the underlying
1857 protocol (e
.g
. the host file
for a qcow2 image
). If there is
1858 no underlying protocol
, this field is omitted
1859 (json
-object
, optional
)
1863 -> { "execute": "query-blockstats" }
1867 "device":"ide0-hd0",
1870 "wr_highest_offset":3686448128,
1872 "wr_operations":751,
1873 "rd_bytes":122567168,
1874 "rd_operations":36772
1878 "wr_highest_offset":2821110784,
1880 "wr_operations":692,
1881 "rd_bytes":122739200,
1882 "rd_operations":36604
1886 "device":"ide1-cd0",
1888 "wr_highest_offset":0,
1898 "wr_highest_offset":0,
1908 "wr_highest_offset":0,
1921 @item info registers
1922 show the cpu registers
1924 show infos
for each CPU
1930 Show CPU information
.
1932 Return a json
-array
. Each CPU is represented by a json
-object
, which contains
:
1934 - "CPU": CPU
index (json
-int
)
1935 - "current": true if this is the current CPU
, false otherwise (json
-bool
)
1936 - "halted": true if the cpu is halted
, false otherwise (json
-bool
)
1937 - Current program counter
. The key
's name depends on the architecture:
1938 "pc": i386/x86_64 (json-int)
1939 "nip": PPC (json-int)
1940 "pc" and "npc": sparc (json-int)
1941 "PC": mips (json-int)
1945 -> { "execute": "query-cpus" }
1967 show the command line history
1969 show the interrupts statistics (if available)
1971 show i8259 (PIC) state
1976 show emulated PCI device info
1982 PCI buses and devices information.
1984 The returned value is a json-array of all buses. Each bus is represented by
1985 a json-object, which has a key with a json-array of all PCI devices attached
1986 to it. Each device is represented by a json-object.
1988 The bus json-object contains the following:
1990 - "bus": bus number (json-int)
1991 - "devices": a json-array of json-objects, each json-object represents a
1994 The PCI device json-object contains the following:
1996 - "bus": identical to the parent's bus
number (json
-int
)
1997 - "slot": slot
number (json
-int
)
1998 - "function": function number (json
-int
)
1999 - "class_info": a json
-object containing
:
2000 - "desc": device
class description (json
-string
, optional
)
2001 - "class": device
class number (json
-int
)
2002 - "id": a json
-object containing
:
2003 - "device": device
ID (json
-int
)
2004 - "vendor": vendor
ID (json
-int
)
2005 - "irq": device
's IRQ if assigned (json-int, optional)
2006 - "qdev_id": qdev id string (json-string)
2007 - "pci_bridge": It's a json
-object
, only present
if this device is a
2008 PCI bridge
, contains
:
2009 - "bus": bus
number (json
-int
)
2010 - "secondary": secondary bus
number (json
-int
)
2011 - "subordinate": subordinate bus
number (json
-int
)
2012 - "io_range": I
/O memory range information
, a json
-object with the
2014 - "base": base address
, in bytes (json
-int
)
2015 - "limit": limit address
, in bytes (json
-int
)
2016 - "memory_range": memory range information
, a json
-object with the
2018 - "base": base address
, in bytes (json
-int
)
2019 - "limit": limit address
, in bytes (json
-int
)
2020 - "prefetchable_range": Prefetchable memory range information
, a
2021 json
-object with the following members
:
2022 - "base": base address
, in bytes (json
-int
)
2023 - "limit": limit address
, in bytes (json
-int
)
2024 - "devices": a json
-array of PCI devices
if there
's any attached, each
2025 each element is represented by a json-object, which contains
2026 the same members of the 'PCI device json
-object
' described
2028 - "regions": a json-array of json-objects, each json-object represents a
2029 memory region of this device
2031 The memory range json-object contains the following:
2033 - "base": base memory address (json-int)
2034 - "limit": limit value (json-int)
2036 The region json-object can be an I/O region or a memory region, an I/O region
2037 json-object contains the following:
2039 - "type": "io" (json-string, fixed)
2040 - "bar": BAR number (json-int)
2041 - "address": memory address (json-int)
2042 - "size": memory size (json-int)
2044 A memory region json-object contains the following:
2046 - "type": "memory" (json-string, fixed)
2047 - "bar": BAR number (json-int)
2048 - "address": memory address (json-int)
2049 - "size": memory size (json-int)
2050 - "mem_type_64": true or false (json-bool)
2051 - "prefetch": true or false (json-bool)
2055 -> { "execute": "query-pci" }
2067 "desc":"Host bridge"
2101 "desc":"IDE controller"
2123 "desc":"VGA controller"
2133 "mem_type_64":false,
2136 "address":4026531840,
2141 "mem_type_64":false,
2144 "address":4060086272,
2149 "mem_type_64":false,
2164 "desc":"RAM controller"
2185 Note: This example has been shortened as the real response is too long.
2191 show virtual to physical memory mappings (i386 only)
2193 show the active virtual memory mappings (i386 only)
2198 show dynamic compiler info
2200 show KVM information
2202 show NUMA information
2207 show KVM information
2213 Show KVM information.
2215 Return a json-object with the following information:
2217 - "enabled": true if KVM support is enabled, false otherwise (json-bool)
2218 - "present": true if QEMU has KVM support, false otherwise (json-bool)
2222 -> { "execute": "query-kvm" }
2223 <- { "return": { "enabled": true, "present": true } }
2229 show USB devices plugged on the virtual USB hub
2231 show all USB host devices
2233 show profiling information
2235 show information about active capturing
2236 @item info snapshots
2237 show list of VM snapshots
2242 show the current VM status (running|paused)
2248 Return a json-object with the following information:
2250 - "running": true if the VM is running, or false if it is paused (json-bool)
2251 - "singlestep": true if the VM is in single step mode,
2252 false otherwise (json-bool)
2256 -> { "execute": "query-status" }
2257 <- { "return": { "running": true, "singlestep": false } }
2263 show guest PCMCIA status
2268 show which guest mouse is receiving events
2274 Show VM mice information.
2276 Each mouse is represented by a json-object, the returned value is a json-array
2279 The mouse json-object contains the following:
2281 - "name": mouse's
name (json
-string
)
2282 - "index": mouse
's index (json-int)
2283 - "current": true if this mouse is receiving events, false otherwise (json-bool)
2284 - "absolute": true if the mouse generates absolute input events (json-bool)
2288 -> { "execute": "query-mice" }
2292 "name":"QEMU Microsoft Mouse",
2298 "name":"QEMU PS/2 Mouse",
2310 show the vnc server status
2316 Show VNC server information.
2318 Return a json-object with server information. Connected clients are returned
2319 as a json-array of json-objects.
2321 The main json-object contains the following:
2323 - "enabled": true or false (json-bool)
2324 - "host": server's IP
address (json
-string
)
2325 - "family": address
family (json
-string
)
2326 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
2327 - "service": server
's port number (json-string)
2328 - "auth": authentication method (json-string)
2329 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2330 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2331 "vencrypt+plain", "vencrypt+tls+none",
2332 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2333 "vencrypt+tls+vnc", "vencrypt+x509+none",
2334 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2335 "vencrypt+x509+vnc", "vnc"
2336 - "clients": a json-array of all connected clients
2338 Clients are described by a json-object, each one contain the following:
2340 - "host": client's IP
address (json
-string
)
2341 - "family": address
family (json
-string
)
2342 - Possible values
: "ipv4", "ipv6", "unix", "unknown"
2343 - "service": client
's port number (json-string)
2344 - "x509_dname": TLS dname (json-string, optional)
2345 - "sasl_username": SASL username (json-string, optional)
2349 -> { "execute": "query-vnc" }
2371 show the current VM name
2379 Return a json-object with the following information:
2381 - "name": VM's
name (json
-string
, optional
)
2385 -> { "execute": "query-name" }
2386 <- { "return": { "name": "qemu-name" } }
2392 show the current VM UUID
2400 Return a json
-object with the following information
:
2402 - "UUID": Universally Unique
Identifier (json
-string
)
2406 -> { "execute": "query-uuid" }
2407 <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2415 show user network stack connection states
2420 show migration status
2428 Return a json
-object
. If migration is active there will be another json
-object
2429 with RAM migration status and
if block migration is active another one with
2430 block migration status
.
2432 The main json
-object contains the following
:
2434 - "status": migration
status (json
-string
)
2435 - Possible values
: "active", "completed", "failed", "cancelled"
2436 - "ram": only present
if "status" is
"active", it is a json
-object with the
2437 following RAM
information (in bytes
):
2438 - "transferred": amount
transferred (json
-int
)
2439 - "remaining": amount
remaining (json
-int
)
2440 - "total": total (json
-int
)
2441 - "disk": only present
if "status" is
"active" and it is a block migration
,
2442 it is a json
-object with the following disk
information (in bytes
):
2443 - "transferred": amount
transferred (json
-int
)
2444 - "remaining": amount
remaining (json
-int
)
2445 - "total": total (json
-int
)
2449 1. Before the first migration
2451 -> { "execute": "query-migrate" }
2454 2. Migration is done and has succeeded
2456 -> { "execute": "query-migrate" }
2457 <- { "return": { "status": "completed" } }
2459 3. Migration is done and has failed
2461 -> { "execute": "query-migrate" }
2462 <- { "return": { "status": "failed" } }
2464 4. Migration is being performed and is not a block migration
:
2466 -> { "execute": "query-migrate" }
2478 5. Migration is being performed and is a block migration
:
2480 -> { "execute": "query-migrate" }
2486 "remaining":1053304,
2491 "remaining":20880384,
2501 show balloon information
2507 Show balloon information
.
2509 Make an asynchronous request
for balloon info
. When the request completes a
2510 json
-object will be returned containing the following data
:
2512 - "actual": current balloon value
in bytes (json
-int
)
2513 - "mem_swapped_in": Amount of memory swapped
in bytes (json
-int
, optional
)
2514 - "mem_swapped_out": Amount of memory swapped out
in bytes (json
-int
, optional
)
2515 - "major_page_faults": Number of major
faults (json
-int
, optional
)
2516 - "minor_page_faults": Number of minor
faults (json
-int
, optional
)
2517 - "free_mem": Total amount of free and unused memory
in
2518 bytes (json
-int
, optional
)
2519 - "total_mem": Total amount of available memory
in bytes (json
-int
, optional
)
2523 -> { "execute": "query-balloon" }
2526 "actual":1073741824,
2528 "mem_swapped_out":0,
2529 "major_page_faults":142,
2530 "minor_page_faults":239245,
2531 "free_mem":1014185984,
2532 "total_mem":1044668416
2542 show qdev device model list
2548 #ifdef CONFIG_SIMPLE_TRACE
2551 show contents of
trace buffer
2552 @item info
trace-events
2553 show available
trace events and their state
2557 HXCOMM DO NOT add
new commands after
'info', move your addition before it
!