qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qapi-schema: Collect char device stuff in qapi/char.json

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503602048-12268-7-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

+541 -531
+1
MAINTAINERS
··· 1253 1253 S: Maintained 1254 1254 F: chardev/ 1255 1255 F: include/chardev/ 1256 + F: qapi/char.json 1256 1257 1257 1258 Character Devices (Braille) 1258 1259 M: Samuel Thibault <samuel.thibault@ens-lyon.org>
+1
Makefile
··· 410 410 411 411 qapi-modules = $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/qapi/common.json \ 412 412 $(SRC_PATH)/qapi/block.json $(SRC_PATH)/qapi/block-core.json \ 413 + $(SRC_PATH)/qapi/char.json \ 413 414 $(SRC_PATH)/qapi/crypto.json \ 414 415 $(SRC_PATH)/qapi/event.json $(SRC_PATH)/qapi/introspect.json \ 415 416 $(SRC_PATH)/qapi/rocker.json \
+1 -510
qapi-schema.json
··· 83 83 { 'include': 'qapi/run-state.json' } 84 84 { 'include': 'qapi/crypto.json' } 85 85 { 'include': 'qapi/block.json' } 86 + { 'include': 'qapi/char.json' } 86 87 { 'include': 'qapi/rocker.json' } 87 88 { 'include': 'qapi/event.json' } 88 89 { 'include': 'qapi/trace.json' } ··· 272 273 # 273 274 ## 274 275 { 'command': 'query-uuid', 'returns': 'UuidInfo' } 275 - 276 - ## 277 - # @ChardevInfo: 278 - # 279 - # Information about a character device. 280 - # 281 - # @label: the label of the character device 282 - # 283 - # @filename: the filename of the character device 284 - # 285 - # @frontend-open: shows whether the frontend device attached to this backend 286 - # (eg. with the chardev=... option) is in open or closed state 287 - # (since 2.1) 288 - # 289 - # Notes: @filename is encoded using the QEMU command line character device 290 - # encoding. See the QEMU man page for details. 291 - # 292 - # Since: 0.14.0 293 - ## 294 - { 'struct': 'ChardevInfo', 'data': {'label': 'str', 295 - 'filename': 'str', 296 - 'frontend-open': 'bool'} } 297 - 298 - ## 299 - # @query-chardev: 300 - # 301 - # Returns information about current character devices. 302 - # 303 - # Returns: a list of @ChardevInfo 304 - # 305 - # Since: 0.14.0 306 - # 307 - # Example: 308 - # 309 - # -> { "execute": "query-chardev" } 310 - # <- { 311 - # "return": [ 312 - # { 313 - # "label": "charchannel0", 314 - # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server", 315 - # "frontend-open": false 316 - # }, 317 - # { 318 - # "label": "charmonitor", 319 - # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server", 320 - # "frontend-open": true 321 - # }, 322 - # { 323 - # "label": "charserial0", 324 - # "filename": "pty:/dev/pts/2", 325 - # "frontend-open": true 326 - # } 327 - # ] 328 - # } 329 - # 330 - ## 331 - { 'command': 'query-chardev', 'returns': ['ChardevInfo'] } 332 - 333 - ## 334 - # @ChardevBackendInfo: 335 - # 336 - # Information about a character device backend 337 - # 338 - # @name: The backend name 339 - # 340 - # Since: 2.0 341 - ## 342 - { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} } 343 - 344 - ## 345 - # @query-chardev-backends: 346 - # 347 - # Returns information about character device backends. 348 - # 349 - # Returns: a list of @ChardevBackendInfo 350 - # 351 - # Since: 2.0 352 - # 353 - # Example: 354 - # 355 - # -> { "execute": "query-chardev-backends" } 356 - # <- { 357 - # "return":[ 358 - # { 359 - # "name":"udp" 360 - # }, 361 - # { 362 - # "name":"tcp" 363 - # }, 364 - # { 365 - # "name":"unix" 366 - # }, 367 - # { 368 - # "name":"spiceport" 369 - # } 370 - # ] 371 - # } 372 - # 373 - ## 374 - { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] } 375 - 376 - ## 377 - # @DataFormat: 378 - # 379 - # An enumeration of data format. 380 - # 381 - # @utf8: Data is a UTF-8 string (RFC 3629) 382 - # 383 - # @base64: Data is Base64 encoded binary (RFC 3548) 384 - # 385 - # Since: 1.4 386 - ## 387 - { 'enum': 'DataFormat', 388 - 'data': [ 'utf8', 'base64' ] } 389 - 390 - ## 391 - # @ringbuf-write: 392 - # 393 - # Write to a ring buffer character device. 394 - # 395 - # @device: the ring buffer character device name 396 - # 397 - # @data: data to write 398 - # 399 - # @format: data encoding (default 'utf8'). 400 - # - base64: data must be base64 encoded text. Its binary 401 - # decoding gets written. 402 - # - utf8: data's UTF-8 encoding is written 403 - # - data itself is always Unicode regardless of format, like 404 - # any other string. 405 - # 406 - # Returns: Nothing on success 407 - # 408 - # Since: 1.4 409 - # 410 - # Example: 411 - # 412 - # -> { "execute": "ringbuf-write", 413 - # "arguments": { "device": "foo", 414 - # "data": "abcdefgh", 415 - # "format": "utf8" } } 416 - # <- { "return": {} } 417 - # 418 - ## 419 - { 'command': 'ringbuf-write', 420 - 'data': {'device': 'str', 'data': 'str', 421 - '*format': 'DataFormat'} } 422 - 423 - ## 424 - # @ringbuf-read: 425 - # 426 - # Read from a ring buffer character device. 427 - # 428 - # @device: the ring buffer character device name 429 - # 430 - # @size: how many bytes to read at most 431 - # 432 - # @format: data encoding (default 'utf8'). 433 - # - base64: the data read is returned in base64 encoding. 434 - # - utf8: the data read is interpreted as UTF-8. 435 - # Bug: can screw up when the buffer contains invalid UTF-8 436 - # sequences, NUL characters, after the ring buffer lost 437 - # data, and when reading stops because the size limit is 438 - # reached. 439 - # - The return value is always Unicode regardless of format, 440 - # like any other string. 441 - # 442 - # Returns: data read from the device 443 - # 444 - # Since: 1.4 445 - # 446 - # Example: 447 - # 448 - # -> { "execute": "ringbuf-read", 449 - # "arguments": { "device": "foo", 450 - # "size": 1000, 451 - # "format": "utf8" } } 452 - # <- { "return": "abcdefgh" } 453 - # 454 - ## 455 - { 'command': 'ringbuf-read', 456 - 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'}, 457 - 'returns': 'str' } 458 276 459 277 ## 460 278 # @EventInfo: ··· 4710 4528 # 4711 4529 ## 4712 4530 { 'command': 'screendump', 'data': {'filename': 'str'} } 4713 - 4714 - 4715 - ## 4716 - # @ChardevCommon: 4717 - # 4718 - # Configuration shared across all chardev backends 4719 - # 4720 - # @logfile: The name of a logfile to save output 4721 - # @logappend: true to append instead of truncate 4722 - # (default to false to truncate) 4723 - # 4724 - # Since: 2.6 4725 - ## 4726 - { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str', 4727 - '*logappend': 'bool' } } 4728 - 4729 - ## 4730 - # @ChardevFile: 4731 - # 4732 - # Configuration info for file chardevs. 4733 - # 4734 - # @in: The name of the input file 4735 - # @out: The name of the output file 4736 - # @append: Open the file in append mode (default false to 4737 - # truncate) (Since 2.6) 4738 - # 4739 - # Since: 1.4 4740 - ## 4741 - { 'struct': 'ChardevFile', 'data': { '*in' : 'str', 4742 - 'out' : 'str', 4743 - '*append': 'bool' }, 4744 - 'base': 'ChardevCommon' } 4745 - 4746 - ## 4747 - # @ChardevHostdev: 4748 - # 4749 - # Configuration info for device and pipe chardevs. 4750 - # 4751 - # @device: The name of the special file for the device, 4752 - # i.e. /dev/ttyS0 on Unix or COM1: on Windows 4753 - # 4754 - # Since: 1.4 4755 - ## 4756 - { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' }, 4757 - 'base': 'ChardevCommon' } 4758 - 4759 - ## 4760 - # @ChardevSocket: 4761 - # 4762 - # Configuration info for (stream) socket chardevs. 4763 - # 4764 - # @addr: socket address to listen on (server=true) 4765 - # or connect to (server=false) 4766 - # @tls-creds: the ID of the TLS credentials object (since 2.6) 4767 - # @server: create server socket (default: true) 4768 - # @wait: wait for incoming connection on server 4769 - # sockets (default: false). 4770 - # @nodelay: set TCP_NODELAY socket option (default: false) 4771 - # @telnet: enable telnet protocol on server 4772 - # sockets (default: false) 4773 - # @tn3270: enable tn3270 protocol on server 4774 - # sockets (default: false) (Since: 2.10) 4775 - # @reconnect: For a client socket, if a socket is disconnected, 4776 - # then attempt a reconnect after the given number of seconds. 4777 - # Setting this to zero disables this function. (default: 0) 4778 - # (Since: 2.2) 4779 - # 4780 - # Since: 1.4 4781 - ## 4782 - { 'struct': 'ChardevSocket', 'data': { 'addr' : 'SocketAddressLegacy', 4783 - '*tls-creds' : 'str', 4784 - '*server' : 'bool', 4785 - '*wait' : 'bool', 4786 - '*nodelay' : 'bool', 4787 - '*telnet' : 'bool', 4788 - '*tn3270' : 'bool', 4789 - '*reconnect' : 'int' }, 4790 - 'base': 'ChardevCommon' } 4791 - 4792 - ## 4793 - # @ChardevUdp: 4794 - # 4795 - # Configuration info for datagram socket chardevs. 4796 - # 4797 - # @remote: remote address 4798 - # @local: local address 4799 - # 4800 - # Since: 1.5 4801 - ## 4802 - { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy', 4803 - '*local' : 'SocketAddressLegacy' }, 4804 - 'base': 'ChardevCommon' } 4805 - 4806 - ## 4807 - # @ChardevMux: 4808 - # 4809 - # Configuration info for mux chardevs. 4810 - # 4811 - # @chardev: name of the base chardev. 4812 - # 4813 - # Since: 1.5 4814 - ## 4815 - { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' }, 4816 - 'base': 'ChardevCommon' } 4817 - 4818 - ## 4819 - # @ChardevStdio: 4820 - # 4821 - # Configuration info for stdio chardevs. 4822 - # 4823 - # @signal: Allow signals (such as SIGINT triggered by ^C) 4824 - # be delivered to qemu. Default: true in -nographic mode, 4825 - # false otherwise. 4826 - # 4827 - # Since: 1.5 4828 - ## 4829 - { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' }, 4830 - 'base': 'ChardevCommon' } 4831 - 4832 - 4833 - ## 4834 - # @ChardevSpiceChannel: 4835 - # 4836 - # Configuration info for spice vm channel chardevs. 4837 - # 4838 - # @type: kind of channel (for example vdagent). 4839 - # 4840 - # Since: 1.5 4841 - ## 4842 - { 'struct': 'ChardevSpiceChannel', 'data': { 'type' : 'str' }, 4843 - 'base': 'ChardevCommon' } 4844 - 4845 - ## 4846 - # @ChardevSpicePort: 4847 - # 4848 - # Configuration info for spice port chardevs. 4849 - # 4850 - # @fqdn: name of the channel (see docs/spice-port-fqdn.txt) 4851 - # 4852 - # Since: 1.5 4853 - ## 4854 - { 'struct': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' }, 4855 - 'base': 'ChardevCommon' } 4856 - 4857 - ## 4858 - # @ChardevVC: 4859 - # 4860 - # Configuration info for virtual console chardevs. 4861 - # 4862 - # @width: console width, in pixels 4863 - # @height: console height, in pixels 4864 - # @cols: console width, in chars 4865 - # @rows: console height, in chars 4866 - # 4867 - # Since: 1.5 4868 - ## 4869 - { 'struct': 'ChardevVC', 'data': { '*width' : 'int', 4870 - '*height' : 'int', 4871 - '*cols' : 'int', 4872 - '*rows' : 'int' }, 4873 - 'base': 'ChardevCommon' } 4874 - 4875 - ## 4876 - # @ChardevRingbuf: 4877 - # 4878 - # Configuration info for ring buffer chardevs. 4879 - # 4880 - # @size: ring buffer size, must be power of two, default is 65536 4881 - # 4882 - # Since: 1.5 4883 - ## 4884 - { 'struct': 'ChardevRingbuf', 'data': { '*size' : 'int' }, 4885 - 'base': 'ChardevCommon' } 4886 - 4887 - ## 4888 - # @ChardevBackend: 4889 - # 4890 - # Configuration info for the new chardev backend. 4891 - # 4892 - # Since: 1.4 (testdev since 2.2, wctablet since 2.9) 4893 - ## 4894 - { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile', 4895 - 'serial' : 'ChardevHostdev', 4896 - 'parallel': 'ChardevHostdev', 4897 - 'pipe' : 'ChardevHostdev', 4898 - 'socket' : 'ChardevSocket', 4899 - 'udp' : 'ChardevUdp', 4900 - 'pty' : 'ChardevCommon', 4901 - 'null' : 'ChardevCommon', 4902 - 'mux' : 'ChardevMux', 4903 - 'msmouse': 'ChardevCommon', 4904 - 'wctablet' : 'ChardevCommon', 4905 - 'braille': 'ChardevCommon', 4906 - 'testdev': 'ChardevCommon', 4907 - 'stdio' : 'ChardevStdio', 4908 - 'console': 'ChardevCommon', 4909 - 'spicevmc' : 'ChardevSpiceChannel', 4910 - 'spiceport' : 'ChardevSpicePort', 4911 - 'vc' : 'ChardevVC', 4912 - 'ringbuf': 'ChardevRingbuf', 4913 - # next one is just for compatibility 4914 - 'memory' : 'ChardevRingbuf' } } 4915 - 4916 - ## 4917 - # @ChardevReturn: 4918 - # 4919 - # Return info about the chardev backend just created. 4920 - # 4921 - # @pty: name of the slave pseudoterminal device, present if 4922 - # and only if a chardev of type 'pty' was created 4923 - # 4924 - # Since: 1.4 4925 - ## 4926 - { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } } 4927 - 4928 - ## 4929 - # @chardev-add: 4930 - # 4931 - # Add a character device backend 4932 - # 4933 - # @id: the chardev's ID, must be unique 4934 - # @backend: backend type and parameters 4935 - # 4936 - # Returns: ChardevReturn. 4937 - # 4938 - # Since: 1.4 4939 - # 4940 - # Example: 4941 - # 4942 - # -> { "execute" : "chardev-add", 4943 - # "arguments" : { "id" : "foo", 4944 - # "backend" : { "type" : "null", "data" : {} } } } 4945 - # <- { "return": {} } 4946 - # 4947 - # -> { "execute" : "chardev-add", 4948 - # "arguments" : { "id" : "bar", 4949 - # "backend" : { "type" : "file", 4950 - # "data" : { "out" : "/tmp/bar.log" } } } } 4951 - # <- { "return": {} } 4952 - # 4953 - # -> { "execute" : "chardev-add", 4954 - # "arguments" : { "id" : "baz", 4955 - # "backend" : { "type" : "pty", "data" : {} } } } 4956 - # <- { "return": { "pty" : "/dev/pty/42" } } 4957 - # 4958 - ## 4959 - { 'command': 'chardev-add', 'data': {'id' : 'str', 4960 - 'backend' : 'ChardevBackend' }, 4961 - 'returns': 'ChardevReturn' } 4962 - 4963 - ## 4964 - # @chardev-change: 4965 - # 4966 - # Change a character device backend 4967 - # 4968 - # @id: the chardev's ID, must exist 4969 - # @backend: new backend type and parameters 4970 - # 4971 - # Returns: ChardevReturn. 4972 - # 4973 - # Since: 2.10 4974 - # 4975 - # Example: 4976 - # 4977 - # -> { "execute" : "chardev-change", 4978 - # "arguments" : { "id" : "baz", 4979 - # "backend" : { "type" : "pty", "data" : {} } } } 4980 - # <- { "return": { "pty" : "/dev/pty/42" } } 4981 - # 4982 - # -> {"execute" : "chardev-change", 4983 - # "arguments" : { 4984 - # "id" : "charchannel2", 4985 - # "backend" : { 4986 - # "type" : "socket", 4987 - # "data" : { 4988 - # "addr" : { 4989 - # "type" : "unix" , 4990 - # "data" : { 4991 - # "path" : "/tmp/charchannel2.socket" 4992 - # } 4993 - # }, 4994 - # "server" : true, 4995 - # "wait" : false }}}} 4996 - # <- {"return": {}} 4997 - # 4998 - ## 4999 - { 'command': 'chardev-change', 'data': {'id' : 'str', 5000 - 'backend' : 'ChardevBackend' }, 5001 - 'returns': 'ChardevReturn' } 5002 - 5003 - ## 5004 - # @chardev-remove: 5005 - # 5006 - # Remove a character device backend 5007 - # 5008 - # @id: the chardev's ID, must exist and not be in use 5009 - # 5010 - # Returns: Nothing on success 5011 - # 5012 - # Since: 1.4 5013 - # 5014 - # Example: 5015 - # 5016 - # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } } 5017 - # <- { "return": {} } 5018 - # 5019 - ## 5020 - { 'command': 'chardev-remove', 'data': {'id': 'str'} } 5021 - 5022 - ## 5023 - # @chardev-send-break: 5024 - # 5025 - # Send a break to a character device 5026 - # 5027 - # @id: the chardev's ID, must exist 5028 - # 5029 - # Returns: Nothing on success 5030 - # 5031 - # Since: 2.10 5032 - # 5033 - # Example: 5034 - # 5035 - # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } } 5036 - # <- { "return": {} } 5037 - # 5038 - ## 5039 - { 'command': 'chardev-send-break', 'data': {'id': 'str'} } 5040 4531 5041 4532 5042 4533 ##
+538
qapi/char.json
··· 1 + # -*- Mode: Python -*- 2 + # 3 + 4 + ## 5 + # = Character devices 6 + ## 7 + 8 + { 'include': 'sockets.json' } 9 + 10 + ## 11 + # @ChardevInfo: 12 + # 13 + # Information about a character device. 14 + # 15 + # @label: the label of the character device 16 + # 17 + # @filename: the filename of the character device 18 + # 19 + # @frontend-open: shows whether the frontend device attached to this backend 20 + # (eg. with the chardev=... option) is in open or closed state 21 + # (since 2.1) 22 + # 23 + # Notes: @filename is encoded using the QEMU command line character device 24 + # encoding. See the QEMU man page for details. 25 + # 26 + # Since: 0.14.0 27 + ## 28 + { 'struct': 'ChardevInfo', 'data': {'label': 'str', 29 + 'filename': 'str', 30 + 'frontend-open': 'bool'} } 31 + 32 + ## 33 + # @query-chardev: 34 + # 35 + # Returns information about current character devices. 36 + # 37 + # Returns: a list of @ChardevInfo 38 + # 39 + # Since: 0.14.0 40 + # 41 + # Example: 42 + # 43 + # -> { "execute": "query-chardev" } 44 + # <- { 45 + # "return": [ 46 + # { 47 + # "label": "charchannel0", 48 + # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server", 49 + # "frontend-open": false 50 + # }, 51 + # { 52 + # "label": "charmonitor", 53 + # "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server", 54 + # "frontend-open": true 55 + # }, 56 + # { 57 + # "label": "charserial0", 58 + # "filename": "pty:/dev/pts/2", 59 + # "frontend-open": true 60 + # } 61 + # ] 62 + # } 63 + # 64 + ## 65 + { 'command': 'query-chardev', 'returns': ['ChardevInfo'] } 66 + 67 + ## 68 + # @ChardevBackendInfo: 69 + # 70 + # Information about a character device backend 71 + # 72 + # @name: The backend name 73 + # 74 + # Since: 2.0 75 + ## 76 + { 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} } 77 + 78 + ## 79 + # @query-chardev-backends: 80 + # 81 + # Returns information about character device backends. 82 + # 83 + # Returns: a list of @ChardevBackendInfo 84 + # 85 + # Since: 2.0 86 + # 87 + # Example: 88 + # 89 + # -> { "execute": "query-chardev-backends" } 90 + # <- { 91 + # "return":[ 92 + # { 93 + # "name":"udp" 94 + # }, 95 + # { 96 + # "name":"tcp" 97 + # }, 98 + # { 99 + # "name":"unix" 100 + # }, 101 + # { 102 + # "name":"spiceport" 103 + # } 104 + # ] 105 + # } 106 + # 107 + ## 108 + { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] } 109 + 110 + ## 111 + # @DataFormat: 112 + # 113 + # An enumeration of data format. 114 + # 115 + # @utf8: Data is a UTF-8 string (RFC 3629) 116 + # 117 + # @base64: Data is Base64 encoded binary (RFC 3548) 118 + # 119 + # Since: 1.4 120 + ## 121 + { 'enum': 'DataFormat', 122 + 'data': [ 'utf8', 'base64' ] } 123 + 124 + ## 125 + # @ringbuf-write: 126 + # 127 + # Write to a ring buffer character device. 128 + # 129 + # @device: the ring buffer character device name 130 + # 131 + # @data: data to write 132 + # 133 + # @format: data encoding (default 'utf8'). 134 + # - base64: data must be base64 encoded text. Its binary 135 + # decoding gets written. 136 + # - utf8: data's UTF-8 encoding is written 137 + # - data itself is always Unicode regardless of format, like 138 + # any other string. 139 + # 140 + # Returns: Nothing on success 141 + # 142 + # Since: 1.4 143 + # 144 + # Example: 145 + # 146 + # -> { "execute": "ringbuf-write", 147 + # "arguments": { "device": "foo", 148 + # "data": "abcdefgh", 149 + # "format": "utf8" } } 150 + # <- { "return": {} } 151 + # 152 + ## 153 + { 'command': 'ringbuf-write', 154 + 'data': {'device': 'str', 'data': 'str', 155 + '*format': 'DataFormat'} } 156 + 157 + ## 158 + # @ringbuf-read: 159 + # 160 + # Read from a ring buffer character device. 161 + # 162 + # @device: the ring buffer character device name 163 + # 164 + # @size: how many bytes to read at most 165 + # 166 + # @format: data encoding (default 'utf8'). 167 + # - base64: the data read is returned in base64 encoding. 168 + # - utf8: the data read is interpreted as UTF-8. 169 + # Bug: can screw up when the buffer contains invalid UTF-8 170 + # sequences, NUL characters, after the ring buffer lost 171 + # data, and when reading stops because the size limit is 172 + # reached. 173 + # - The return value is always Unicode regardless of format, 174 + # like any other string. 175 + # 176 + # Returns: data read from the device 177 + # 178 + # Since: 1.4 179 + # 180 + # Example: 181 + # 182 + # -> { "execute": "ringbuf-read", 183 + # "arguments": { "device": "foo", 184 + # "size": 1000, 185 + # "format": "utf8" } } 186 + # <- { "return": "abcdefgh" } 187 + # 188 + ## 189 + { 'command': 'ringbuf-read', 190 + 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'}, 191 + 'returns': 'str' } 192 + 193 + ## 194 + # @ChardevCommon: 195 + # 196 + # Configuration shared across all chardev backends 197 + # 198 + # @logfile: The name of a logfile to save output 199 + # @logappend: true to append instead of truncate 200 + # (default to false to truncate) 201 + # 202 + # Since: 2.6 203 + ## 204 + { 'struct': 'ChardevCommon', 'data': { '*logfile': 'str', 205 + '*logappend': 'bool' } } 206 + 207 + ## 208 + # @ChardevFile: 209 + # 210 + # Configuration info for file chardevs. 211 + # 212 + # @in: The name of the input file 213 + # @out: The name of the output file 214 + # @append: Open the file in append mode (default false to 215 + # truncate) (Since 2.6) 216 + # 217 + # Since: 1.4 218 + ## 219 + { 'struct': 'ChardevFile', 'data': { '*in' : 'str', 220 + 'out' : 'str', 221 + '*append': 'bool' }, 222 + 'base': 'ChardevCommon' } 223 + 224 + ## 225 + # @ChardevHostdev: 226 + # 227 + # Configuration info for device and pipe chardevs. 228 + # 229 + # @device: The name of the special file for the device, 230 + # i.e. /dev/ttyS0 on Unix or COM1: on Windows 231 + # 232 + # Since: 1.4 233 + ## 234 + { 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' }, 235 + 'base': 'ChardevCommon' } 236 + 237 + ## 238 + # @ChardevSocket: 239 + # 240 + # Configuration info for (stream) socket chardevs. 241 + # 242 + # @addr: socket address to listen on (server=true) 243 + # or connect to (server=false) 244 + # @tls-creds: the ID of the TLS credentials object (since 2.6) 245 + # @server: create server socket (default: true) 246 + # @wait: wait for incoming connection on server 247 + # sockets (default: false). 248 + # @nodelay: set TCP_NODELAY socket option (default: false) 249 + # @telnet: enable telnet protocol on server 250 + # sockets (default: false) 251 + # @tn3270: enable tn3270 protocol on server 252 + # sockets (default: false) (Since: 2.10) 253 + # @reconnect: For a client socket, if a socket is disconnected, 254 + # then attempt a reconnect after the given number of seconds. 255 + # Setting this to zero disables this function. (default: 0) 256 + # (Since: 2.2) 257 + # 258 + # Since: 1.4 259 + ## 260 + { 'struct': 'ChardevSocket', 'data': { 'addr' : 'SocketAddressLegacy', 261 + '*tls-creds' : 'str', 262 + '*server' : 'bool', 263 + '*wait' : 'bool', 264 + '*nodelay' : 'bool', 265 + '*telnet' : 'bool', 266 + '*tn3270' : 'bool', 267 + '*reconnect' : 'int' }, 268 + 'base': 'ChardevCommon' } 269 + 270 + ## 271 + # @ChardevUdp: 272 + # 273 + # Configuration info for datagram socket chardevs. 274 + # 275 + # @remote: remote address 276 + # @local: local address 277 + # 278 + # Since: 1.5 279 + ## 280 + { 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddressLegacy', 281 + '*local' : 'SocketAddressLegacy' }, 282 + 'base': 'ChardevCommon' } 283 + 284 + ## 285 + # @ChardevMux: 286 + # 287 + # Configuration info for mux chardevs. 288 + # 289 + # @chardev: name of the base chardev. 290 + # 291 + # Since: 1.5 292 + ## 293 + { 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' }, 294 + 'base': 'ChardevCommon' } 295 + 296 + ## 297 + # @ChardevStdio: 298 + # 299 + # Configuration info for stdio chardevs. 300 + # 301 + # @signal: Allow signals (such as SIGINT triggered by ^C) 302 + # be delivered to qemu. Default: true in -nographic mode, 303 + # false otherwise. 304 + # 305 + # Since: 1.5 306 + ## 307 + { 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' }, 308 + 'base': 'ChardevCommon' } 309 + 310 + 311 + ## 312 + # @ChardevSpiceChannel: 313 + # 314 + # Configuration info for spice vm channel chardevs. 315 + # 316 + # @type: kind of channel (for example vdagent). 317 + # 318 + # Since: 1.5 319 + ## 320 + { 'struct': 'ChardevSpiceChannel', 'data': { 'type' : 'str' }, 321 + 'base': 'ChardevCommon' } 322 + 323 + ## 324 + # @ChardevSpicePort: 325 + # 326 + # Configuration info for spice port chardevs. 327 + # 328 + # @fqdn: name of the channel (see docs/spice-port-fqdn.txt) 329 + # 330 + # Since: 1.5 331 + ## 332 + { 'struct': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' }, 333 + 'base': 'ChardevCommon' } 334 + 335 + ## 336 + # @ChardevVC: 337 + # 338 + # Configuration info for virtual console chardevs. 339 + # 340 + # @width: console width, in pixels 341 + # @height: console height, in pixels 342 + # @cols: console width, in chars 343 + # @rows: console height, in chars 344 + # 345 + # Since: 1.5 346 + ## 347 + { 'struct': 'ChardevVC', 'data': { '*width' : 'int', 348 + '*height' : 'int', 349 + '*cols' : 'int', 350 + '*rows' : 'int' }, 351 + 'base': 'ChardevCommon' } 352 + 353 + ## 354 + # @ChardevRingbuf: 355 + # 356 + # Configuration info for ring buffer chardevs. 357 + # 358 + # @size: ring buffer size, must be power of two, default is 65536 359 + # 360 + # Since: 1.5 361 + ## 362 + { 'struct': 'ChardevRingbuf', 'data': { '*size' : 'int' }, 363 + 'base': 'ChardevCommon' } 364 + 365 + ## 366 + # @ChardevBackend: 367 + # 368 + # Configuration info for the new chardev backend. 369 + # 370 + # Since: 1.4 (testdev since 2.2, wctablet since 2.9) 371 + ## 372 + { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile', 373 + 'serial' : 'ChardevHostdev', 374 + 'parallel': 'ChardevHostdev', 375 + 'pipe' : 'ChardevHostdev', 376 + 'socket' : 'ChardevSocket', 377 + 'udp' : 'ChardevUdp', 378 + 'pty' : 'ChardevCommon', 379 + 'null' : 'ChardevCommon', 380 + 'mux' : 'ChardevMux', 381 + 'msmouse': 'ChardevCommon', 382 + 'wctablet' : 'ChardevCommon', 383 + 'braille': 'ChardevCommon', 384 + 'testdev': 'ChardevCommon', 385 + 'stdio' : 'ChardevStdio', 386 + 'console': 'ChardevCommon', 387 + 'spicevmc' : 'ChardevSpiceChannel', 388 + 'spiceport' : 'ChardevSpicePort', 389 + 'vc' : 'ChardevVC', 390 + 'ringbuf': 'ChardevRingbuf', 391 + # next one is just for compatibility 392 + 'memory' : 'ChardevRingbuf' } } 393 + 394 + ## 395 + # @ChardevReturn: 396 + # 397 + # Return info about the chardev backend just created. 398 + # 399 + # @pty: name of the slave pseudoterminal device, present if 400 + # and only if a chardev of type 'pty' was created 401 + # 402 + # Since: 1.4 403 + ## 404 + { 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } } 405 + 406 + ## 407 + # @chardev-add: 408 + # 409 + # Add a character device backend 410 + # 411 + # @id: the chardev's ID, must be unique 412 + # @backend: backend type and parameters 413 + # 414 + # Returns: ChardevReturn. 415 + # 416 + # Since: 1.4 417 + # 418 + # Example: 419 + # 420 + # -> { "execute" : "chardev-add", 421 + # "arguments" : { "id" : "foo", 422 + # "backend" : { "type" : "null", "data" : {} } } } 423 + # <- { "return": {} } 424 + # 425 + # -> { "execute" : "chardev-add", 426 + # "arguments" : { "id" : "bar", 427 + # "backend" : { "type" : "file", 428 + # "data" : { "out" : "/tmp/bar.log" } } } } 429 + # <- { "return": {} } 430 + # 431 + # -> { "execute" : "chardev-add", 432 + # "arguments" : { "id" : "baz", 433 + # "backend" : { "type" : "pty", "data" : {} } } } 434 + # <- { "return": { "pty" : "/dev/pty/42" } } 435 + # 436 + ## 437 + { 'command': 'chardev-add', 'data': {'id' : 'str', 438 + 'backend' : 'ChardevBackend' }, 439 + 'returns': 'ChardevReturn' } 440 + 441 + ## 442 + # @chardev-change: 443 + # 444 + # Change a character device backend 445 + # 446 + # @id: the chardev's ID, must exist 447 + # @backend: new backend type and parameters 448 + # 449 + # Returns: ChardevReturn. 450 + # 451 + # Since: 2.10 452 + # 453 + # Example: 454 + # 455 + # -> { "execute" : "chardev-change", 456 + # "arguments" : { "id" : "baz", 457 + # "backend" : { "type" : "pty", "data" : {} } } } 458 + # <- { "return": { "pty" : "/dev/pty/42" } } 459 + # 460 + # -> {"execute" : "chardev-change", 461 + # "arguments" : { 462 + # "id" : "charchannel2", 463 + # "backend" : { 464 + # "type" : "socket", 465 + # "data" : { 466 + # "addr" : { 467 + # "type" : "unix" , 468 + # "data" : { 469 + # "path" : "/tmp/charchannel2.socket" 470 + # } 471 + # }, 472 + # "server" : true, 473 + # "wait" : false }}}} 474 + # <- {"return": {}} 475 + # 476 + ## 477 + { 'command': 'chardev-change', 'data': {'id' : 'str', 478 + 'backend' : 'ChardevBackend' }, 479 + 'returns': 'ChardevReturn' } 480 + 481 + ## 482 + # @chardev-remove: 483 + # 484 + # Remove a character device backend 485 + # 486 + # @id: the chardev's ID, must exist and not be in use 487 + # 488 + # Returns: Nothing on success 489 + # 490 + # Since: 1.4 491 + # 492 + # Example: 493 + # 494 + # -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } } 495 + # <- { "return": {} } 496 + # 497 + ## 498 + { 'command': 'chardev-remove', 'data': {'id': 'str'} } 499 + 500 + ## 501 + # @chardev-send-break: 502 + # 503 + # Send a break to a character device 504 + # 505 + # @id: the chardev's ID, must exist 506 + # 507 + # Returns: Nothing on success 508 + # 509 + # Since: 2.10 510 + # 511 + # Example: 512 + # 513 + # -> { "execute": "chardev-send-break", "arguments": { "id" : "foo" } } 514 + # <- { "return": {} } 515 + # 516 + ## 517 + { 'command': 'chardev-send-break', 'data': {'id': 'str'} } 518 + 519 + ## 520 + # @VSERPORT_CHANGE: 521 + # 522 + # Emitted when the guest opens or closes a virtio-serial port. 523 + # 524 + # @id: device identifier of the virtio-serial port 525 + # 526 + # @open: true if the guest has opened the virtio-serial port 527 + # 528 + # Since: 2.1 529 + # 530 + # Example: 531 + # 532 + # <- { "event": "VSERPORT_CHANGE", 533 + # "data": { "id": "channel0", "open": true }, 534 + # "timestamp": { "seconds": 1401385907, "microseconds": 422329 } } 535 + # 536 + ## 537 + { 'event': 'VSERPORT_CHANGE', 538 + 'data': { 'id': 'str', 'open': 'bool' } }
-21
qapi/event.json
··· 397 397 'sector-num': 'int', 'sectors-count': 'int' } } 398 398 399 399 ## 400 - # @VSERPORT_CHANGE: 401 - # 402 - # Emitted when the guest opens or closes a virtio-serial port. 403 - # 404 - # @id: device identifier of the virtio-serial port 405 - # 406 - # @open: true if the guest has opened the virtio-serial port 407 - # 408 - # Since: 2.1 409 - # 410 - # Example: 411 - # 412 - # <- { "event": "VSERPORT_CHANGE", 413 - # "data": { "id": "channel0", "open": true }, 414 - # "timestamp": { "seconds": 1401385907, "microseconds": 422329 } } 415 - # 416 - ## 417 - { 'event': 'VSERPORT_CHANGE', 418 - 'data': { 'id': 'str', 'open': 'bool' } } 419 - 420 - ## 421 400 # @MEM_UNPLUG_ERROR: 422 401 # 423 402 # Emitted when memory hot unplug error occurs.