]> git.proxmox.com Git - mirror_qemu.git/blame - qmp-commands.hx
m25p80: fix s->blk usage before assignment
[mirror_qemu.git] / qmp-commands.hx
CommitLineData
82a56f0d 1HXCOMM QMP dispatch table and documentation
3599d46b 2HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and
82a56f0d
LC
3HXCOMM does not show up in the other formats.
4
5SQMP
6 QMP Supported Commands
7 ----------------------
8
9This document describes all commands currently supported by QMP.
10
11Most of the time their usage is exactly the same as in the user Monitor, this
12means that any other document which also describe commands (the manpage,
13QEMU's manual, etc) can and should be consulted.
14
15QMP has two types of commands: regular and query commands. Regular commands
16usually change the Virtual Machine's state someway, while query commands just
17return information. The sections below are divided accordingly.
18
19It's important to observe that all communication examples are formatted in
20a reader-friendly way, so that they're easier to understand. However, in real
21protocol usage, they're emitted as a single line.
22
23Also, the following notation is used to denote data flow:
24
25-> data issued by the Client
26<- Server data response
27
28Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29information on the Server command and response formats.
30
31NOTE: This document is temporary and will be replaced soon.
32
331. Stability Considerations
34===========================
35
36The current QMP command set (described in this file) may be useful for a
37number of use cases, however it's limited and several commands have bad
38defined semantics, specially with regard to command completion.
39
40These problems are going to be solved incrementally in the next QEMU releases
41and we're going to establish a deprecation policy for badly defined commands.
42
43If you're planning to adopt QMP, please observe the following:
44
c20cdf8b 45 1. The deprecation policy will take effect and be documented soon, please
82a56f0d
LC
46 check the documentation of each used command as soon as a new release of
47 QEMU is available
48
49 2. DO NOT rely on anything which is not explicit documented
50
51 3. Errors, in special, are not documented. Applications should NOT check
52 for specific errors classes or data (it's strongly recommended to only
53 check for the "error" key)
54
552. Regular Commands
56===================
57
58Server's responses in the examples below are always a success response, please
59refer to the QMP specification for more details on error responses.
60
61EQMP
62
63 {
64 .name = "quit",
65 .args_type = "",
7a7f325e 66 .mhandler.cmd_new = qmp_marshal_input_quit,
82a56f0d
LC
67 },
68
69SQMP
70quit
71----
72
73Quit the emulator.
74
75Arguments: None.
76
77Example:
78
79-> { "execute": "quit" }
80<- { "return": {} }
81
82EQMP
83
84 {
85 .name = "eject",
86 .args_type = "force:-f,device:B",
c245b6a3 87 .mhandler.cmd_new = qmp_marshal_input_eject,
82a56f0d
LC
88 },
89
90SQMP
91eject
92-----
93
94Eject a removable medium.
95
96Arguments:
97
98- force: force ejection (json-bool, optional)
99- device: device name (json-string)
100
101Example:
102
103-> { "execute": "eject", "arguments": { "device": "ide1-cd0" } }
104<- { "return": {} }
105
106Note: The "force" argument defaults to false.
107
108EQMP
109
110 {
111 .name = "change",
112 .args_type = "device:B,target:F,arg:s?",
333a96ec 113 .mhandler.cmd_new = qmp_marshal_input_change,
82a56f0d
LC
114 },
115
116SQMP
117change
118------
119
120Change a removable medium or VNC configuration.
121
122Arguments:
123
124- "device": device name (json-string)
125- "target": filename or item (json-string)
126- "arg": additional argument (json-string, optional)
127
128Examples:
129
1301. Change a removable medium
131
132-> { "execute": "change",
133 "arguments": { "device": "ide1-cd0",
134 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
135<- { "return": {} }
136
1372. Change VNC password
138
139-> { "execute": "change",
140 "arguments": { "device": "vnc", "target": "password",
141 "arg": "foobar1" } }
142<- { "return": {} }
143
144EQMP
145
146 {
147 .name = "screendump",
148 .args_type = "filename:F",
ad39cf6d 149 .mhandler.cmd_new = qmp_marshal_input_screendump,
82a56f0d
LC
150 },
151
152SQMP
153screendump
154----------
155
156Save screen into PPM image.
157
158Arguments:
159
160- "filename": file path (json-string)
161
162Example:
163
164-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
165<- { "return": {} }
166
167EQMP
168
169 {
170 .name = "stop",
171 .args_type = "",
5f158f21 172 .mhandler.cmd_new = qmp_marshal_input_stop,
82a56f0d
LC
173 },
174
175SQMP
176stop
177----
178
179Stop the emulator.
180
181Arguments: None.
182
183Example:
184
185-> { "execute": "stop" }
186<- { "return": {} }
187
188EQMP
189
190 {
191 .name = "cont",
192 .args_type = "",
e42e818b 193 .mhandler.cmd_new = qmp_marshal_input_cont,
82a56f0d
LC
194 },
195
196SQMP
197cont
198----
199
200Resume emulation.
201
202Arguments: None.
203
204Example:
205
206-> { "execute": "cont" }
207<- { "return": {} }
9b9df25a
GH
208
209EQMP
210
211 {
212 .name = "system_wakeup",
213 .args_type = "",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
215 },
216
217SQMP
218system_wakeup
219-------------
220
221Wakeup guest from suspend.
222
223Arguments: None.
224
225Example:
226
227-> { "execute": "system_wakeup" }
228<- { "return": {} }
82a56f0d
LC
229
230EQMP
231
232 {
233 .name = "system_reset",
234 .args_type = "",
38d22653 235 .mhandler.cmd_new = qmp_marshal_input_system_reset,
82a56f0d
LC
236 },
237
238SQMP
239system_reset
240------------
241
242Reset the system.
243
244Arguments: None.
245
246Example:
247
248-> { "execute": "system_reset" }
249<- { "return": {} }
250
251EQMP
252
253 {
254 .name = "system_powerdown",
255 .args_type = "",
22e1bb9c 256 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
82a56f0d
LC
257 },
258
259SQMP
260system_powerdown
261----------------
262
263Send system power down event.
264
265Arguments: None.
266
267Example:
268
269-> { "execute": "system_powerdown" }
270<- { "return": {} }
271
272EQMP
273
274 {
275 .name = "device_add",
276 .args_type = "device:O",
277 .params = "driver[,prop=value][,...]",
278 .help = "add device, like -device on the command line",
82a56f0d
LC
279 .mhandler.cmd_new = do_device_add,
280 },
281
282SQMP
283device_add
284----------
285
286Add a device.
287
288Arguments:
289
290- "driver": the name of the new device's driver (json-string)
291- "bus": the device's parent bus (device tree path, json-string, optional)
292- "id": the device's ID, must be unique (json-string)
293- device properties
294
295Example:
296
297-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
298<- { "return": {} }
299
300Notes:
301
302(1) For detailed information about this command, please refer to the
303 'docs/qdev-device-use.txt' file.
304
305(2) It's possible to list device properties by running QEMU with the
306 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
307
308EQMP
309
310 {
311 .name = "device_del",
312 .args_type = "id:s",
a15fef21 313 .mhandler.cmd_new = qmp_marshal_input_device_del,
82a56f0d
LC
314 },
315
316SQMP
317device_del
318----------
319
320Remove a device.
321
322Arguments:
323
324- "id": the device's ID (json-string)
325
326Example:
327
328-> { "execute": "device_del", "arguments": { "id": "net1" } }
329<- { "return": {} }
330
e4c8f004
AK
331EQMP
332
333 {
334 .name = "send-key",
43d0a2c1 335 .args_type = "keys:q,hold-time:i?",
e4c8f004
AK
336 .mhandler.cmd_new = qmp_marshal_input_send_key,
337 },
338
339SQMP
340send-key
341----------
342
343Send keys to VM.
344
345Arguments:
346
347keys array:
f9b1d9b2
AK
348 - "key": key sequence (a json-array of key union values,
349 union can be number or qcode enum)
e4c8f004
AK
350
351- hold-time: time to delay key up events, milliseconds. Defaults to 100
352 (json-int, optional)
353
354Example:
355
356-> { "execute": "send-key",
f9b1d9b2
AK
357 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
358 { "type": "qcode", "data": "alt" },
359 { "type": "qcode", "data": "delete" } ] } }
e4c8f004
AK
360<- { "return": {} }
361
82a56f0d
LC
362EQMP
363
364 {
365 .name = "cpu",
366 .args_type = "index:i",
755f1968 367 .mhandler.cmd_new = qmp_marshal_input_cpu,
82a56f0d
LC
368 },
369
370SQMP
371cpu
372---
373
374Set the default CPU.
375
376Arguments:
377
378- "index": the CPU's index (json-int)
379
380Example:
381
382-> { "execute": "cpu", "arguments": { "index": 0 } }
383<- { "return": {} }
384
385Note: CPUs' indexes are obtained with the 'query-cpus' command.
386
69ca3ea5
IM
387EQMP
388
389 {
390 .name = "cpu-add",
391 .args_type = "id:i",
392 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
393 },
394
395SQMP
396cpu-add
397-------
398
399Adds virtual cpu
400
401Arguments:
402
403- "id": cpu id (json-int)
404
405Example:
406
407-> { "execute": "cpu-add", "arguments": { "id": 2 } }
408<- { "return": {} }
409
82a56f0d
LC
410EQMP
411
412 {
413 .name = "memsave",
0cfd6a9a
LC
414 .args_type = "val:l,size:i,filename:s,cpu:i?",
415 .mhandler.cmd_new = qmp_marshal_input_memsave,
82a56f0d
LC
416 },
417
418SQMP
419memsave
420-------
421
422Save to disk virtual memory dump starting at 'val' of size 'size'.
423
424Arguments:
425
426- "val": the starting address (json-int)
427- "size": the memory size, in bytes (json-int)
428- "filename": file path (json-string)
0cfd6a9a 429- "cpu": virtual CPU index (json-int, optional)
82a56f0d
LC
430
431Example:
432
433-> { "execute": "memsave",
434 "arguments": { "val": 10,
435 "size": 100,
436 "filename": "/tmp/virtual-mem-dump" } }
437<- { "return": {} }
438
82a56f0d
LC
439EQMP
440
441 {
442 .name = "pmemsave",
443 .args_type = "val:l,size:i,filename:s",
6d3962bf 444 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
82a56f0d
LC
445 },
446
447SQMP
448pmemsave
449--------
450
451Save to disk physical memory dump starting at 'val' of size 'size'.
452
453Arguments:
454
455- "val": the starting address (json-int)
456- "size": the memory size, in bytes (json-int)
457- "filename": file path (json-string)
458
459Example:
460
461-> { "execute": "pmemsave",
462 "arguments": { "val": 10,
463 "size": 100,
464 "filename": "/tmp/physical-mem-dump" } }
465<- { "return": {} }
466
a4046664
LJ
467EQMP
468
469 {
470 .name = "inject-nmi",
471 .args_type = "",
ab49ab5c 472 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
a4046664
LJ
473 },
474
475SQMP
476inject-nmi
477----------
478
9cb805fd 479Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
a4046664
LJ
480
481Arguments: None.
482
483Example:
484
485-> { "execute": "inject-nmi" }
486<- { "return": {} }
487
de253f14 488Note: inject-nmi fails when the guest doesn't support injecting.
a4046664 489
1f590cf9
LL
490EQMP
491
492 {
3949e594 493 .name = "ringbuf-write",
82e59a67 494 .args_type = "device:s,data:s,format:s?",
3949e594 495 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
1f590cf9
LL
496 },
497
498SQMP
3949e594 499ringbuf-write
1f590cf9
LL
500-------------
501
3949e594 502Write to a ring buffer character device.
1f590cf9
LL
503
504Arguments:
505
3949e594
MA
506- "device": ring buffer character device name (json-string)
507- "data": data to write (json-string)
508- "format": data format (json-string, optional)
509 - Possible values: "utf8" (default), "base64"
510 Bug: invalid base64 is currently not rejected.
511 Whitespace *is* invalid.
1f590cf9
LL
512
513Example:
514
3949e594
MA
515-> { "execute": "ringbuf-write",
516 "arguments": { "device": "foo",
1f590cf9
LL
517 "data": "abcdefgh",
518 "format": "utf8" } }
519<- { "return": {} }
520
49b6d722
LL
521EQMP
522
523 {
3949e594 524 .name = "ringbuf-read",
49b6d722 525 .args_type = "device:s,size:i,format:s?",
3949e594 526 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
49b6d722
LL
527 },
528
529SQMP
3949e594 530ringbuf-read
49b6d722
LL
531-------------
532
3949e594 533Read from a ring buffer character device.
49b6d722
LL
534
535Arguments:
536
3949e594
MA
537- "device": ring buffer character device name (json-string)
538- "size": how many bytes to read at most (json-int)
539 - Number of data bytes, not number of characters in encoded data
540- "format": data format (json-string, optional)
541 - Possible values: "utf8" (default), "base64"
542 - Naturally, format "utf8" works only when the ring buffer
543 contains valid UTF-8 text. Invalid UTF-8 sequences get
544 replaced. Bug: replacement doesn't work. Bug: can screw
545 up on encountering NUL characters, after the ring buffer
546 lost data, and when reading stops because the size limit
547 is reached.
49b6d722
LL
548
549Example:
550
3949e594
MA
551-> { "execute": "ringbuf-read",
552 "arguments": { "device": "foo",
49b6d722
LL
553 "size": 1000,
554 "format": "utf8" } }
3ab651fc 555<- {"return": "abcdefgh"}
49b6d722 556
a7ae8355
SS
557EQMP
558
559 {
560 .name = "xen-save-devices-state",
561 .args_type = "filename:F",
562 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
563 },
564
565SQMP
566xen-save-devices-state
567-------
568
569Save the state of all devices to file. The RAM and the block devices
570of the VM are not saved by this command.
571
572Arguments:
573
574- "filename": the file to save the state of the devices to as binary
575data. See xen-save-devices-state.txt for a description of the binary
576format.
577
578Example:
579
580-> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
582<- { "return": {} }
583
39f42439
AP
584EQMP
585
586 {
587 .name = "xen-set-global-dirty-log",
588 .args_type = "enable:b",
589 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
590 },
591
592SQMP
593xen-set-global-dirty-log
594-------
595
596Enable or disable the global dirty log mode.
597
598Arguments:
599
600- "enable": Enable it or disable it.
601
602Example:
603
604-> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
606<- { "return": {} }
607
82a56f0d
LC
608EQMP
609
610 {
611 .name = "migrate",
612 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
e1c37d0e 613 .mhandler.cmd_new = qmp_marshal_input_migrate,
82a56f0d
LC
614 },
615
616SQMP
617migrate
618-------
619
620Migrate to URI.
621
622Arguments:
623
624- "blk": block migration, full disk copy (json-bool, optional)
625- "inc": incremental disk copy (json-bool, optional)
626- "uri": Destination URI (json-string)
627
628Example:
629
630-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
631<- { "return": {} }
632
633Notes:
634
635(1) The 'query-migrate' command should be used to check migration's progress
636 and final result (this information is provided by the 'status' member)
637(2) All boolean arguments default to false
638(3) The user Monitor's "detach" argument is invalid in QMP and should not
639 be used
640
641EQMP
642
643 {
644 .name = "migrate_cancel",
645 .args_type = "",
6cdedb07 646 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
82a56f0d
LC
647 },
648
649SQMP
650migrate_cancel
651--------------
652
653Cancel the current migration.
654
655Arguments: None.
656
657Example:
658
659-> { "execute": "migrate_cancel" }
660<- { "return": {} }
661
9e1ba4cc 662EQMP
bf1ae1f4
DDAG
663
664 {
665 .name = "migrate-incoming",
666 .args_type = "uri:s",
667 .mhandler.cmd_new = qmp_marshal_input_migrate_incoming,
668 },
669
670SQMP
671migrate-incoming
672----------------
673
674Continue an incoming migration
675
676Arguments:
677
678- "uri": Source/listening URI (json-string)
679
680Example:
681
682-> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
683<- { "return": {} }
684
685Notes:
686
687(1) QEMU must be started with -incoming defer to allow migrate-incoming to
688 be used
689(2) The uri format is the same as to -incoming
690
691EQMP
692 {
9e1ba4cc
OW
693 .name = "migrate-set-cache-size",
694 .args_type = "value:o",
695 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
696 },
697
698SQMP
699migrate-set-cache-size
817c6045 700----------------------
9e1ba4cc
OW
701
702Set cache size to be used by XBZRLE migration, the cache size will be rounded
703down to the nearest power of 2
704
705Arguments:
706
707- "value": cache size in bytes (json-int)
708
709Example:
710
711-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
712<- { "return": {} }
713
714EQMP
715 {
716 .name = "query-migrate-cache-size",
717 .args_type = "",
718 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
719 },
720
721SQMP
722query-migrate-cache-size
817c6045 723------------------------
9e1ba4cc
OW
724
725Show cache size to be used by XBZRLE migration
726
727returns a json-object with the following information:
728- "size" : json-int
729
730Example:
731
732-> { "execute": "query-migrate-cache-size" }
733<- { "return": 67108864 }
734
82a56f0d
LC
735EQMP
736
737 {
738 .name = "migrate_set_speed",
3a019b6e 739 .args_type = "value:o",
3dc85383 740 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
82a56f0d
LC
741 },
742
e866e239 743SQMP
ff73edf5
JS
744migrate_set_speed
745-----------------
e866e239 746
ff73edf5 747Set maximum speed for migrations.
e866e239
GH
748
749Arguments:
750
ff73edf5 751- "value": maximum speed, in bytes per second (json-int)
e866e239
GH
752
753Example:
754
ff73edf5 755-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
e866e239
GH
756<- { "return": {} }
757
758EQMP
759
760 {
ff73edf5
JS
761 .name = "migrate_set_downtime",
762 .args_type = "value:T",
4f0a993b 763 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
e866e239
GH
764 },
765
82a56f0d 766SQMP
ff73edf5
JS
767migrate_set_downtime
768--------------------
82a56f0d 769
ff73edf5 770Set maximum tolerated downtime (in seconds) for migrations.
82a56f0d
LC
771
772Arguments:
773
ff73edf5 774- "value": maximum downtime (json-number)
82a56f0d
LC
775
776Example:
777
ff73edf5 778-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
82a56f0d
LC
779<- { "return": {} }
780
781EQMP
782
783 {
ff73edf5
JS
784 .name = "client_migrate_info",
785 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
786 .params = "protocol hostname port tls-port cert-subject",
787 .help = "send migration info to spice/vnc client",
3b5704b2 788 .mhandler.cmd_new = client_migrate_info,
82a56f0d
LC
789 },
790
791SQMP
ff73edf5
JS
792client_migrate_info
793------------------
82a56f0d 794
ff73edf5
JS
795Set the spice/vnc connection info for the migration target. The spice/vnc
796server will ask the spice/vnc client to automatically reconnect using the
797new parameters (if specified) once the vm migration finished successfully.
82a56f0d
LC
798
799Arguments:
800
ff73edf5
JS
801- "protocol": protocol: "spice" or "vnc" (json-string)
802- "hostname": migration target hostname (json-string)
803- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
804- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
805- "cert-subject": server certificate subject (json-string, optional)
82a56f0d
LC
806
807Example:
808
ff73edf5
JS
809-> { "execute": "client_migrate_info",
810 "arguments": { "protocol": "spice",
811 "hostname": "virt42.lab.kraxel.org",
812 "port": 1234 } }
82a56f0d
LC
813<- { "return": {} }
814
783e9b48
WC
815EQMP
816
817 {
818 .name = "dump-guest-memory",
b53ccc30
QN
819 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
820 .params = "-p protocol [begin] [length] [format]",
783e9b48 821 .help = "dump guest memory to file",
783e9b48
WC
822 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
823 },
824
825SQMP
826dump
827
828
829Dump guest memory to file. The file can be processed with crash or gdb.
830
831Arguments:
832
833- "paging": do paging to get guest's memory mapping (json-bool)
834- "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836- "begin": the starting physical address. It's optional, and should be specified
837 with length together (json-int)
838- "length": the memory size, in bytes. It's optional, and should be specified
839 with begin together (json-int)
b53ccc30
QN
840- "format": the format of guest memory dump. It's optional, and can be
841 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
842 conflict with paging and filter, ie. begin and length (json-string)
783e9b48
WC
843
844Example:
845
846-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
847<- { "return": {} }
848
849Notes:
850
851(1) All boolean arguments default to false
852
7d6dc7f3
QN
853EQMP
854
855 {
856 .name = "query-dump-guest-memory-capability",
857 .args_type = "",
858 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
859 },
860
861SQMP
862query-dump-guest-memory-capability
863----------
864
865Show available formats for 'dump-guest-memory'
866
867Example:
868
869-> { "execute": "query-dump-guest-memory-capability" }
870<- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
872
82a56f0d
LC
873EQMP
874
875 {
876 .name = "netdev_add",
877 .args_type = "netdev:O",
928059a3 878 .mhandler.cmd_new = qmp_netdev_add,
82a56f0d
LC
879 },
880
881SQMP
882netdev_add
883----------
884
885Add host network device.
886
887Arguments:
888
889- "type": the device type, "tap", "user", ... (json-string)
890- "id": the device's ID, must be unique (json-string)
891- device options
892
893Example:
894
895-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
896<- { "return": {} }
897
af347aa5 898Note: The supported device options are the same ones supported by the '-netdev'
82a56f0d
LC
899 command-line argument, which are listed in the '-help' output or QEMU's
900 manual
901
902EQMP
903
904 {
905 .name = "netdev_del",
906 .args_type = "id:s",
5f964155 907 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
82a56f0d
LC
908 },
909
910SQMP
911netdev_del
912----------
913
914Remove host network device.
915
916Arguments:
917
918- "id": the device's ID, must be unique (json-string)
919
920Example:
921
922-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
923<- { "return": {} }
924
6d4a2b3a 925
cff8b2c6
PB
926EQMP
927
928 {
929 .name = "object-add",
930 .args_type = "qom-type:s,id:s,props:q?",
931 .mhandler.cmd_new = qmp_object_add,
932 },
933
934SQMP
935object-add
936----------
937
938Create QOM object.
939
940Arguments:
941
942- "qom-type": the object's QOM type, i.e. the class name (json-string)
943- "id": the object's ID, must be unique (json-string)
944- "props": a dictionary of object property values (optional, json-dict)
945
946Example:
947
948-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
949 "props": { "filename": "/dev/hwrng" } } }
950<- { "return": {} }
951
6d4a2b3a
CH
952EQMP
953
ab2d0531
PB
954 {
955 .name = "object-del",
956 .args_type = "id:s",
957 .mhandler.cmd_new = qmp_marshal_input_object_del,
958 },
959
960SQMP
961object-del
962----------
963
964Remove QOM object.
965
966Arguments:
967
968- "id": the object's ID (json-string)
969
970Example:
971
972-> { "execute": "object-del", "arguments": { "id": "rng1" } }
973<- { "return": {} }
974
975
976EQMP
977
978
6d4a2b3a
CH
979 {
980 .name = "block_resize",
3b1dbd11 981 .args_type = "device:s?,node-name:s?,size:o",
5e7caacb 982 .mhandler.cmd_new = qmp_marshal_input_block_resize,
6d4a2b3a
CH
983 },
984
985SQMP
986block_resize
987------------
988
989Resize a block image while a guest is running.
990
991Arguments:
992
993- "device": the device's ID, must be unique (json-string)
3b1dbd11 994- "node-name": the node name in the block driver state graph (json-string)
6d4a2b3a
CH
995- "size": new size
996
997Example:
998
999-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1000<- { "return": {} }
1001
d967b2f1
JS
1002EQMP
1003
12bd451f 1004 {
db58f9c0 1005 .name = "block-stream",
13d8cc51 1006 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
12bd451f
SH
1007 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1008 },
1009
ed61fc10
JC
1010 {
1011 .name = "block-commit",
54e26900 1012 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
ed61fc10
JC
1013 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1014 },
1015
37222900
JC
1016SQMP
1017block-commit
1018------------
1019
1020Live commit of data from overlay image nodes into backing nodes - i.e., writes
1021data between 'top' and 'base' into 'base'.
1022
1023Arguments:
1024
1025- "device": The device's ID, must be unique (json-string)
1026- "base": The file name of the backing image to write data into.
1027 If not specified, this is the deepest backing image
1028 (json-string, optional)
1029- "top": The file name of the backing image within the image chain,
7676e2c5
JC
1030 which contains the topmost data to be committed down. If
1031 not specified, this is the active layer. (json-string, optional)
37222900 1032
54e26900
JC
1033- backing-file: The backing file string to write into the overlay
1034 image of 'top'. If 'top' is the active layer,
1035 specifying a backing file string is an error. This
1036 filename is not validated.
1037
1038 If a pathname string is such that it cannot be
1039 resolved by QEMU, that means that subsequent QMP or
1040 HMP commands must use node-names for the image in
1041 question, as filename lookup methods will fail.
1042
1043 If not specified, QEMU will automatically determine
1044 the backing file string to use, or error out if
1045 there is no obvious choice. Care should be taken
1046 when specifying the string, to specify a valid
1047 filename or protocol.
1048 (json-string, optional) (Since 2.1)
1049
37222900
JC
1050 If top == base, that is an error.
1051 If top == active, the job will not be completed by itself,
1052 user needs to complete the job with the block-job-complete
1053 command after getting the ready event. (Since 2.0)
1054
1055 If the base image is smaller than top, then the base image
1056 will be resized to be the same size as top. If top is
1057 smaller than the base image, the base will not be
1058 truncated. If you want the base image size to match the
1059 size of the smaller top, you can safely truncate it
1060 yourself once the commit operation successfully completes.
1061 (json-string)
1062- "speed": the maximum speed, in bytes per second (json-int, optional)
1063
1064
1065Example:
1066
1067-> { "execute": "block-commit", "arguments": { "device": "virtio0",
1068 "top": "/tmp/snap1.qcow2" } }
1069<- { "return": {} }
1070
1071EQMP
1072
99a9addf
SH
1073 {
1074 .name = "drive-backup",
b53169ea 1075 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
99a9addf
SH
1076 "on-source-error:s?,on-target-error:s?",
1077 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1078 },
1079
1080SQMP
1081drive-backup
1082------------
1083
1084Start a point-in-time copy of a block device to a new destination. The
1085status of ongoing drive-backup operations can be checked with
1086query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1087The operation can be stopped before it has completed using the
1088block-job-cancel command.
1089
1090Arguments:
1091
1092- "device": the name of the device which should be copied.
1093 (json-string)
1094- "target": the target of the new image. If the file exists, or if it is a
1095 device, the existing file/device will be used as the new
1096 destination. If it does not exist, a new file will be created.
1097 (json-string)
1098- "format": the format of the new destination, default is to probe if 'mode' is
1099 'existing', else the format of the source
1100 (json-string, optional)
b53169ea
SH
1101- "sync": what parts of the disk image should be copied to the destination;
1102 possibilities include "full" for all the disk, "top" for only the sectors
1103 allocated in the topmost image, or "none" to only replicate new I/O
1104 (MirrorSyncMode).
99a9addf
SH
1105- "mode": whether and how QEMU should create a new image
1106 (NewImageMode, optional, default 'absolute-paths')
1107- "speed": the maximum speed, in bytes per second (json-int, optional)
1108- "on-source-error": the action to take on an error on the source, default
1109 'report'. 'stop' and 'enospc' can only be used
1110 if the block device supports io-status.
1111 (BlockdevOnError, optional)
1112- "on-target-error": the action to take on an error on the target, default
1113 'report' (no limitations, since this applies to
1114 a different block device than device).
1115 (BlockdevOnError, optional)
1116
1117Example:
1118-> { "execute": "drive-backup", "arguments": { "device": "drive0",
fc5d3f84 1119 "sync": "full",
99a9addf
SH
1120 "target": "backup.img" } }
1121<- { "return": {} }
c29c1dd3
FZ
1122
1123EQMP
1124
1125 {
1126 .name = "blockdev-backup",
1127 .args_type = "sync:s,device:B,target:B,speed:i?,"
1128 "on-source-error:s?,on-target-error:s?",
1129 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1130 },
1131
1132SQMP
1133blockdev-backup
1134---------------
1135
1136The device version of drive-backup: this command takes an existing named device
1137as backup target.
1138
1139Arguments:
1140
1141- "device": the name of the device which should be copied.
1142 (json-string)
1143- "target": the name of the backup target device. (json-string)
1144- "sync": what parts of the disk image should be copied to the destination;
1145 possibilities include "full" for all the disk, "top" for only the
1146 sectors allocated in the topmost image, or "none" to only replicate
1147 new I/O (MirrorSyncMode).
1148- "speed": the maximum speed, in bytes per second (json-int, optional)
1149- "on-source-error": the action to take on an error on the source, default
1150 'report'. 'stop' and 'enospc' can only be used
1151 if the block device supports io-status.
1152 (BlockdevOnError, optional)
1153- "on-target-error": the action to take on an error on the target, default
1154 'report' (no limitations, since this applies to
1155 a different block device than device).
1156 (BlockdevOnError, optional)
1157
1158Example:
1159-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1160 "sync": "full",
1161 "target": "tgt-id" } }
1162<- { "return": {} }
1163
99a9addf
SH
1164EQMP
1165
2d47c6e9 1166 {
db58f9c0 1167 .name = "block-job-set-speed",
882ec7ce 1168 .args_type = "device:B,speed:o",
2d47c6e9
SH
1169 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1170 },
1171
370521a1 1172 {
db58f9c0 1173 .name = "block-job-cancel",
6e37fb81 1174 .args_type = "device:B,force:b?",
370521a1
SH
1175 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1176 },
6e37fb81
PB
1177 {
1178 .name = "block-job-pause",
1179 .args_type = "device:B",
1180 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1181 },
1182 {
1183 .name = "block-job-resume",
1184 .args_type = "device:B",
1185 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1186 },
aeae883b
PB
1187 {
1188 .name = "block-job-complete",
1189 .args_type = "device:B",
1190 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1191 },
c186402c 1192 {
52e7c241 1193 .name = "transaction",
b9f8978c 1194 .args_type = "actions:q",
52e7c241 1195 .mhandler.cmd_new = qmp_marshal_input_transaction,
c186402c
JC
1196 },
1197
1198SQMP
52e7c241
PB
1199transaction
1200-----------
c186402c 1201
bbe86010
WX
1202Atomically operate on one or more block devices. The only supported operations
1203for now are drive-backup, internal and external snapshotting. A list of
1204dictionaries is accepted, that contains the actions to be performed.
1205If there is any failure performing any of the operations, all operations
1206for the group are abandoned.
c186402c 1207
bbe86010
WX
1208For external snapshots, the dictionary contains the device, the file to use for
1209the new snapshot, and the format. The default format, if not specified, is
1210qcow2.
c186402c 1211
bc8b094f
PB
1212Each new snapshot defaults to being created by QEMU (wiping any
1213contents if the file already exists), but it is also possible to reuse
1214an externally-created file. In the latter case, you should ensure that
1215the new image file has the same contents as the current one; QEMU cannot
1216perform any meaningful check. Typically this is achieved by using the
1217current image file as the backing file for the new image.
1218
bbe86010
WX
1219On failure, the original disks pre-snapshot attempt will be used.
1220
1221For internal snapshots, the dictionary contains the device and the snapshot's
1222name. If an internal snapshot matching name already exists, the request will
1223be rejected. Only some image formats support it, for example, qcow2, rbd,
1224and sheepdog.
1225
1226On failure, qemu will try delete the newly created internal snapshot in the
1227transaction. When an I/O error occurs during deletion, the user needs to fix
1228it later with qemu-img or other command.
1229
c186402c
JC
1230Arguments:
1231
52e7c241
PB
1232actions array:
1233 - "type": the operation to perform. The only supported
1234 value is "blockdev-snapshot-sync". (json-string)
1235 - "data": a dictionary. The contents depend on the value
1236 of "type". When "type" is "blockdev-snapshot-sync":
1237 - "device": device name to snapshot (json-string)
0901f67e 1238 - "node-name": graph node name to snapshot (json-string)
52e7c241 1239 - "snapshot-file": name of new image file (json-string)
0901f67e 1240 - "snapshot-node-name": graph node name of the new snapshot (json-string)
52e7c241 1241 - "format": format of new image (json-string, optional)
bc8b094f
PB
1242 - "mode": whether and how QEMU should create the snapshot file
1243 (NewImageMode, optional, default "absolute-paths")
bbe86010
WX
1244 When "type" is "blockdev-snapshot-internal-sync":
1245 - "device": device name to snapshot (json-string)
1246 - "name": name of the new snapshot (json-string)
c186402c
JC
1247
1248Example:
1249
52e7c241
PB
1250-> { "execute": "transaction",
1251 "arguments": { "actions": [
cd0c5389 1252 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
52e7c241
PB
1253 "snapshot-file": "/some/place/my-image",
1254 "format": "qcow2" } },
cd0c5389 1255 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
0901f67e
BC
1256 "snapshot-file": "/some/place/my-image2",
1257 "snapshot-node-name": "node3432",
1258 "mode": "existing",
1259 "format": "qcow2" } },
cd0c5389 1260 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
52e7c241 1261 "snapshot-file": "/some/place/my-image2",
bc8b094f 1262 "mode": "existing",
bbe86010 1263 "format": "qcow2" } },
cd0c5389 1264 { "type": "blockdev-snapshot-internal-sync", "data" : {
bbe86010
WX
1265 "device": "ide-hd2",
1266 "name": "snapshot0" } } ] } }
c186402c
JC
1267<- { "return": {} }
1268
1269EQMP
370521a1 1270
d967b2f1
JS
1271 {
1272 .name = "blockdev-snapshot-sync",
0901f67e 1273 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
6106e249 1274 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
d967b2f1
JS
1275 },
1276
1277SQMP
1278blockdev-snapshot-sync
1279----------------------
1280
1281Synchronous snapshot of a block device. snapshot-file specifies the
1282target of the new image. If the file exists, or if it is a device, the
1283snapshot will be created in the existing file/device. If does not
1284exist, a new file will be created. format specifies the format of the
1285snapshot image, default is qcow2.
1286
1287Arguments:
1288
1289- "device": device name to snapshot (json-string)
0901f67e 1290- "node-name": graph node name to snapshot (json-string)
d967b2f1 1291- "snapshot-file": name of new image file (json-string)
0901f67e 1292- "snapshot-node-name": graph node name of the new snapshot (json-string)
6cc2a415
PB
1293- "mode": whether and how QEMU should create the snapshot file
1294 (NewImageMode, optional, default "absolute-paths")
d967b2f1
JS
1295- "format": format of new image (json-string, optional)
1296
1297Example:
1298
7f3850c2
LC
1299-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1300 "snapshot-file":
1301 "/some/place/my-image",
1302 "format": "qcow2" } }
d967b2f1
JS
1303<- { "return": {} }
1304
f323bc9e
WX
1305EQMP
1306
1307 {
1308 .name = "blockdev-snapshot-internal-sync",
1309 .args_type = "device:B,name:s",
1310 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1311 },
1312
1313SQMP
1314blockdev-snapshot-internal-sync
1315-------------------------------
1316
1317Synchronously take an internal snapshot of a block device when the format of
1318image used supports it. If the name is an empty string, or a snapshot with
1319name already exists, the operation will fail.
1320
1321Arguments:
1322
1323- "device": device name to snapshot (json-string)
1324- "name": name of the new snapshot (json-string)
1325
1326Example:
1327
1328-> { "execute": "blockdev-snapshot-internal-sync",
1329 "arguments": { "device": "ide-hd0",
1330 "name": "snapshot0" }
1331 }
1332<- { "return": {} }
1333
44e3e053
WX
1334EQMP
1335
1336 {
1337 .name = "blockdev-snapshot-delete-internal-sync",
1338 .args_type = "device:B,id:s?,name:s?",
1339 .mhandler.cmd_new =
1340 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1341 },
1342
1343SQMP
1344blockdev-snapshot-delete-internal-sync
1345--------------------------------------
1346
1347Synchronously delete an internal snapshot of a block device when the format of
1348image used supports it. The snapshot is identified by name or id or both. One
1349of name or id is required. If the snapshot is not found, the operation will
1350fail.
1351
1352Arguments:
1353
1354- "device": device name (json-string)
1355- "id": ID of the snapshot (json-string, optional)
1356- "name": name of the snapshot (json-string, optional)
1357
1358Example:
1359
1360-> { "execute": "blockdev-snapshot-delete-internal-sync",
1361 "arguments": { "device": "ide-hd0",
1362 "name": "snapshot0" }
1363 }
1364<- { "return": {
1365 "id": "1",
1366 "name": "snapshot0",
1367 "vm-state-size": 0,
1368 "date-sec": 1000012,
1369 "date-nsec": 10,
1370 "vm-clock-sec": 100,
1371 "vm-clock-nsec": 20
1372 }
1373 }
1374
d9b902db
PB
1375EQMP
1376
1377 {
1378 .name = "drive-mirror",
b952b558 1379 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
09158f00 1380 "node-name:s?,replaces:s?,"
eee13dfe 1381 "on-source-error:s?,on-target-error:s?,"
08e4ed6c 1382 "granularity:i?,buf-size:i?",
d9b902db
PB
1383 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1384 },
1385
1386SQMP
1387drive-mirror
1388------------
1389
1390Start mirroring a block device's writes to a new destination. target
1391specifies the target of the new image. If the file exists, or if it is
1392a device, it will be used as the new destination for writes. If it does not
1393exist, a new file will be created. format specifies the format of the
1394mirror image, default is to probe if mode='existing', else the format
1395of the source.
1396
1397Arguments:
1398
1399- "device": device name to operate on (json-string)
1400- "target": name of new image file (json-string)
1401- "format": format of new image (json-string, optional)
4c828dc6
BC
1402- "node-name": the name of the new block driver state in the node graph
1403 (json-string, optional)
09158f00
BC
1404- "replaces": the block driver node name to replace when finished
1405 (json-string, optional)
d9b902db
PB
1406- "mode": how an image file should be created into the target
1407 file/device (NewImageMode, optional, default 'absolute-paths')
1408- "speed": maximum speed of the streaming job, in bytes per second
1409 (json-int)
eee13dfe 1410- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
08e4ed6c
PB
1411- "buf_size": maximum amount of data in flight from source to target, in bytes
1412 (json-int, default 10M)
d9b902db
PB
1413- "sync": what parts of the disk image should be copied to the destination;
1414 possibilities include "full" for all the disk, "top" for only the sectors
1415 allocated in the topmost image, or "none" to only replicate new I/O
1416 (MirrorSyncMode).
b952b558
PB
1417- "on-source-error": the action to take on an error on the source
1418 (BlockdevOnError, default 'report')
1419- "on-target-error": the action to take on an error on the target
1420 (BlockdevOnError, default 'report')
1421
eee13dfe
PB
1422The default value of the granularity is the image cluster size clamped
1423between 4096 and 65536, if the image format defines one. If the format
1424does not define a cluster size, the default value of the granularity
1425is 65536.
d9b902db
PB
1426
1427
1428Example:
1429
1430-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1431 "target": "/some/place/my-image",
1432 "sync": "full",
1433 "format": "qcow2" } }
1434<- { "return": {} }
1435
fa40e656
JC
1436EQMP
1437
1438 {
1439 .name = "change-backing-file",
1440 .args_type = "device:s,image-node-name:s,backing-file:s",
1441 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1442 },
1443
1444SQMP
1445change-backing-file
1446-------------------
1447Since: 2.1
1448
1449Change the backing file in the image file metadata. This does not cause
1450QEMU to reopen the image file to reparse the backing filename (it may,
1451however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1452if needed). The new backing file string is written into the image file
1453metadata, and the QEMU internal strings are updated.
1454
1455Arguments:
1456
1457- "image-node-name": The name of the block driver state node of the
1458 image to modify. The "device" is argument is used to
1459 verify "image-node-name" is in the chain described by
1460 "device".
1461 (json-string, optional)
1462
1463- "device": The name of the device.
1464 (json-string)
1465
1466- "backing-file": The string to write as the backing file. This string is
1467 not validated, so care should be taken when specifying
1468 the string or the image chain may not be able to be
1469 reopened again.
1470 (json-string)
1471
1472Returns: Nothing on success
1473 If "device" does not exist or cannot be determined, DeviceNotFound
1474
82a56f0d
LC
1475EQMP
1476
1477 {
1478 .name = "balloon",
1479 .args_type = "value:M",
d72f3264 1480 .mhandler.cmd_new = qmp_marshal_input_balloon,
82a56f0d
LC
1481 },
1482
1483SQMP
1484balloon
1485-------
1486
1487Request VM to change its memory allocation (in bytes).
1488
1489Arguments:
1490
1491- "value": New memory allocation (json-int)
1492
1493Example:
1494
1495-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1496<- { "return": {} }
1497
1498EQMP
1499
1500 {
1501 .name = "set_link",
1502 .args_type = "name:s,up:b",
4b37156c 1503 .mhandler.cmd_new = qmp_marshal_input_set_link,
82a56f0d
LC
1504 },
1505
1506SQMP
1507set_link
1508--------
1509
1510Change the link status of a network adapter.
1511
1512Arguments:
1513
1514- "name": network device name (json-string)
1515- "up": status is up (json-bool)
1516
1517Example:
1518
1519-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1520<- { "return": {} }
1521
1522EQMP
1523
1524 {
1525 .name = "getfd",
1526 .args_type = "fdname:s",
1527 .params = "getfd name",
1528 .help = "receive a file descriptor via SCM rights and assign it a name",
208c9d1b 1529 .mhandler.cmd_new = qmp_marshal_input_getfd,
82a56f0d
LC
1530 },
1531
1532SQMP
1533getfd
1534-----
1535
1536Receive a file descriptor via SCM rights and assign it a name.
1537
1538Arguments:
1539
1540- "fdname": file descriptor name (json-string)
1541
1542Example:
1543
1544-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1545<- { "return": {} }
1546
208c9d1b
CB
1547Notes:
1548
1549(1) If the name specified by the "fdname" argument already exists,
1550 the file descriptor assigned to it will be closed and replaced
1551 by the received file descriptor.
1552(2) The 'closefd' command can be used to explicitly close the file
1553 descriptor when it is no longer needed.
1554
82a56f0d
LC
1555EQMP
1556
1557 {
1558 .name = "closefd",
1559 .args_type = "fdname:s",
1560 .params = "closefd name",
1561 .help = "close a file descriptor previously passed via SCM rights",
208c9d1b 1562 .mhandler.cmd_new = qmp_marshal_input_closefd,
82a56f0d
LC
1563 },
1564
1565SQMP
1566closefd
1567-------
1568
1569Close a file descriptor previously passed via SCM rights.
1570
1571Arguments:
1572
1573- "fdname": file descriptor name (json-string)
1574
1575Example:
1576
1577-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1578<- { "return": {} }
1579
ba1c048a
CB
1580EQMP
1581
1582 {
1583 .name = "add-fd",
1584 .args_type = "fdset-id:i?,opaque:s?",
1585 .params = "add-fd fdset-id opaque",
1586 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1587 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1588 },
1589
1590SQMP
1591add-fd
1592-------
1593
1594Add a file descriptor, that was passed via SCM rights, to an fd set.
1595
1596Arguments:
1597
1598- "fdset-id": The ID of the fd set to add the file descriptor to.
1599 (json-int, optional)
1600- "opaque": A free-form string that can be used to describe the fd.
1601 (json-string, optional)
1602
1603Return a json-object with the following information:
1604
1605- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1606- "fd": The file descriptor that was received via SCM rights and added to the
1607 fd set. (json-int)
1608
1609Example:
1610
1611-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1612<- { "return": { "fdset-id": 1, "fd": 3 } }
1613
1614Notes:
1615
1616(1) The list of fd sets is shared by all monitor connections.
1617(2) If "fdset-id" is not specified, a new fd set will be created.
1618
1619EQMP
1620
1621 {
1622 .name = "remove-fd",
1623 .args_type = "fdset-id:i,fd:i?",
1624 .params = "remove-fd fdset-id fd",
1625 .help = "Remove a file descriptor from an fd set",
1626 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1627 },
1628
1629SQMP
1630remove-fd
1631---------
1632
1633Remove a file descriptor from an fd set.
1634
1635Arguments:
1636
1637- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1638 (json-int)
1639- "fd": The file descriptor that is to be removed. (json-int, optional)
1640
1641Example:
1642
1643-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1644<- { "return": {} }
1645
1646Notes:
1647
1648(1) The list of fd sets is shared by all monitor connections.
1649(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1650 removed.
1651
1652EQMP
1653
1654 {
1655 .name = "query-fdsets",
1656 .args_type = "",
1657 .help = "Return information describing all fd sets",
1658 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1659 },
1660
1661SQMP
1662query-fdsets
1663-------------
1664
1665Return information describing all fd sets.
1666
1667Arguments: None
1668
1669Example:
1670
1671-> { "execute": "query-fdsets" }
1672<- { "return": [
1673 {
1674 "fds": [
1675 {
1676 "fd": 30,
1677 "opaque": "rdonly:/path/to/file"
1678 },
1679 {
1680 "fd": 24,
1681 "opaque": "rdwr:/path/to/file"
1682 }
1683 ],
1684 "fdset-id": 1
1685 },
1686 {
1687 "fds": [
1688 {
1689 "fd": 28
1690 },
1691 {
1692 "fd": 29
1693 }
1694 ],
1695 "fdset-id": 0
1696 }
1697 ]
1698 }
1699
1700Note: The list of fd sets is shared by all monitor connections.
1701
82a56f0d
LC
1702EQMP
1703
1704 {
1705 .name = "block_passwd",
12d3ba82 1706 .args_type = "device:s?,node-name:s?,password:s",
a4dea8a9 1707 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
82a56f0d
LC
1708 },
1709
1710SQMP
1711block_passwd
1712------------
1713
1714Set the password of encrypted block devices.
1715
1716Arguments:
1717
1718- "device": device name (json-string)
12d3ba82 1719- "node-name": name in the block driver state graph (json-string)
82a56f0d
LC
1720- "password": password (json-string)
1721
1722Example:
1723
1724-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1725 "password": "12345" } }
1726<- { "return": {} }
1727
727f005e
ZYW
1728EQMP
1729
1730 {
1731 .name = "block_set_io_throttle",
2024c1df 1732 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,iops_size:l?",
80047da5 1733 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
727f005e
ZYW
1734 },
1735
1736SQMP
1737block_set_io_throttle
1738------------
1739
1740Change I/O throttle limits for a block drive.
1741
1742Arguments:
1743
1744- "device": device name (json-string)
586b5466
EB
1745- "bps": total throughput limit in bytes per second (json-int)
1746- "bps_rd": read throughput limit in bytes per second (json-int)
1747- "bps_wr": write throughput limit in bytes per second (json-int)
1748- "iops": total I/O operations per second (json-int)
1749- "iops_rd": read I/O operations per second (json-int)
1750- "iops_wr": write I/O operations per second (json-int)
3e9fab69
BC
1751- "bps_max": total max in bytes (json-int)
1752- "bps_rd_max": read max in bytes (json-int)
1753- "bps_wr_max": write max in bytes (json-int)
1754- "iops_max": total I/O operations max (json-int)
1755- "iops_rd_max": read I/O operations max (json-int)
1756- "iops_wr_max": write I/O operations max (json-int)
2024c1df 1757- "iops_size": I/O size in bytes when limiting (json-int)
727f005e
ZYW
1758
1759Example:
1760
1761-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
586b5466
EB
1762 "bps": 1000000,
1763 "bps_rd": 0,
1764 "bps_wr": 0,
1765 "iops": 0,
1766 "iops_rd": 0,
3e9fab69
BC
1767 "iops_wr": 0,
1768 "bps_max": 8000000,
1769 "bps_rd_max": 0,
1770 "bps_wr_max": 0,
1771 "iops_max": 0,
1772 "iops_rd_max": 0,
2024c1df
BC
1773 "iops_wr_max": 0,
1774 "iops_size": 0 } }
727f005e
ZYW
1775<- { "return": {} }
1776
7572150c
GH
1777EQMP
1778
1779 {
1780 .name = "set_password",
1781 .args_type = "protocol:s,password:s,connected:s?",
fbf796fd 1782 .mhandler.cmd_new = qmp_marshal_input_set_password,
7572150c
GH
1783 },
1784
1785SQMP
1786set_password
1787------------
1788
1789Set the password for vnc/spice protocols.
1790
1791Arguments:
1792
1793- "protocol": protocol name (json-string)
1794- "password": password (json-string)
3599d46b 1795- "connected": [ keep | disconnect | fail ] (json-string, optional)
7572150c
GH
1796
1797Example:
1798
1799-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1800 "password": "secret" } }
1801<- { "return": {} }
1802
1803EQMP
1804
1805 {
1806 .name = "expire_password",
1807 .args_type = "protocol:s,time:s",
9ad5372d 1808 .mhandler.cmd_new = qmp_marshal_input_expire_password,
7572150c
GH
1809 },
1810
1811SQMP
1812expire_password
1813---------------
1814
1815Set the password expire time for vnc/spice protocols.
1816
1817Arguments:
1818
1819- "protocol": protocol name (json-string)
1820- "time": [ now | never | +secs | secs ] (json-string)
1821
1822Example:
1823
1824-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1825 "time": "+60" } }
1826<- { "return": {} }
1827
82a56f0d
LC
1828EQMP
1829
13661089
DB
1830 {
1831 .name = "add_client",
f1f5f407 1832 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
b224e5e2 1833 .mhandler.cmd_new = qmp_marshal_input_add_client,
13661089
DB
1834 },
1835
1836SQMP
1837add_client
1838----------
1839
1840Add a graphics client
1841
1842Arguments:
1843
1844- "protocol": protocol name (json-string)
1845- "fdname": file descriptor name (json-string)
f1f5f407
DB
1846- "skipauth": whether to skip authentication (json-bool, optional)
1847- "tls": whether to perform TLS (json-bool, optional)
13661089
DB
1848
1849Example:
1850
1851-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1852 "fdname": "myclient" } }
1853<- { "return": {} }
1854
1855EQMP
82a56f0d
LC
1856 {
1857 .name = "qmp_capabilities",
1858 .args_type = "",
1859 .params = "",
1860 .help = "enable QMP capabilities",
82a56f0d
LC
1861 .mhandler.cmd_new = do_qmp_capabilities,
1862 },
1863
1864SQMP
1865qmp_capabilities
1866----------------
1867
1868Enable QMP capabilities.
1869
1870Arguments: None.
1871
1872Example:
1873
1874-> { "execute": "qmp_capabilities" }
1875<- { "return": {} }
1876
1877Note: This command must be issued before issuing any other command.
1878
0268d97c
LC
1879EQMP
1880
1881 {
1882 .name = "human-monitor-command",
1883 .args_type = "command-line:s,cpu-index:i?",
d51a67b4 1884 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
0268d97c
LC
1885 },
1886
1887SQMP
1888human-monitor-command
1889---------------------
1890
1891Execute a Human Monitor command.
1892
1893Arguments:
1894
1895- command-line: the command name and its arguments, just like the
1896 Human Monitor's shell (json-string)
1897- cpu-index: select the CPU number to be used by commands which access CPU
1898 data, like 'info registers'. The Monitor selects CPU 0 if this
1899 argument is not provided (json-int, optional)
1900
1901Example:
1902
1903-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1904<- { "return": "kvm support: enabled\r\n" }
1905
1906Notes:
1907
1908(1) The Human Monitor is NOT an stable interface, this means that command
1909 names, arguments and responses can change or be removed at ANY time.
1910 Applications that rely on long term stability guarantees should NOT
1911 use this command
1912
1913(2) Limitations:
1914
1915 o This command is stateless, this means that commands that depend
1916 on state information (such as getfd) might not work
1917
1918 o Commands that prompt the user for data (eg. 'cont' when the block
1919 device is encrypted) don't currently work
1920
82a56f0d
LC
19213. Query Commands
1922=================
1923
1924HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1925HXCOMM this! We will possibly move query commands definitions inside those
1926HXCOMM sections, just like regular commands.
1927
1928EQMP
1929
1930SQMP
1931query-version
1932-------------
1933
1934Show QEMU version.
1935
1936Return a json-object with the following information:
1937
1938- "qemu": A json-object containing three integer values:
1939 - "major": QEMU's major version (json-int)
1940 - "minor": QEMU's minor version (json-int)
1941 - "micro": QEMU's micro version (json-int)
1942- "package": package's version (json-string)
1943
1944Example:
1945
1946-> { "execute": "query-version" }
1947<- {
1948 "return":{
1949 "qemu":{
1950 "major":0,
1951 "minor":11,
1952 "micro":5
1953 },
1954 "package":""
1955 }
1956 }
1957
1958EQMP
1959
b9c15f16
LC
1960 {
1961 .name = "query-version",
1962 .args_type = "",
1963 .mhandler.cmd_new = qmp_marshal_input_query_version,
1964 },
1965
82a56f0d
LC
1966SQMP
1967query-commands
1968--------------
1969
1970List QMP available commands.
1971
1972Each command is represented by a json-object, the returned value is a json-array
1973of all commands.
1974
1975Each json-object contain:
1976
1977- "name": command's name (json-string)
1978
1979Example:
1980
1981-> { "execute": "query-commands" }
1982<- {
1983 "return":[
1984 {
1985 "name":"query-balloon"
1986 },
1987 {
1988 "name":"system_powerdown"
1989 }
1990 ]
1991 }
1992
1993Note: This example has been shortened as the real response is too long.
1994
1995EQMP
1996
aa9b79bc
LC
1997 {
1998 .name = "query-commands",
1999 .args_type = "",
2000 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2001 },
2002
4860853d
DB
2003SQMP
2004query-events
2005--------------
2006
2007List QMP available events.
2008
2009Each event is represented by a json-object, the returned value is a json-array
2010of all events.
2011
2012Each json-object contains:
2013
2014- "name": event's name (json-string)
2015
2016Example:
2017
2018-> { "execute": "query-events" }
2019<- {
2020 "return":[
2021 {
2022 "name":"SHUTDOWN"
2023 },
2024 {
2025 "name":"RESET"
2026 }
2027 ]
2028 }
2029
2030Note: This example has been shortened as the real response is too long.
2031
2032EQMP
2033
2034 {
2035 .name = "query-events",
2036 .args_type = "",
2037 .mhandler.cmd_new = qmp_marshal_input_query_events,
2038 },
2039
82a56f0d
LC
2040SQMP
2041query-chardev
2042-------------
2043
2044Each device is represented by a json-object. The returned value is a json-array
2045of all devices.
2046
2047Each json-object contain the following:
2048
2049- "label": device's label (json-string)
2050- "filename": device's file (json-string)
32a97ea1
LE
2051- "frontend-open": open/closed state of the frontend device attached to this
2052 backend (json-bool)
82a56f0d
LC
2053
2054Example:
2055
2056-> { "execute": "query-chardev" }
2057<- {
32a97ea1
LE
2058 "return": [
2059 {
2060 "label": "charchannel0",
2061 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2062 "frontend-open": false
2063 },
82a56f0d 2064 {
32a97ea1
LE
2065 "label": "charmonitor",
2066 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2067 "frontend-open": true
82a56f0d
LC
2068 },
2069 {
32a97ea1
LE
2070 "label": "charserial0",
2071 "filename": "pty:/dev/pts/2",
2072 "frontend-open": true
82a56f0d
LC
2073 }
2074 ]
2075 }
2076
2077EQMP
2078
c5a415a0
LC
2079 {
2080 .name = "query-chardev",
2081 .args_type = "",
2082 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2083 },
2084
77d1c3c6
MK
2085SQMP
2086query-chardev-backends
2087-------------
2088
2089List available character device backends.
2090
2091Each backend is represented by a json-object, the returned value is a json-array
2092of all backends.
2093
2094Each json-object contains:
2095
2096- "name": backend name (json-string)
2097
2098Example:
2099
2100-> { "execute": "query-chardev-backends" }
2101<- {
2102 "return":[
2103 {
2104 "name":"udp"
2105 },
2106 {
2107 "name":"tcp"
2108 },
2109 {
2110 "name":"unix"
2111 },
2112 {
2113 "name":"spiceport"
2114 }
2115 ]
2116 }
2117
2118EQMP
2119
2120 {
2121 .name = "query-chardev-backends",
2122 .args_type = "",
2123 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2124 },
2125
82a56f0d
LC
2126SQMP
2127query-block
2128-----------
2129
2130Show the block devices.
2131
2132Each block device information is stored in a json-object and the returned value
2133is a json-array of all devices.
2134
2135Each json-object contain the following:
2136
2137- "device": device name (json-string)
2138- "type": device type (json-string)
d8aeeb31
MA
2139 - deprecated, retained for backward compatibility
2140 - Possible values: "unknown"
82a56f0d
LC
2141- "removable": true if the device is removable, false otherwise (json-bool)
2142- "locked": true if the device is locked, false otherwise (json-bool)
99f42808 2143- "tray_open": only present if removable, true if the device has a tray,
e4def80b 2144 and it is open (json-bool)
82a56f0d
LC
2145- "inserted": only present if the device is inserted, it is a json-object
2146 containing the following:
2147 - "file": device file name (json-string)
2148 - "ro": true if read-only, false otherwise (json-bool)
2149 - "drv": driver format name (json-string)
550830f9 2150 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
82a56f0d 2151 "file", "file", "ftp", "ftps", "host_cdrom",
92a539d2 2152 "host_device", "http", "https",
82a56f0d
LC
2153 "nbd", "parallels", "qcow", "qcow2", "raw",
2154 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2155 - "backing_file": backing file name (json-string, optional)
2e3e3317 2156 - "backing_file_depth": number of files in the backing file chain (json-int)
82a56f0d 2157 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
2158 - "bps": limit total bytes per second (json-int)
2159 - "bps_rd": limit read bytes per second (json-int)
2160 - "bps_wr": limit write bytes per second (json-int)
2161 - "iops": limit total I/O operations per second (json-int)
2162 - "iops_rd": limit read operations per second (json-int)
2163 - "iops_wr": limit write operations per second (json-int)
3e9fab69
BC
2164 - "bps_max": total max in bytes (json-int)
2165 - "bps_rd_max": read max in bytes (json-int)
2166 - "bps_wr_max": write max in bytes (json-int)
2167 - "iops_max": total I/O operations max (json-int)
2168 - "iops_rd_max": read I/O operations max (json-int)
2169 - "iops_wr_max": write I/O operations max (json-int)
2024c1df 2170 - "iops_size": I/O size when limiting by iops (json-int)
465bee1d
PL
2171 - "detect_zeroes": detect and optimize zero writing (json-string)
2172 - Possible values: "off", "on", "unmap"
e2462113
FR
2173 - "write_threshold": write offset threshold in bytes, a event will be
2174 emitted if crossed. Zero if disabled (json-int)
553a7e87
WX
2175 - "image": the detail of the image, it is a json-object containing
2176 the following:
2177 - "filename": image file name (json-string)
2178 - "format": image format (json-string)
2179 - "virtual-size": image capacity in bytes (json-int)
2180 - "dirty-flag": true if image is not cleanly closed, not present
2181 means clean (json-bool, optional)
2182 - "actual-size": actual size on disk in bytes of the image, not
2183 present when image does not support thin
2184 provision (json-int, optional)
2185 - "cluster-size": size of a cluster in bytes, not present if image
2186 format does not support it (json-int, optional)
2187 - "encrypted": true if the image is encrypted, not present means
2188 false or the image format does not support
2189 encryption (json-bool, optional)
2190 - "backing_file": backing file name, not present means no backing
2191 file is used or the image format does not
2192 support backing file chain
2193 (json-string, optional)
2194 - "full-backing-filename": full path of the backing file, not
2195 present if it equals backing_file or no
2196 backing file is used
2197 (json-string, optional)
2198 - "backing-filename-format": the format of the backing file, not
2199 present means unknown or no backing
2200 file (json-string, optional)
2201 - "snapshots": the internal snapshot info, it is an optional list
2202 of json-object containing the following:
2203 - "id": unique snapshot id (json-string)
2204 - "name": snapshot name (json-string)
2205 - "vm-state-size": size of the VM state in bytes (json-int)
2206 - "date-sec": UTC date of the snapshot in seconds (json-int)
2207 - "date-nsec": fractional part in nanoseconds to be used with
586b5466 2208 date-sec (json-int)
553a7e87
WX
2209 - "vm-clock-sec": VM clock relative to boot in seconds
2210 (json-int)
2211 - "vm-clock-nsec": fractional part in nanoseconds to be used
2212 with vm-clock-sec (json-int)
2213 - "backing-image": the detail of the backing image, it is an
2214 optional json-object only present when a
2215 backing image present for this image
727f005e 2216
f04ef601
LC
2217- "io-status": I/O operation status, only present if the device supports it
2218 and the VM is configured to stop on errors. It's always reset
2219 to "ok" when the "cont" command is issued (json_string, optional)
2220 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
2221
2222Example:
2223
2224-> { "execute": "query-block" }
2225<- {
2226 "return":[
2227 {
f04ef601 2228 "io-status": "ok",
82a56f0d
LC
2229 "device":"ide0-hd0",
2230 "locked":false,
2231 "removable":false,
2232 "inserted":{
2233 "ro":false,
2234 "drv":"qcow2",
2235 "encrypted":false,
553a7e87
WX
2236 "file":"disks/test.qcow2",
2237 "backing_file_depth":1,
727f005e
ZYW
2238 "bps":1000000,
2239 "bps_rd":0,
2240 "bps_wr":0,
2241 "iops":1000000,
2242 "iops_rd":0,
2243 "iops_wr":0,
3e9fab69
BC
2244 "bps_max": 8000000,
2245 "bps_rd_max": 0,
2246 "bps_wr_max": 0,
2247 "iops_max": 0,
2248 "iops_rd_max": 0,
2249 "iops_wr_max": 0,
2024c1df 2250 "iops_size": 0,
465bee1d 2251 "detect_zeroes": "on",
e2462113 2252 "write_threshold": 0,
553a7e87
WX
2253 "image":{
2254 "filename":"disks/test.qcow2",
2255 "format":"qcow2",
2256 "virtual-size":2048000,
2257 "backing_file":"base.qcow2",
2258 "full-backing-filename":"disks/base.qcow2",
2259 "backing-filename-format:"qcow2",
2260 "snapshots":[
2261 {
2262 "id": "1",
2263 "name": "snapshot1",
2264 "vm-state-size": 0,
2265 "date-sec": 10000200,
2266 "date-nsec": 12,
2267 "vm-clock-sec": 206,
2268 "vm-clock-nsec": 30
2269 }
2270 ],
2271 "backing-image":{
2272 "filename":"disks/base.qcow2",
2273 "format":"qcow2",
2274 "virtual-size":2048000
2275 }
2276 }
82a56f0d 2277 },
d8aeeb31 2278 "type":"unknown"
82a56f0d
LC
2279 },
2280 {
f04ef601 2281 "io-status": "ok",
82a56f0d
LC
2282 "device":"ide1-cd0",
2283 "locked":false,
2284 "removable":true,
d8aeeb31 2285 "type":"unknown"
82a56f0d
LC
2286 },
2287 {
2288 "device":"floppy0",
2289 "locked":false,
2290 "removable":true,
d8aeeb31 2291 "type":"unknown"
82a56f0d
LC
2292 },
2293 {
2294 "device":"sd0",
2295 "locked":false,
2296 "removable":true,
d8aeeb31 2297 "type":"unknown"
82a56f0d
LC
2298 }
2299 ]
2300 }
2301
2302EQMP
2303
b2023818
LC
2304 {
2305 .name = "query-block",
2306 .args_type = "",
2307 .mhandler.cmd_new = qmp_marshal_input_query_block,
2308 },
2309
82a56f0d
LC
2310SQMP
2311query-blockstats
2312----------------
2313
2314Show block device statistics.
2315
2316Each device statistic information is stored in a json-object and the returned
2317value is a json-array of all devices.
2318
2319Each json-object contain the following:
2320
2321- "device": device name (json-string)
2322- "stats": A json-object with the statistics information, it contains:
2323 - "rd_bytes": bytes read (json-int)
2324 - "wr_bytes": bytes written (json-int)
2325 - "rd_operations": read operations (json-int)
2326 - "wr_operations": write operations (json-int)
e8045d67 2327 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
2328 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2329 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2330 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
82a56f0d
LC
2331 - "wr_highest_offset": Highest offset of a sector written since the
2332 BlockDriverState has been opened (json-int)
f4564d53
PL
2333 - "rd_merged": number of read requests that have been merged into
2334 another request (json-int)
2335 - "wr_merged": number of write requests that have been merged into
2336 another request (json-int)
82a56f0d
LC
2337- "parent": Contains recursively the statistics of the underlying
2338 protocol (e.g. the host file for a qcow2 image). If there is
2339 no underlying protocol, this field is omitted
2340 (json-object, optional)
2341
2342Example:
2343
2344-> { "execute": "query-blockstats" }
2345<- {
2346 "return":[
2347 {
2348 "device":"ide0-hd0",
2349 "parent":{
2350 "stats":{
2351 "wr_highest_offset":3686448128,
2352 "wr_bytes":9786368,
2353 "wr_operations":751,
2354 "rd_bytes":122567168,
2355 "rd_operations":36772
c488c7f6
CH
2356 "wr_total_times_ns":313253456
2357 "rd_total_times_ns":3465673657
2358 "flush_total_times_ns":49653
e8045d67 2359 "flush_operations":61,
f4564d53
PL
2360 "rd_merged":0,
2361 "wr_merged":0
82a56f0d
LC
2362 }
2363 },
2364 "stats":{
2365 "wr_highest_offset":2821110784,
2366 "wr_bytes":9786368,
2367 "wr_operations":692,
2368 "rd_bytes":122739200,
2369 "rd_operations":36604
e8045d67 2370 "flush_operations":51,
c488c7f6
CH
2371 "wr_total_times_ns":313253456
2372 "rd_total_times_ns":3465673657
f4564d53
PL
2373 "flush_total_times_ns":49653,
2374 "rd_merged":0,
2375 "wr_merged":0
82a56f0d
LC
2376 }
2377 },
2378 {
2379 "device":"ide1-cd0",
2380 "stats":{
2381 "wr_highest_offset":0,
2382 "wr_bytes":0,
2383 "wr_operations":0,
2384 "rd_bytes":0,
2385 "rd_operations":0
e8045d67 2386 "flush_operations":0,
c488c7f6
CH
2387 "wr_total_times_ns":0
2388 "rd_total_times_ns":0
f4564d53
PL
2389 "flush_total_times_ns":0,
2390 "rd_merged":0,
2391 "wr_merged":0
82a56f0d
LC
2392 }
2393 },
2394 {
2395 "device":"floppy0",
2396 "stats":{
2397 "wr_highest_offset":0,
2398 "wr_bytes":0,
2399 "wr_operations":0,
2400 "rd_bytes":0,
2401 "rd_operations":0
e8045d67 2402 "flush_operations":0,
c488c7f6
CH
2403 "wr_total_times_ns":0
2404 "rd_total_times_ns":0
f4564d53
PL
2405 "flush_total_times_ns":0,
2406 "rd_merged":0,
2407 "wr_merged":0
82a56f0d
LC
2408 }
2409 },
2410 {
2411 "device":"sd0",
2412 "stats":{
2413 "wr_highest_offset":0,
2414 "wr_bytes":0,
2415 "wr_operations":0,
2416 "rd_bytes":0,
2417 "rd_operations":0
e8045d67 2418 "flush_operations":0,
c488c7f6
CH
2419 "wr_total_times_ns":0
2420 "rd_total_times_ns":0
f4564d53
PL
2421 "flush_total_times_ns":0,
2422 "rd_merged":0,
2423 "wr_merged":0
82a56f0d
LC
2424 }
2425 }
2426 ]
2427 }
2428
2429EQMP
2430
f11f57e4
LC
2431 {
2432 .name = "query-blockstats",
f71eaa74 2433 .args_type = "query-nodes:b?",
f11f57e4
LC
2434 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2435 },
2436
82a56f0d
LC
2437SQMP
2438query-cpus
2439----------
2440
2441Show CPU information.
2442
2443Return a json-array. Each CPU is represented by a json-object, which contains:
2444
2445- "CPU": CPU index (json-int)
2446- "current": true if this is the current CPU, false otherwise (json-bool)
2447- "halted": true if the cpu is halted, false otherwise (json-bool)
2448- Current program counter. The key's name depends on the architecture:
2449 "pc": i386/x86_64 (json-int)
2450 "nip": PPC (json-int)
2451 "pc" and "npc": sparc (json-int)
2452 "PC": mips (json-int)
dc7a09cf 2453- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
2454
2455Example:
2456
2457-> { "execute": "query-cpus" }
2458<- {
2459 "return":[
2460 {
2461 "CPU":0,
2462 "current":true,
2463 "halted":false,
2464 "pc":3227107138
dc7a09cf 2465 "thread_id":3134
82a56f0d
LC
2466 },
2467 {
2468 "CPU":1,
2469 "current":false,
2470 "halted":true,
2471 "pc":7108165
dc7a09cf 2472 "thread_id":3135
82a56f0d
LC
2473 }
2474 ]
2475 }
2476
2477EQMP
2478
de0b36b6
LC
2479 {
2480 .name = "query-cpus",
2481 .args_type = "",
2482 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2483 },
2484
dc3dd0d2
SH
2485SQMP
2486query-iothreads
2487---------------
2488
2489Returns a list of information about each iothread.
2490
2491Note this list excludes the QEMU main loop thread, which is not declared
2492using the -object iothread command-line option. It is always the main thread
2493of the process.
2494
2495Return a json-array. Each iothread is represented by a json-object, which contains:
2496
2497- "id": name of iothread (json-str)
2498- "thread-id": ID of the underlying host thread (json-int)
2499
2500Example:
2501
2502-> { "execute": "query-iothreads" }
2503<- {
2504 "return":[
2505 {
2506 "id":"iothread0",
2507 "thread-id":3134
2508 },
2509 {
2510 "id":"iothread1",
2511 "thread-id":3135
2512 }
2513 ]
2514 }
2515
2516EQMP
2517
2518 {
2519 .name = "query-iothreads",
2520 .args_type = "",
2521 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2522 },
2523
82a56f0d
LC
2524SQMP
2525query-pci
2526---------
2527
2528PCI buses and devices information.
2529
2530The returned value is a json-array of all buses. Each bus is represented by
2531a json-object, which has a key with a json-array of all PCI devices attached
2532to it. Each device is represented by a json-object.
2533
2534The bus json-object contains the following:
2535
2536- "bus": bus number (json-int)
2537- "devices": a json-array of json-objects, each json-object represents a
2538 PCI device
2539
2540The PCI device json-object contains the following:
2541
2542- "bus": identical to the parent's bus number (json-int)
2543- "slot": slot number (json-int)
2544- "function": function number (json-int)
2545- "class_info": a json-object containing:
2546 - "desc": device class description (json-string, optional)
2547 - "class": device class number (json-int)
2548- "id": a json-object containing:
2549 - "device": device ID (json-int)
2550 - "vendor": vendor ID (json-int)
2551- "irq": device's IRQ if assigned (json-int, optional)
2552- "qdev_id": qdev id string (json-string)
2553- "pci_bridge": It's a json-object, only present if this device is a
2554 PCI bridge, contains:
2555 - "bus": bus number (json-int)
2556 - "secondary": secondary bus number (json-int)
2557 - "subordinate": subordinate bus number (json-int)
2558 - "io_range": I/O memory range information, a json-object with the
2559 following members:
2560 - "base": base address, in bytes (json-int)
2561 - "limit": limit address, in bytes (json-int)
2562 - "memory_range": memory range information, a json-object with the
2563 following members:
2564 - "base": base address, in bytes (json-int)
2565 - "limit": limit address, in bytes (json-int)
2566 - "prefetchable_range": Prefetchable memory range information, a
2567 json-object with the following members:
2568 - "base": base address, in bytes (json-int)
2569 - "limit": limit address, in bytes (json-int)
2570 - "devices": a json-array of PCI devices if there's any attached, each
2571 each element is represented by a json-object, which contains
2572 the same members of the 'PCI device json-object' described
2573 above (optional)
2574- "regions": a json-array of json-objects, each json-object represents a
2575 memory region of this device
2576
2577The memory range json-object contains the following:
2578
2579- "base": base memory address (json-int)
2580- "limit": limit value (json-int)
2581
2582The region json-object can be an I/O region or a memory region, an I/O region
2583json-object contains the following:
2584
2585- "type": "io" (json-string, fixed)
2586- "bar": BAR number (json-int)
2587- "address": memory address (json-int)
2588- "size": memory size (json-int)
2589
2590A memory region json-object contains the following:
2591
2592- "type": "memory" (json-string, fixed)
2593- "bar": BAR number (json-int)
2594- "address": memory address (json-int)
2595- "size": memory size (json-int)
2596- "mem_type_64": true or false (json-bool)
2597- "prefetch": true or false (json-bool)
2598
2599Example:
2600
2601-> { "execute": "query-pci" }
2602<- {
2603 "return":[
2604 {
2605 "bus":0,
2606 "devices":[
2607 {
2608 "bus":0,
2609 "qdev_id":"",
2610 "slot":0,
2611 "class_info":{
2612 "class":1536,
2613 "desc":"Host bridge"
2614 },
2615 "id":{
2616 "device":32902,
2617 "vendor":4663
2618 },
2619 "function":0,
2620 "regions":[
2621
2622 ]
2623 },
2624 {
2625 "bus":0,
2626 "qdev_id":"",
2627 "slot":1,
2628 "class_info":{
2629 "class":1537,
2630 "desc":"ISA bridge"
2631 },
2632 "id":{
2633 "device":32902,
2634 "vendor":28672
2635 },
2636 "function":0,
2637 "regions":[
2638
2639 ]
2640 },
2641 {
2642 "bus":0,
2643 "qdev_id":"",
2644 "slot":1,
2645 "class_info":{
2646 "class":257,
2647 "desc":"IDE controller"
2648 },
2649 "id":{
2650 "device":32902,
2651 "vendor":28688
2652 },
2653 "function":1,
2654 "regions":[
2655 {
2656 "bar":4,
2657 "size":16,
2658 "address":49152,
2659 "type":"io"
2660 }
2661 ]
2662 },
2663 {
2664 "bus":0,
2665 "qdev_id":"",
2666 "slot":2,
2667 "class_info":{
2668 "class":768,
2669 "desc":"VGA controller"
2670 },
2671 "id":{
2672 "device":4115,
2673 "vendor":184
2674 },
2675 "function":0,
2676 "regions":[
2677 {
2678 "prefetch":true,
2679 "mem_type_64":false,
2680 "bar":0,
2681 "size":33554432,
2682 "address":4026531840,
2683 "type":"memory"
2684 },
2685 {
2686 "prefetch":false,
2687 "mem_type_64":false,
2688 "bar":1,
2689 "size":4096,
2690 "address":4060086272,
2691 "type":"memory"
2692 },
2693 {
2694 "prefetch":false,
2695 "mem_type_64":false,
2696 "bar":6,
2697 "size":65536,
2698 "address":-1,
2699 "type":"memory"
2700 }
2701 ]
2702 },
2703 {
2704 "bus":0,
2705 "qdev_id":"",
2706 "irq":11,
2707 "slot":4,
2708 "class_info":{
2709 "class":1280,
2710 "desc":"RAM controller"
2711 },
2712 "id":{
2713 "device":6900,
2714 "vendor":4098
2715 },
2716 "function":0,
2717 "regions":[
2718 {
2719 "bar":0,
2720 "size":32,
2721 "address":49280,
2722 "type":"io"
2723 }
2724 ]
2725 }
2726 ]
2727 }
2728 ]
2729 }
2730
2731Note: This example has been shortened as the real response is too long.
2732
2733EQMP
2734
79627472
LC
2735 {
2736 .name = "query-pci",
2737 .args_type = "",
2738 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2739 },
2740
82a56f0d
LC
2741SQMP
2742query-kvm
2743---------
2744
2745Show KVM information.
2746
2747Return a json-object with the following information:
2748
2749- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2750- "present": true if QEMU has KVM support, false otherwise (json-bool)
2751
2752Example:
2753
2754-> { "execute": "query-kvm" }
2755<- { "return": { "enabled": true, "present": true } }
2756
2757EQMP
2758
292a2602
LC
2759 {
2760 .name = "query-kvm",
2761 .args_type = "",
2762 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2763 },
2764
82a56f0d
LC
2765SQMP
2766query-status
2767------------
2768
2769Return a json-object with the following information:
2770
2771- "running": true if the VM is running, or false if it is paused (json-bool)
2772- "singlestep": true if the VM is in single step mode,
2773 false otherwise (json-bool)
9e37b9dc
LC
2774- "status": one of the following values (json-string)
2775 "debug" - QEMU is running on a debugger
2776 "inmigrate" - guest is paused waiting for an incoming migration
2777 "internal-error" - An internal error that prevents further guest
2778 execution has occurred
2779 "io-error" - the last IOP has failed and the device is configured
2780 to pause on I/O errors
2781 "paused" - guest has been paused via the 'stop' command
2782 "postmigrate" - guest is paused following a successful 'migrate'
2783 "prelaunch" - QEMU was started with -S and guest has not started
2784 "finish-migrate" - guest is paused to finish the migration process
2785 "restore-vm" - guest is paused to restore VM state
2786 "running" - guest is actively running
2787 "save-vm" - guest is paused to save the VM state
2788 "shutdown" - guest is shut down (and -no-shutdown is in use)
2789 "watchdog" - the watchdog action is configured to pause and
2790 has been triggered
82a56f0d
LC
2791
2792Example:
2793
2794-> { "execute": "query-status" }
9e37b9dc 2795<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d
LC
2796
2797EQMP
1fa9a5e4
LC
2798
2799 {
2800 .name = "query-status",
2801 .args_type = "",
2802 .mhandler.cmd_new = qmp_marshal_input_query_status,
2803 },
82a56f0d
LC
2804
2805SQMP
2806query-mice
2807----------
2808
2809Show VM mice information.
2810
2811Each mouse is represented by a json-object, the returned value is a json-array
2812of all mice.
2813
2814The mouse json-object contains the following:
2815
2816- "name": mouse's name (json-string)
2817- "index": mouse's index (json-int)
2818- "current": true if this mouse is receiving events, false otherwise (json-bool)
2819- "absolute": true if the mouse generates absolute input events (json-bool)
2820
2821Example:
2822
2823-> { "execute": "query-mice" }
2824<- {
2825 "return":[
2826 {
2827 "name":"QEMU Microsoft Mouse",
2828 "index":0,
2829 "current":false,
2830 "absolute":false
2831 },
2832 {
2833 "name":"QEMU PS/2 Mouse",
2834 "index":1,
2835 "current":true,
2836 "absolute":true
2837 }
2838 ]
2839 }
2840
2841EQMP
2842
e235cec3
LC
2843 {
2844 .name = "query-mice",
2845 .args_type = "",
2846 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2847 },
2848
82a56f0d
LC
2849SQMP
2850query-vnc
2851---------
2852
2853Show VNC server information.
2854
2855Return a json-object with server information. Connected clients are returned
2856as a json-array of json-objects.
2857
2858The main json-object contains the following:
2859
2860- "enabled": true or false (json-bool)
2861- "host": server's IP address (json-string)
2862- "family": address family (json-string)
2863 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2864- "service": server's port number (json-string)
2865- "auth": authentication method (json-string)
2866 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2867 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2868 "vencrypt+plain", "vencrypt+tls+none",
2869 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2870 "vencrypt+tls+vnc", "vencrypt+x509+none",
2871 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2872 "vencrypt+x509+vnc", "vnc"
2873- "clients": a json-array of all connected clients
2874
2875Clients are described by a json-object, each one contain the following:
2876
2877- "host": client's IP address (json-string)
2878- "family": address family (json-string)
2879 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2880- "service": client's port number (json-string)
2881- "x509_dname": TLS dname (json-string, optional)
2882- "sasl_username": SASL username (json-string, optional)
2883
2884Example:
2885
2886-> { "execute": "query-vnc" }
2887<- {
2888 "return":{
2889 "enabled":true,
2890 "host":"0.0.0.0",
2891 "service":"50402",
2892 "auth":"vnc",
2893 "family":"ipv4",
2894 "clients":[
2895 {
2896 "host":"127.0.0.1",
2897 "service":"50401",
2898 "family":"ipv4"
2899 }
2900 ]
2901 }
2902 }
2903
2904EQMP
2905
2b54aa87
LC
2906 {
2907 .name = "query-vnc",
2908 .args_type = "",
2909 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2910 },
df887684
GH
2911 {
2912 .name = "query-vnc-servers",
2913 .args_type = "",
2914 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
2915 },
2b54aa87 2916
cb42a870
GH
2917SQMP
2918query-spice
2919-----------
2920
2921Show SPICE server information.
2922
2923Return a json-object with server information. Connected clients are returned
2924as a json-array of json-objects.
2925
2926The main json-object contains the following:
2927
2928- "enabled": true or false (json-bool)
2929- "host": server's IP address (json-string)
2930- "port": server's port number (json-int, optional)
2931- "tls-port": server's port number (json-int, optional)
2932- "auth": authentication method (json-string)
2933 - Possible values: "none", "spice"
2934- "channels": a json-array of all active channels clients
2935
2936Channels are described by a json-object, each one contain the following:
2937
2938- "host": client's IP address (json-string)
2939- "family": address family (json-string)
2940 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2941- "port": client's port number (json-string)
2942- "connection-id": spice connection id. All channels with the same id
2943 belong to the same spice session (json-int)
2944- "channel-type": channel type. "1" is the main control channel, filter for
2945 this one if you want track spice sessions only (json-int)
2946- "channel-id": channel id. Usually "0", might be different needed when
2947 multiple channels of the same type exist, such as multiple
2948 display channels in a multihead setup (json-int)
3599d46b 2949- "tls": whether the channel is encrypted (json-bool)
cb42a870
GH
2950
2951Example:
2952
2953-> { "execute": "query-spice" }
2954<- {
2955 "return": {
2956 "enabled": true,
2957 "auth": "spice",
2958 "port": 5920,
2959 "tls-port": 5921,
2960 "host": "0.0.0.0",
2961 "channels": [
2962 {
2963 "port": "54924",
2964 "family": "ipv4",
2965 "channel-type": 1,
2966 "connection-id": 1804289383,
2967 "host": "127.0.0.1",
2968 "channel-id": 0,
2969 "tls": true
2970 },
2971 {
2972 "port": "36710",
2973 "family": "ipv4",
2974 "channel-type": 4,
2975 "connection-id": 1804289383,
2976 "host": "127.0.0.1",
2977 "channel-id": 0,
2978 "tls": false
2979 },
2980 [ ... more channels follow ... ]
2981 ]
2982 }
2983 }
2984
2985EQMP
2986
d1f29646
LC
2987#if defined(CONFIG_SPICE)
2988 {
2989 .name = "query-spice",
2990 .args_type = "",
2991 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2992 },
2993#endif
2994
82a56f0d
LC
2995SQMP
2996query-name
2997----------
2998
2999Show VM name.
3000
3001Return a json-object with the following information:
3002
3003- "name": VM's name (json-string, optional)
3004
3005Example:
3006
3007-> { "execute": "query-name" }
3008<- { "return": { "name": "qemu-name" } }
3009
3010EQMP
3011
48a32bed
AL
3012 {
3013 .name = "query-name",
3014 .args_type = "",
3015 .mhandler.cmd_new = qmp_marshal_input_query_name,
3016 },
3017
82a56f0d
LC
3018SQMP
3019query-uuid
3020----------
3021
3022Show VM UUID.
3023
3024Return a json-object with the following information:
3025
3026- "UUID": Universally Unique Identifier (json-string)
3027
3028Example:
3029
3030-> { "execute": "query-uuid" }
3031<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3032
3033EQMP
3034
efab767e
LC
3035 {
3036 .name = "query-uuid",
3037 .args_type = "",
3038 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3039 },
3040
1f8f987d
AK
3041SQMP
3042query-command-line-options
3043--------------------------
3044
3045Show command line option schema.
3046
3047Return a json-array of command line option schema for all options (or for
3048the given option), returning an error if the given option doesn't exist.
3049
3050Each array entry contains the following:
3051
3052- "option": option name (json-string)
3053- "parameters": a json-array describes all parameters of the option:
3054 - "name": parameter name (json-string)
3055 - "type": parameter type (one of 'string', 'boolean', 'number',
3056 or 'size')
3057 - "help": human readable description of the parameter
3058 (json-string, optional)
e36af94f
CL
3059 - "default": default value string for the parameter
3060 (json-string, optional)
1f8f987d
AK
3061
3062Example:
3063
3064-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3065<- { "return": [
3066 {
3067 "parameters": [
3068 {
3069 "name": "romfile",
3070 "type": "string"
3071 },
3072 {
3073 "name": "bootindex",
3074 "type": "number"
3075 }
3076 ],
3077 "option": "option-rom"
3078 }
3079 ]
3080 }
3081
3082EQMP
3083
3084 {
3085 .name = "query-command-line-options",
3086 .args_type = "option:s?",
3087 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3088 },
3089
82a56f0d
LC
3090SQMP
3091query-migrate
3092-------------
3093
3094Migration status.
3095
3096Return a json-object. If migration is active there will be another json-object
3097with RAM migration status and if block migration is active another one with
3098block migration status.
3099
3100The main json-object contains the following:
3101
3102- "status": migration status (json-string)
3b695950 3103 - Possible values: "setup", "active", "completed", "failed", "cancelled"
7aa939af
JQ
3104- "total-time": total amount of ms since migration started. If
3105 migration has ended, it returns the total migration
817c6045 3106 time (json-int)
8f3067bd
MH
3107- "setup-time" amount of setup time in milliseconds _before_ the
3108 iterations begin but _after_ the QMP command is issued.
3109 This is designed to provide an accounting of any activities
3110 (such as RDMA pinning) which may be expensive, but do not
3111 actually occur during the iterative migration rounds
3112 themselves. (json-int)
9c5a9fcf
JQ
3113- "downtime": only present when migration has finished correctly
3114 total amount in ms for downtime that happened (json-int)
2c52ddf1
JQ
3115- "expected-downtime": only present while migration is active
3116 total amount in ms for downtime that was calculated on
817c6045 3117 the last bitmap round (json-int)
82a56f0d 3118- "ram": only present if "status" is "active", it is a json-object with the
817c6045
JQ
3119 following RAM information:
3120 - "transferred": amount transferred in bytes (json-int)
3121 - "remaining": amount remaining to transfer in bytes (json-int)
3122 - "total": total amount of memory in bytes (json-int)
3123 - "duplicate": number of pages filled entirely with the same
3124 byte (json-int)
3125 These are sent over the wire much more efficiently.
f1c72795 3126 - "skipped": number of skipped zero pages (json-int)
805a2505 3127 - "normal" : number of whole pages transferred. I.e. they
817c6045
JQ
3128 were not sent as duplicate or xbzrle pages (json-int)
3129 - "normal-bytes" : number of bytes transferred in whole
3130 pages. This is just normal pages times size of one page,
3131 but this way upper levels don't need to care about page
3132 size (json-int)
58570ed8 3133 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
82a56f0d 3134- "disk": only present if "status" is "active" and it is a block migration,
817c6045
JQ
3135 it is a json-object with the following disk information:
3136 - "transferred": amount transferred in bytes (json-int)
3137 - "remaining": amount remaining to transfer in bytes json-int)
3138 - "total": total disk size in bytes (json-int)
f36d55af
OW
3139- "xbzrle-cache": only present if XBZRLE is active.
3140 It is a json-object with the following XBZRLE information:
817c6045
JQ
3141 - "cache-size": XBZRLE cache size in bytes
3142 - "bytes": number of bytes transferred for XBZRLE compressed pages
f36d55af 3143 - "pages": number of XBZRLE compressed pages
817c6045 3144 - "cache-miss": number of XBRZRLE page cache misses
8bc39233 3145 - "cache-miss-rate": rate of XBRZRLE page cache misses
817c6045
JQ
3146 - "overflow": number of times XBZRLE overflows. This means
3147 that the XBZRLE encoding was bigger than just sent the
3148 whole page, and then we sent the whole page instead (as as
3149 normal page).
3150
82a56f0d
LC
3151Examples:
3152
31531. Before the first migration
3154
3155-> { "execute": "query-migrate" }
3156<- { "return": {} }
3157
31582. Migration is done and has succeeded
3159
3160-> { "execute": "query-migrate" }
004d4c10
OW
3161<- { "return": {
3162 "status": "completed",
3163 "ram":{
3164 "transferred":123,
3165 "remaining":123,
3166 "total":246,
3167 "total-time":12345,
8f3067bd 3168 "setup-time":12345,
9c5a9fcf 3169 "downtime":12345,
004d4c10
OW
3170 "duplicate":123,
3171 "normal":123,
58570ed8
C
3172 "normal-bytes":123456,
3173 "dirty-sync-count":15
004d4c10
OW
3174 }
3175 }
3176 }
82a56f0d
LC
3177
31783. Migration is done and has failed
3179
3180-> { "execute": "query-migrate" }
3181<- { "return": { "status": "failed" } }
3182
31834. Migration is being performed and is not a block migration:
3184
3185-> { "execute": "query-migrate" }
3186<- {
3187 "return":{
3188 "status":"active",
3189 "ram":{
3190 "transferred":123,
3191 "remaining":123,
62d4e3fe 3192 "total":246,
004d4c10 3193 "total-time":12345,
8f3067bd 3194 "setup-time":12345,
2c52ddf1 3195 "expected-downtime":12345,
004d4c10
OW
3196 "duplicate":123,
3197 "normal":123,
58570ed8
C
3198 "normal-bytes":123456,
3199 "dirty-sync-count":15
82a56f0d
LC
3200 }
3201 }
3202 }
3203
32045. Migration is being performed and is a block migration:
3205
3206-> { "execute": "query-migrate" }
3207<- {
3208 "return":{
3209 "status":"active",
3210 "ram":{
3211 "total":1057024,
3212 "remaining":1053304,
62d4e3fe 3213 "transferred":3720,
004d4c10 3214 "total-time":12345,
8f3067bd 3215 "setup-time":12345,
2c52ddf1 3216 "expected-downtime":12345,
004d4c10
OW
3217 "duplicate":123,
3218 "normal":123,
58570ed8
C
3219 "normal-bytes":123456,
3220 "dirty-sync-count":15
82a56f0d
LC
3221 },
3222 "disk":{
3223 "total":20971520,
3224 "remaining":20880384,
3225 "transferred":91136
3226 }
3227 }
3228 }
3229
f36d55af
OW
32306. Migration is being performed and XBZRLE is active:
3231
3232-> { "execute": "query-migrate" }
3233<- {
3234 "return":{
3235 "status":"active",
3236 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3237 "ram":{
3238 "total":1057024,
3239 "remaining":1053304,
3240 "transferred":3720,
3241 "total-time":12345,
8f3067bd 3242 "setup-time":12345,
2c52ddf1 3243 "expected-downtime":12345,
f36d55af
OW
3244 "duplicate":10,
3245 "normal":3333,
58570ed8
C
3246 "normal-bytes":3412992,
3247 "dirty-sync-count":15
f36d55af
OW
3248 },
3249 "xbzrle-cache":{
3250 "cache-size":67108864,
3251 "bytes":20971520,
3252 "pages":2444343,
3253 "cache-miss":2244,
8bc39233 3254 "cache-miss-rate":0.123,
f36d55af
OW
3255 "overflow":34434
3256 }
3257 }
3258 }
3259
82a56f0d
LC
3260EQMP
3261
791e7c82
LC
3262 {
3263 .name = "query-migrate",
3264 .args_type = "",
3265 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3266 },
3267
bbf6da32 3268SQMP
00458433 3269migrate-set-capabilities
817c6045 3270------------------------
00458433
OW
3271
3272Enable/Disable migration capabilities
3273
817c6045 3274- "xbzrle": XBZRLE support
d6d69731
HZ
3275- "rdma-pin-all": pin all pages when using RDMA during migration
3276- "auto-converge": throttle down guest to help convergence of migration
3277- "zero-blocks": compress zero blocks during block migration
00458433
OW
3278
3279Arguments:
3280
3281Example:
3282
3283-> { "execute": "migrate-set-capabilities" , "arguments":
3284 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3285
3286EQMP
3287
3288 {
3289 .name = "migrate-set-capabilities",
43d0a2c1 3290 .args_type = "capabilities:q",
00458433
OW
3291 .params = "capability:s,state:b",
3292 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3293 },
3294SQMP
bbf6da32 3295query-migrate-capabilities
817c6045 3296--------------------------
bbf6da32
OW
3297
3298Query current migration capabilities
3299
3300- "capabilities": migration capabilities state
3301 - "xbzrle" : XBZRLE state (json-bool)
d6d69731
HZ
3302 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3303 - "auto-converge" : Auto Converge state (json-bool)
3304 - "zero-blocks" : Zero Blocks state (json-bool)
bbf6da32
OW
3305
3306Arguments:
3307
3308Example:
3309
3310-> { "execute": "query-migrate-capabilities" }
dbca1b37
OW
3311<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3312
bbf6da32
OW
3313EQMP
3314
3315 {
3316 .name = "query-migrate-capabilities",
3317 .args_type = "",
3318 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3319 },
3320
82a56f0d
LC
3321SQMP
3322query-balloon
3323-------------
3324
3325Show balloon information.
3326
3327Make an asynchronous request for balloon info. When the request completes a
3328json-object will be returned containing the following data:
3329
3330- "actual": current balloon value in bytes (json-int)
82a56f0d
LC
3331
3332Example:
3333
3334-> { "execute": "query-balloon" }
3335<- {
3336 "return":{
3337 "actual":1073741824,
82a56f0d
LC
3338 }
3339 }
3340
3341EQMP
3342
96637bcd
LC
3343 {
3344 .name = "query-balloon",
3345 .args_type = "",
3346 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3347 },
b4b12c62 3348
fb5458cd
SH
3349 {
3350 .name = "query-block-jobs",
3351 .args_type = "",
3352 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3353 },
3354
b4b12c62
AL
3355 {
3356 .name = "qom-list",
3357 .args_type = "path:s",
3358 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3359 },
eb6e8ea5
AL
3360
3361 {
3362 .name = "qom-set",
b9f8978c 3363 .args_type = "path:s,property:s,value:q",
eb6e8ea5
AL
3364 .mhandler.cmd_new = qmp_qom_set,
3365 },
3366
3367 {
3368 .name = "qom-get",
3369 .args_type = "path:s,property:s",
3370 .mhandler.cmd_new = qmp_qom_get,
3371 },
270b243f 3372
6dd844db
PB
3373 {
3374 .name = "nbd-server-start",
3375 .args_type = "addr:q",
3376 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3377 },
3378 {
3379 .name = "nbd-server-add",
3380 .args_type = "device:B,writable:b?",
3381 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3382 },
3383 {
3384 .name = "nbd-server-stop",
3385 .args_type = "",
3386 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3387 },
3388
270b243f
LC
3389 {
3390 .name = "change-vnc-password",
3391 .args_type = "password:s",
3392 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3393 },
5eeee3fa
AL
3394 {
3395 .name = "qom-list-types",
3396 .args_type = "implements:s?,abstract:b?",
3397 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3398 },
1daa31b9
AL
3399
3400 {
3401 .name = "device-list-properties",
3402 .args_type = "typename:s",
3403 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3404 },
3405
01d3c80d
AL
3406 {
3407 .name = "query-machines",
3408 .args_type = "",
3409 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3410 },
3411
e4e31c63
AL
3412 {
3413 .name = "query-cpu-definitions",
3414 .args_type = "",
3415 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3416 },
3417
99afc91d
DB
3418 {
3419 .name = "query-target",
3420 .args_type = "",
3421 .mhandler.cmd_new = qmp_marshal_input_query_target,
3422 },
f1a1a356 3423
d1a0cf73
SB
3424 {
3425 .name = "query-tpm",
3426 .args_type = "",
3427 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3428 },
3429
28c4fa32
CB
3430SQMP
3431query-tpm
3432---------
3433
3434Return information about the TPM device.
3435
3436Arguments: None
3437
3438Example:
3439
3440-> { "execute": "query-tpm" }
3441<- { "return":
3442 [
3443 { "model": "tpm-tis",
3444 "options":
3445 { "type": "passthrough",
3446 "data":
3447 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3448 "path": "/dev/tpm0"
3449 }
3450 },
3451 "id": "tpm0"
3452 }
3453 ]
3454 }
3455
3456EQMP
3457
d1a0cf73
SB
3458 {
3459 .name = "query-tpm-models",
3460 .args_type = "",
3461 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3462 },
3463
28c4fa32
CB
3464SQMP
3465query-tpm-models
3466----------------
3467
3468Return a list of supported TPM models.
3469
3470Arguments: None
3471
3472Example:
3473
3474-> { "execute": "query-tpm-models" }
3475<- { "return": [ "tpm-tis" ] }
3476
3477EQMP
3478
d1a0cf73
SB
3479 {
3480 .name = "query-tpm-types",
3481 .args_type = "",
3482 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3483 },
3484
28c4fa32
CB
3485SQMP
3486query-tpm-types
3487---------------
3488
3489Return a list of supported TPM types.
3490
3491Arguments: None
3492
3493Example:
3494
3495-> { "execute": "query-tpm-types" }
3496<- { "return": [ "passthrough" ] }
3497
3498EQMP
3499
f1a1a356
GH
3500 {
3501 .name = "chardev-add",
3502 .args_type = "id:s,backend:q",
3503 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3504 },
3505
3506SQMP
3507chardev-add
3508----------------
3509
3510Add a chardev.
3511
3512Arguments:
3513
3514- "id": the chardev's ID, must be unique (json-string)
3515- "backend": chardev backend type + parameters
3516
ffbdbe59 3517Examples:
f1a1a356
GH
3518
3519-> { "execute" : "chardev-add",
3520 "arguments" : { "id" : "foo",
3521 "backend" : { "type" : "null", "data" : {} } } }
3522<- { "return": {} }
3523
ffbdbe59
GH
3524-> { "execute" : "chardev-add",
3525 "arguments" : { "id" : "bar",
3526 "backend" : { "type" : "file",
3527 "data" : { "out" : "/tmp/bar.log" } } } }
3528<- { "return": {} }
3529
0a1a7fab
GH
3530-> { "execute" : "chardev-add",
3531 "arguments" : { "id" : "baz",
3532 "backend" : { "type" : "pty", "data" : {} } } }
3533<- { "return": { "pty" : "/dev/pty/42" } }
3534
f1a1a356
GH
3535EQMP
3536
3537 {
3538 .name = "chardev-remove",
3539 .args_type = "id:s",
3540 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3541 },
3542
3543
3544SQMP
3545chardev-remove
3546--------------
3547
3548Remove a chardev.
3549
3550Arguments:
3551
3552- "id": the chardev's ID, must exist and not be in use (json-string)
3553
3554Example:
3555
3556-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3557<- { "return": {} }
3558
b1be4280
AK
3559EQMP
3560 {
3561 .name = "query-rx-filter",
3562 .args_type = "name:s?",
3563 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3564 },
3565
3566SQMP
3567query-rx-filter
3568---------------
3569
3570Show rx-filter information.
3571
3572Returns a json-array of rx-filter information for all NICs (or for the
3573given NIC), returning an error if the given NIC doesn't exist, or
3574given NIC doesn't support rx-filter querying, or given net client
3575isn't a NIC.
3576
3577The query will clear the event notification flag of each NIC, then qemu
3578will start to emit event to QMP monitor.
3579
3580Each array entry contains the following:
3581
3582- "name": net client name (json-string)
3583- "promiscuous": promiscuous mode is enabled (json-bool)
3584- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3585- "unicast": unicast receive state (one of 'normal', 'none', 'all')
f7bc8ef8 3586- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
b1be4280
AK
3587- "broadcast-allowed": allow to receive broadcast (json-bool)
3588- "multicast-overflow": multicast table is overflowed (json-bool)
3589- "unicast-overflow": unicast table is overflowed (json-bool)
3590- "main-mac": main macaddr string (json-string)
3591- "vlan-table": a json-array of active vlan id
3592- "unicast-table": a json-array of unicast macaddr string
3593- "multicast-table": a json-array of multicast macaddr string
3594
3595Example:
3596
3597-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3598<- { "return": [
3599 {
3600 "promiscuous": true,
3601 "name": "vnet0",
3602 "main-mac": "52:54:00:12:34:56",
3603 "unicast": "normal",
f7bc8ef8 3604 "vlan": "normal",
b1be4280
AK
3605 "vlan-table": [
3606 4,
3607 0
3608 ],
3609 "unicast-table": [
3610 ],
3611 "multicast": "normal",
3612 "multicast-overflow": false,
3613 "unicast-overflow": false,
3614 "multicast-table": [
3615 "01:00:5e:00:00:01",
3616 "33:33:00:00:00:01",
3617 "33:33:ff:12:34:56"
3618 ],
3619 "broadcast-allowed": false
3620 }
3621 ]
3622 }
3623
d26c9a15
KW
3624EQMP
3625
3626 {
3627 .name = "blockdev-add",
3628 .args_type = "options:q",
3629 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3630 },
3631
3632SQMP
3633blockdev-add
3634------------
3635
3636Add a block device.
3637
da2cf4e8
MA
3638This command is still a work in progress. It doesn't support all
3639block drivers, it lacks a matching blockdev-del, and more. Stay away
3640from it unless you want to help with its development.
3641
d26c9a15
KW
3642Arguments:
3643
3644- "options": block driver options
3645
3646Example (1):
3647
3648-> { "execute": "blockdev-add",
3649 "arguments": { "options" : { "driver": "qcow2",
3650 "file": { "driver": "file",
3651 "filename": "test.qcow2" } } } }
3652<- { "return": {} }
3653
3654Example (2):
3655
3656-> { "execute": "blockdev-add",
3657 "arguments": {
3658 "options": {
3659 "driver": "qcow2",
3660 "id": "my_disk",
3661 "discard": "unmap",
3662 "cache": {
3663 "direct": true,
3664 "writeback": true
3665 },
3666 "file": {
3667 "driver": "file",
3668 "filename": "/tmp/test.qcow2"
3669 },
3670 "backing": {
3671 "driver": "raw",
3672 "file": {
3673 "driver": "file",
3674 "filename": "/dev/fdset/4"
3675 }
3676 }
3677 }
3678 }
3679 }
3680
3681<- { "return": {} }
3682
c13163fb
BC
3683EQMP
3684
3685 {
3686 .name = "query-named-block-nodes",
3687 .args_type = "",
3688 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3689 },
3690
3691SQMP
3692@query-named-block-nodes
3693------------------------
3694
3695Return a list of BlockDeviceInfo for all the named block driver nodes
3696
3697Example:
3698
3699-> { "execute": "query-named-block-nodes" }
3700<- { "return": [ { "ro":false,
3701 "drv":"qcow2",
3702 "encrypted":false,
3703 "file":"disks/test.qcow2",
3704 "node-name": "my-node",
3705 "backing_file_depth":1,
3706 "bps":1000000,
3707 "bps_rd":0,
3708 "bps_wr":0,
3709 "iops":1000000,
3710 "iops_rd":0,
3711 "iops_wr":0,
3712 "bps_max": 8000000,
3713 "bps_rd_max": 0,
3714 "bps_wr_max": 0,
3715 "iops_max": 0,
3716 "iops_rd_max": 0,
3717 "iops_wr_max": 0,
3718 "iops_size": 0,
e2462113 3719 "write_threshold": 0,
c13163fb
BC
3720 "image":{
3721 "filename":"disks/test.qcow2",
3722 "format":"qcow2",
3723 "virtual-size":2048000,
3724 "backing_file":"base.qcow2",
3725 "full-backing-filename":"disks/base.qcow2",
3726 "backing-filename-format:"qcow2",
3727 "snapshots":[
3728 {
3729 "id": "1",
3730 "name": "snapshot1",
3731 "vm-state-size": 0,
3732 "date-sec": 10000200,
3733 "date-nsec": 12,
3734 "vm-clock-sec": 206,
3735 "vm-clock-nsec": 30
3736 }
3737 ],
3738 "backing-image":{
3739 "filename":"disks/base.qcow2",
3740 "format":"qcow2",
3741 "virtual-size":2048000
3742 }
c059451c 3743 } } ] }
c13163fb 3744
76b5d850
HT
3745EQMP
3746
3747 {
3748 .name = "query-memdev",
3749 .args_type = "",
3750 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3751 },
3752
3753SQMP
3754query-memdev
3755------------
3756
3757Show memory devices information.
3758
3759
3760Example (1):
3761
3762-> { "execute": "query-memdev" }
3763<- { "return": [
3764 {
3765 "size": 536870912,
3766 "merge": false,
3767 "dump": true,
3768 "prealloc": false,
3769 "host-nodes": [0, 1],
3770 "policy": "bind"
3771 },
3772 {
3773 "size": 536870912,
3774 "merge": false,
3775 "dump": true,
3776 "prealloc": true,
3777 "host-nodes": [2, 3],
3778 "policy": "preferred"
3779 }
3780 ]
3781 }
3782
6f2e2730
IM
3783EQMP
3784
3785 {
3786 .name = "query-memory-devices",
3787 .args_type = "",
3788 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3789 },
3790
3791SQMP
3792@query-memory-devices
3793--------------------
3794
3795Return a list of memory devices.
3796
3797Example:
3798-> { "execute": "query-memory-devices" }
3799<- { "return": [ { "data":
3800 { "addr": 5368709120,
3801 "hotpluggable": true,
3802 "hotplugged": true,
3803 "id": "d1",
3804 "memdev": "/objects/memX",
3805 "node": 0,
3806 "size": 1073741824,
3807 "slot": 0},
3808 "type": "dimm"
3809 } ] }
f1a1a356 3810EQMP
02419bcb
IM
3811
3812 {
3813 .name = "query-acpi-ospm-status",
3814 .args_type = "",
3815 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3816 },
3817
3818SQMP
3819@query-acpi-ospm-status
3820--------------------
3821
3822Return list of ACPIOSTInfo for devices that support status reporting
3823via ACPI _OST method.
3824
3825Example:
3826-> { "execute": "query-acpi-ospm-status" }
3827<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3828 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3829 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3830 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3831 ]}
3832EQMP
f2ae8abf
MT
3833
3834#if defined TARGET_I386
3835 {
3836 .name = "rtc-reset-reinjection",
3837 .args_type = "",
3838 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3839 },
3840#endif
3841
3842SQMP
3843rtc-reset-reinjection
3844---------------------
3845
3846Reset the RTC interrupt reinjection backlog.
3847
3848Arguments: None.
3849
3850Example:
3851
3852-> { "execute": "rtc-reset-reinjection" }
3853<- { "return": {} }
1dde0f48
LV
3854EQMP
3855
3856 {
3857 .name = "trace-event-get-state",
3858 .args_type = "name:s",
3859 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
3860 },
3861
3862SQMP
3863trace-event-get-state
3864---------------------
3865
3866Query the state of events.
3867
3868Example:
3869
3870-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3871<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
3872EQMP
3873
3874 {
3875 .name = "trace-event-set-state",
3876 .args_type = "name:s,enable:b,ignore-unavailable:b?",
3877 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
3878 },
f2ae8abf 3879
1dde0f48
LV
3880SQMP
3881trace-event-set-state
3882---------------------
3883
3884Set the state of events.
3885
3886Example:
3887
3888-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3889<- { "return": {} }
50c6617f
MT
3890EQMP
3891
3892 {
df5b2adb 3893 .name = "x-input-send-event",
51fc4476 3894 .args_type = "console:i?,events:q",
df5b2adb 3895 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
50c6617f
MT
3896 },
3897
3898SQMP
df5b2adb 3899@x-input-send-event
50c6617f
MT
3900-----------------
3901
3902Send input event to guest.
3903
3904Arguments:
3905
51fc4476 3906- "console": console index. (json-int, optional)
50c6617f
MT
3907- "events": list of input events.
3908
3909The consoles are visible in the qom tree, under
3910/backend/console[$index]. They have a device link and head property, so
3911it is possible to map which console belongs to which device and display.
3912
df5b2adb
GH
3913Note: this command is experimental, and not a stable API.
3914
50c6617f
MT
3915Example (1):
3916
3917Press left mouse button.
3918
df5b2adb 3919-> { "execute": "x-input-send-event",
50c6617f
MT
3920 "arguments": { "console": 0,
3921 "events": [ { "type": "btn",
b5369dd8 3922 "data" : { "down": true, "button": "Left" } } ] } }
50c6617f
MT
3923<- { "return": {} }
3924
df5b2adb 3925-> { "execute": "x-input-send-event",
50c6617f
MT
3926 "arguments": { "console": 0,
3927 "events": [ { "type": "btn",
b5369dd8 3928 "data" : { "down": false, "button": "Left" } } ] } }
50c6617f
MT
3929<- { "return": {} }
3930
3931Example (2):
3932
3933Press ctrl-alt-del.
3934
df5b2adb 3935-> { "execute": "x-input-send-event",
50c6617f
MT
3936 "arguments": { "console": 0, "events": [
3937 { "type": "key", "data" : { "down": true,
3938 "key": {"type": "qcode", "data": "ctrl" } } },
3939 { "type": "key", "data" : { "down": true,
3940 "key": {"type": "qcode", "data": "alt" } } },
3941 { "type": "key", "data" : { "down": true,
3942 "key": {"type": "qcode", "data": "delete" } } } ] } }
3943<- { "return": {} }
3944
3945Example (3):
3946
3947Move mouse pointer to absolute coordinates (20000, 400).
3948
df5b2adb 3949-> { "execute": "x-input-send-event" ,
50c6617f
MT
3950 "arguments": { "console": 0, "events": [
3951 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
3952 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
3953<- { "return": {} }
3954
e2462113
FR
3955EQMP
3956
3957 {
3958 .name = "block-set-write-threshold",
3959 .args_type = "node-name:s,write-threshold:l",
3960 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
3961 },
3962
3963SQMP
3964block-set-write-threshold
3965------------
3966
3967Change the write threshold for a block drive. The threshold is an offset,
3968thus must be non-negative. Default is no write threshold.
3969Setting the threshold to zero disables it.
3970
3971Arguments:
3972
3973- "node-name": the node name in the block driver state graph (json-string)
3974- "write-threshold": the write threshold in bytes (json-int)
3975
3976Example:
3977
3978-> { "execute": "block-set-write-threshold",
3979 "arguments": { "node-name": "mydev",
3980 "write-threshold": 17179869184 } }
3981<- { "return": {} }
3982
f2ae8abf 3983EQMP