X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/dbca1b3773185af0413e750f26d04b0110cff107..25690739f1f067b6d8b2e616d87b1d976db0db92:/qmp-commands.hx diff --git a/qmp-commands.hx b/qmp-commands.hx index bbb21f3583..4d65422c40 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -466,32 +466,30 @@ Note: inject-nmi fails when the guest doesn't support injecting. EQMP { - .name = "memchar-write", - .args_type = "device:s,size:i,data:s,format:s?", - .mhandler.cmd_new = qmp_marshal_input_memchar_write, + .name = "ringbuf-write", + .args_type = "device:s,data:s,format:s?", + .mhandler.cmd_new = qmp_marshal_input_ringbuf_write, }, SQMP -memchar-write +ringbuf-write ------------- -Provide writing interface for CirMemCharDriver. Write data to memory -char device. +Write to a ring buffer character device. Arguments: -- "device": the name of the char device, must be unique (json-string) -- "size": the memory size, in bytes, should be power of 2 (json-int) -- "data": the source data write to memory (json-string) -- "format": the data format write to memory, default is - utf8. (json-string, optional) - - Possible values: "utf8", "base64" +- "device": ring buffer character device name (json-string) +- "data": data to write (json-string) +- "format": data format (json-string, optional) + - Possible values: "utf8" (default), "base64" + Bug: invalid base64 is currently not rejected. + Whitespace *is* invalid. Example: --> { "execute": "memchar-write", - "arguments": { "device": foo, - "size": 8, +-> { "execute": "ringbuf-write", + "arguments": { "device": "foo", "data": "abcdefgh", "format": "utf8" } } <- { "return": {} } @@ -499,35 +497,38 @@ Example: EQMP { - .name = "memchar-read", + .name = "ringbuf-read", .args_type = "device:s,size:i,format:s?", - .mhandler.cmd_new = qmp_marshal_input_memchar_read, + .mhandler.cmd_new = qmp_marshal_input_ringbuf_read, }, SQMP -memchar-read +ringbuf-read ------------- -Provide read interface for CirMemCharDriver. Read from the char -device memory and return the data with size. +Read from a ring buffer character device. Arguments: -- "device": the name of the char device, must be unique (json-string) -- "size": the memory size wanted to read in bytes (refer to unencoded - size of the raw data), would adjust to the init size of the - memchar if the requested size is larger than it. (json-int) -- "format": the data format write to memchardev, default is - utf8. (json-string, optional) - - Possible values: "utf8", "base64" +- "device": ring buffer character device name (json-string) +- "size": how many bytes to read at most (json-int) + - Number of data bytes, not number of characters in encoded data +- "format": data format (json-string, optional) + - Possible values: "utf8" (default), "base64" + - Naturally, format "utf8" works only when the ring buffer + contains valid UTF-8 text. Invalid UTF-8 sequences get + replaced. Bug: replacement doesn't work. Bug: can screw + up on encountering NUL characters, after the ring buffer + lost data, and when reading stops because the size limit + is reached. Example: --> { "execute": "memchar-read", - "arguments": { "device": foo, +-> { "execute": "ringbuf-read", + "arguments": { "device": "foo", "size": 1000, "format": "utf8" } } -<- { "return": { "data": "data string...", "count": 1000 } } +<- {"return": "abcdefgh"} EQMP @@ -643,7 +644,7 @@ EQMP SQMP migrate-set-cache-size ---------------------- +---------------------- Set cache size to be used by XBZRLE migration, the cache size will be rounded down to the nearest power of 2 @@ -666,7 +667,7 @@ EQMP SQMP query-migrate-cache-size ---------------------- +------------------------ Show cache size to be used by XBZRLE migration @@ -821,7 +822,7 @@ Example: -> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } } <- { "return": {} } -Note: The supported device options are the same ones supported by the '-net' +Note: The supported device options are the same ones supported by the '-netdev' command-line argument, which are listed in the '-help' output or QEMU's manual @@ -2430,32 +2431,43 @@ The main json-object contains the following: - Possible values: "active", "completed", "failed", "cancelled" - "total-time": total amount of ms since migration started. If migration has ended, it returns the total migration - time (json-int) + time (json-int) - "downtime": only present when migration has finished correctly total amount in ms for downtime that happened (json-int) - "expected-downtime": only present while migration is active total amount in ms for downtime that was calculated on - the last bitmap round (json-int) + the last bitmap round (json-int) - "ram": only present if "status" is "active", it is a json-object with the - following RAM information (in bytes): - - "transferred": amount transferred (json-int) - - "remaining": amount remaining (json-int) - - "total": total (json-int) - - "duplicate": number of duplicated pages (json-int) - - "normal" : number of normal pages transferred (json-int) - - "normal-bytes" : number of normal bytes transferred (json-int) + following RAM information: + - "transferred": amount transferred in bytes (json-int) + - "remaining": amount remaining to transfer in bytes (json-int) + - "total": total amount of memory in bytes (json-int) + - "duplicate": number of pages filled entirely with the same + byte (json-int) + These are sent over the wire much more efficiently. + - "skipped": number of skipped zero pages (json-int) + - "normal" : number of whole pages transfered. I.e. they + were not sent as duplicate or xbzrle pages (json-int) + - "normal-bytes" : number of bytes transferred in whole + pages. This is just normal pages times size of one page, + but this way upper levels don't need to care about page + size (json-int) - "disk": only present if "status" is "active" and it is a block migration, - it is a json-object with the following disk information (in bytes): - - "transferred": amount transferred (json-int) - - "remaining": amount remaining (json-int) - - "total": total (json-int) + it is a json-object with the following disk information: + - "transferred": amount transferred in bytes (json-int) + - "remaining": amount remaining to transfer in bytes json-int) + - "total": total disk size in bytes (json-int) - "xbzrle-cache": only present if XBZRLE is active. It is a json-object with the following XBZRLE information: - - "cache-size": XBZRLE cache size - - "bytes": total XBZRLE bytes transferred + - "cache-size": XBZRLE cache size in bytes + - "bytes": number of bytes transferred for XBZRLE compressed pages - "pages": number of XBZRLE compressed pages - - "cache-miss": number of cache misses - - "overflow": number of XBZRLE overflows + - "cache-miss": number of XBRZRLE page cache misses + - "overflow": number of times XBZRLE overflows. This means + that the XBZRLE encoding was bigger than just sent the + whole page, and then we sent the whole page instead (as as + normal page). + Examples: 1. Before the first migration @@ -2566,11 +2578,11 @@ EQMP SQMP migrate-set-capabilities -------- +------------------------ Enable/Disable migration capabilities -- "xbzrle": xbzrle support +- "xbzrle": XBZRLE support Arguments: @@ -2589,7 +2601,7 @@ EQMP }, SQMP query-migrate-capabilities -------- +-------------------------- Query current migration capabilities @@ -2714,6 +2726,82 @@ EQMP .mhandler.cmd_new = qmp_marshal_input_query_target, }, + { + .name = "query-tpm", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_query_tpm, + }, + +SQMP +query-tpm +--------- + +Return information about the TPM device. + +Arguments: None + +Example: + +-> { "execute": "query-tpm" } +<- { "return": + [ + { "model": "tpm-tis", + "options": + { "type": "passthrough", + "data": + { "cancel-path": "/sys/class/misc/tpm0/device/cancel", + "path": "/dev/tpm0" + } + }, + "id": "tpm0" + } + ] + } + +EQMP + + { + .name = "query-tpm-models", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_query_tpm_models, + }, + +SQMP +query-tpm-models +---------------- + +Return a list of supported TPM models. + +Arguments: None + +Example: + +-> { "execute": "query-tpm-models" } +<- { "return": [ "tpm-tis" ] } + +EQMP + + { + .name = "query-tpm-types", + .args_type = "", + .mhandler.cmd_new = qmp_marshal_input_query_tpm_types, + }, + +SQMP +query-tpm-types +--------------- + +Return a list of supported TPM types. + +Arguments: None + +Example: + +-> { "execute": "query-tpm-types" } +<- { "return": [ "passthrough" ] } + +EQMP + { .name = "chardev-add", .args_type = "id:s,backend:q",