misc.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. # -*- Mode: Python -*-
  2. # vim: filetype=python
  3. #
  4. ##
  5. # = Miscellanea
  6. ##
  7. { 'include': 'common.json' }
  8. ##
  9. # @add_client:
  10. #
  11. # Allow client connections for VNC, Spice and socket based character
  12. # devices to be passed in to QEMU via SCM_RIGHTS.
  13. #
  14. # If the FD associated with @fdname is not a socket, the command will
  15. # fail and the FD will be closed.
  16. #
  17. # @protocol: protocol name. Valid names are "vnc", "spice",
  18. # "@dbus-display" or the name of a character device (e.g. from
  19. # -chardev id=XXXX)
  20. #
  21. # @fdname: file descriptor name previously passed via 'getfd' command
  22. #
  23. # @skipauth: whether to skip authentication. Only applies to "vnc"
  24. # and "spice" protocols
  25. #
  26. # @tls: whether to perform TLS. Only applies to the "spice" protocol
  27. #
  28. # Since: 0.14
  29. #
  30. # .. qmp-example::
  31. #
  32. # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
  33. # "fdname": "myclient" } }
  34. # <- { "return": {} }
  35. ##
  36. { 'command': 'add_client',
  37. 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
  38. '*tls': 'bool' } }
  39. ##
  40. # @NameInfo:
  41. #
  42. # Guest name information.
  43. #
  44. # @name: The name of the guest
  45. #
  46. # Since: 0.14
  47. ##
  48. { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
  49. ##
  50. # @query-name:
  51. #
  52. # Return the name information of a guest.
  53. #
  54. # Returns: @NameInfo of the guest
  55. #
  56. # Since: 0.14
  57. #
  58. # .. qmp-example::
  59. #
  60. # -> { "execute": "query-name" }
  61. # <- { "return": { "name": "qemu-name" } }
  62. ##
  63. { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
  64. ##
  65. # @IOThreadInfo:
  66. #
  67. # Information about an iothread
  68. #
  69. # @id: the identifier of the iothread
  70. #
  71. # @thread-id: ID of the underlying host thread
  72. #
  73. # @poll-max-ns: maximum polling time in ns, 0 means polling is
  74. # disabled (since 2.9)
  75. #
  76. # @poll-grow: how many ns will be added to polling time, 0 means that
  77. # it's not configured (since 2.9)
  78. #
  79. # @poll-shrink: how many ns will be removed from polling time, 0 means
  80. # that it's not configured (since 2.9)
  81. #
  82. # @aio-max-batch: maximum number of requests in a batch for the AIO
  83. # engine, 0 means that the engine will use its default (since 6.1)
  84. #
  85. # Since: 2.0
  86. ##
  87. { 'struct': 'IOThreadInfo',
  88. 'data': {'id': 'str',
  89. 'thread-id': 'int',
  90. 'poll-max-ns': 'int',
  91. 'poll-grow': 'int',
  92. 'poll-shrink': 'int',
  93. 'aio-max-batch': 'int' } }
  94. ##
  95. # @query-iothreads:
  96. #
  97. # Returns a list of information about each iothread.
  98. #
  99. # .. note:: This list excludes the QEMU main loop thread, which is not
  100. # declared using the ``-object iothread`` command-line option. It
  101. # is always the main thread of the process.
  102. #
  103. # Returns: a list of @IOThreadInfo for each iothread
  104. #
  105. # Since: 2.0
  106. #
  107. # .. qmp-example::
  108. #
  109. # -> { "execute": "query-iothreads" }
  110. # <- { "return": [
  111. # {
  112. # "id":"iothread0",
  113. # "thread-id":3134
  114. # },
  115. # {
  116. # "id":"iothread1",
  117. # "thread-id":3135
  118. # }
  119. # ]
  120. # }
  121. ##
  122. { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
  123. 'allow-preconfig': true }
  124. ##
  125. # @stop:
  126. #
  127. # Stop guest VM execution.
  128. #
  129. # Since: 0.14
  130. #
  131. # .. note:: This function will succeed even if the guest is already in
  132. # the stopped state. In "inmigrate" state, it will ensure that the
  133. # guest remains paused once migration finishes, as if the ``-S``
  134. # option was passed on the command line.
  135. #
  136. # In the "suspended" state, it will completely stop the VM and
  137. # cause a transition to the "paused" state. (Since 9.0)
  138. #
  139. # .. qmp-example::
  140. #
  141. # -> { "execute": "stop" }
  142. # <- { "return": {} }
  143. ##
  144. { 'command': 'stop' }
  145. ##
  146. # @cont:
  147. #
  148. # Resume guest VM execution.
  149. #
  150. # Since: 0.14
  151. #
  152. # .. note:: This command will succeed if the guest is currently
  153. # running. It will also succeed if the guest is in the "inmigrate"
  154. # state; in this case, the effect of the command is to make sure
  155. # the guest starts once migration finishes, removing the effect of
  156. # the ``-S`` command line option if it was passed.
  157. #
  158. # If the VM was previously suspended, and not been reset or woken,
  159. # this command will transition back to the "suspended" state.
  160. # (Since 9.0)
  161. #
  162. # .. qmp-example::
  163. #
  164. # -> { "execute": "cont" }
  165. # <- { "return": {} }
  166. ##
  167. { 'command': 'cont' }
  168. ##
  169. # @x-exit-preconfig:
  170. #
  171. # Exit from "preconfig" state
  172. #
  173. # This command makes QEMU exit the preconfig state and proceed with VM
  174. # initialization using configuration data provided on the command line
  175. # and via the QMP monitor during the preconfig state. The command is
  176. # only available during the preconfig state (i.e. when the --preconfig
  177. # command line option was in use).
  178. #
  179. # Features:
  180. #
  181. # @unstable: This command is experimental.
  182. #
  183. # Since: 3.0
  184. #
  185. # .. qmp-example::
  186. #
  187. # -> { "execute": "x-exit-preconfig" }
  188. # <- { "return": {} }
  189. ##
  190. { 'command': 'x-exit-preconfig', 'allow-preconfig': true,
  191. 'features': [ 'unstable' ] }
  192. ##
  193. # @human-monitor-command:
  194. #
  195. # Execute a command on the human monitor and return the output.
  196. #
  197. # @command-line: the command to execute in the human monitor
  198. #
  199. # @cpu-index: The CPU to use for commands that require an implicit CPU
  200. #
  201. # Features:
  202. #
  203. # @savevm-monitor-nodes: If present, HMP command savevm only snapshots
  204. # monitor-owned nodes if they have no parents. This allows the
  205. # use of 'savevm' with -blockdev. (since 4.2)
  206. #
  207. # Returns: the output of the command as a string
  208. #
  209. # Since: 0.14
  210. #
  211. # .. note:: This command only exists as a stop-gap. Its use is highly
  212. # discouraged. The semantics of this command are not guaranteed:
  213. # this means that command names, arguments and responses can change
  214. # or be removed at ANY time. Applications that rely on long term
  215. # stability guarantees should NOT use this command.
  216. #
  217. # Known limitations:
  218. #
  219. # * This command is stateless, this means that commands that depend
  220. # on state information (such as getfd) might not work.
  221. #
  222. # * Commands that prompt the user for data don't currently work.
  223. #
  224. # .. qmp-example::
  225. #
  226. # -> { "execute": "human-monitor-command",
  227. # "arguments": { "command-line": "info kvm" } }
  228. # <- { "return": "kvm support: enabled\r\n" }
  229. ##
  230. { 'command': 'human-monitor-command',
  231. 'data': {'command-line': 'str', '*cpu-index': 'int'},
  232. 'returns': 'str',
  233. 'features': [ 'savevm-monitor-nodes' ] }
  234. ##
  235. # @getfd:
  236. #
  237. # Receive a file descriptor via SCM rights and assign it a name
  238. #
  239. # @fdname: file descriptor name
  240. #
  241. # Since: 0.14
  242. #
  243. # .. note:: If @fdname already exists, the file descriptor assigned to
  244. # it will be closed and replaced by the received file descriptor.
  245. #
  246. # The 'closefd' command can be used to explicitly close the file
  247. # descriptor when it is no longer needed.
  248. #
  249. # .. qmp-example::
  250. #
  251. # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
  252. # <- { "return": {} }
  253. ##
  254. { 'command': 'getfd', 'data': {'fdname': 'str'}, 'if': 'CONFIG_POSIX' }
  255. ##
  256. # @get-win32-socket:
  257. #
  258. # Add a socket that was duplicated to QEMU process with
  259. # WSADuplicateSocketW() via WSASocket() & WSAPROTOCOL_INFOW structure
  260. # and assign it a name (the SOCKET is associated with a CRT file
  261. # descriptor)
  262. #
  263. # @info: the WSAPROTOCOL_INFOW structure (encoded in base64)
  264. #
  265. # @fdname: file descriptor name
  266. #
  267. # Since: 8.0
  268. #
  269. # .. note:: If @fdname already exists, the file descriptor assigned to
  270. # it will be closed and replaced by the received file descriptor.
  271. #
  272. # The 'closefd' command can be used to explicitly close the file
  273. # descriptor when it is no longer needed.
  274. #
  275. # .. qmp-example::
  276. #
  277. # -> { "execute": "get-win32-socket",
  278. # "arguments": { "info": "abcd123..", "fdname": "skclient" } }
  279. # <- { "return": {} }
  280. ##
  281. { 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' }
  282. ##
  283. # @closefd:
  284. #
  285. # Close a file descriptor previously passed via SCM rights
  286. #
  287. # @fdname: file descriptor name
  288. #
  289. # Since: 0.14
  290. #
  291. # .. qmp-example::
  292. #
  293. # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
  294. # <- { "return": {} }
  295. ##
  296. { 'command': 'closefd', 'data': {'fdname': 'str'} }
  297. ##
  298. # @AddfdInfo:
  299. #
  300. # Information about a file descriptor that was added to an fd set.
  301. #
  302. # @fdset-id: The ID of the fd set that @fd was added to.
  303. #
  304. # @fd: The file descriptor that was received via SCM rights and added
  305. # to the fd set.
  306. #
  307. # Since: 1.2
  308. ##
  309. { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
  310. ##
  311. # @add-fd:
  312. #
  313. # Add a file descriptor, that was passed via SCM rights, to an fd set.
  314. #
  315. # @fdset-id: The ID of the fd set to add the file descriptor to.
  316. #
  317. # @opaque: A free-form string that can be used to describe the fd.
  318. #
  319. # Returns:
  320. # @AddfdInfo
  321. #
  322. # Errors:
  323. # - If file descriptor was not received, GenericError
  324. # - If @fdset-id is a negative value, GenericError
  325. #
  326. # .. note:: The list of fd sets is shared by all monitor connections.
  327. #
  328. # .. note:: If @fdset-id is not specified, a new fd set will be
  329. # created.
  330. #
  331. # Since: 1.2
  332. #
  333. # .. qmp-example::
  334. #
  335. # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
  336. # <- { "return": { "fdset-id": 1, "fd": 3 } }
  337. ##
  338. { 'command': 'add-fd',
  339. 'data': { '*fdset-id': 'int',
  340. '*opaque': 'str' },
  341. 'returns': 'AddfdInfo' }
  342. ##
  343. # @remove-fd:
  344. #
  345. # Remove a file descriptor from an fd set.
  346. #
  347. # @fdset-id: The ID of the fd set that the file descriptor belongs to.
  348. #
  349. # @fd: The file descriptor that is to be removed.
  350. #
  351. # Errors:
  352. # - If @fdset-id or @fd is not found, GenericError
  353. #
  354. # Since: 1.2
  355. #
  356. # .. note:: The list of fd sets is shared by all monitor connections.
  357. #
  358. # .. note:: If @fd is not specified, all file descriptors in @fdset-id
  359. # will be removed.
  360. #
  361. # .. qmp-example::
  362. #
  363. # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
  364. # <- { "return": {} }
  365. ##
  366. { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
  367. ##
  368. # @FdsetFdInfo:
  369. #
  370. # Information about a file descriptor that belongs to an fd set.
  371. #
  372. # @fd: The file descriptor value.
  373. #
  374. # @opaque: A free-form string that can be used to describe the fd.
  375. #
  376. # Since: 1.2
  377. ##
  378. { 'struct': 'FdsetFdInfo',
  379. 'data': {'fd': 'int', '*opaque': 'str'} }
  380. ##
  381. # @FdsetInfo:
  382. #
  383. # Information about an fd set.
  384. #
  385. # @fdset-id: The ID of the fd set.
  386. #
  387. # @fds: A list of file descriptors that belong to this fd set.
  388. #
  389. # Since: 1.2
  390. ##
  391. { 'struct': 'FdsetInfo',
  392. 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
  393. ##
  394. # @query-fdsets:
  395. #
  396. # Return information describing all fd sets.
  397. #
  398. # Returns: A list of @FdsetInfo
  399. #
  400. # Since: 1.2
  401. #
  402. # .. note:: The list of fd sets is shared by all monitor connections.
  403. #
  404. # .. qmp-example::
  405. #
  406. # -> { "execute": "query-fdsets" }
  407. # <- { "return": [
  408. # {
  409. # "fds": [
  410. # {
  411. # "fd": 30,
  412. # "opaque": "rdonly:/path/to/file"
  413. # },
  414. # {
  415. # "fd": 24,
  416. # "opaque": "rdwr:/path/to/file"
  417. # }
  418. # ],
  419. # "fdset-id": 1
  420. # },
  421. # {
  422. # "fds": [
  423. # {
  424. # "fd": 28
  425. # },
  426. # {
  427. # "fd": 29
  428. # }
  429. # ],
  430. # "fdset-id": 0
  431. # }
  432. # ]
  433. # }
  434. ##
  435. { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
  436. ##
  437. # @CommandLineParameterType:
  438. #
  439. # Possible types for an option parameter.
  440. #
  441. # @string: accepts a character string
  442. #
  443. # @boolean: accepts "on" or "off"
  444. #
  445. # @number: accepts a number
  446. #
  447. # @size: accepts a number followed by an optional suffix (K)ilo,
  448. # (M)ega, (G)iga, (T)era
  449. #
  450. # Since: 1.5
  451. ##
  452. { 'enum': 'CommandLineParameterType',
  453. 'data': ['string', 'boolean', 'number', 'size'] }
  454. ##
  455. # @CommandLineParameterInfo:
  456. #
  457. # Details about a single parameter of a command line option.
  458. #
  459. # @name: parameter name
  460. #
  461. # @type: parameter @CommandLineParameterType
  462. #
  463. # @help: human readable text string, not suitable for parsing.
  464. #
  465. # @default: default value string (since 2.1)
  466. #
  467. # Since: 1.5
  468. ##
  469. { 'struct': 'CommandLineParameterInfo',
  470. 'data': { 'name': 'str',
  471. 'type': 'CommandLineParameterType',
  472. '*help': 'str',
  473. '*default': 'str' } }
  474. ##
  475. # @CommandLineOptionInfo:
  476. #
  477. # Details about a command line option, including its list of parameter
  478. # details
  479. #
  480. # @option: option name
  481. #
  482. # @parameters: an array of @CommandLineParameterInfo
  483. #
  484. # Since: 1.5
  485. ##
  486. { 'struct': 'CommandLineOptionInfo',
  487. 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
  488. ##
  489. # @query-command-line-options:
  490. #
  491. # Query command line option schema.
  492. #
  493. # @option: option name
  494. #
  495. # Returns: list of @CommandLineOptionInfo for all options (or for the
  496. # given @option).
  497. #
  498. # Errors:
  499. # - if the given @option doesn't exist
  500. #
  501. # Since: 1.5
  502. #
  503. # .. qmp-example::
  504. #
  505. # -> { "execute": "query-command-line-options",
  506. # "arguments": { "option": "option-rom" } }
  507. # <- { "return": [
  508. # {
  509. # "parameters": [
  510. # {
  511. # "name": "romfile",
  512. # "type": "string"
  513. # },
  514. # {
  515. # "name": "bootindex",
  516. # "type": "number"
  517. # }
  518. # ],
  519. # "option": "option-rom"
  520. # }
  521. # ]
  522. # }
  523. ##
  524. {'command': 'query-command-line-options',
  525. 'data': {'*option': 'str'},
  526. 'returns': ['CommandLineOptionInfo'],
  527. 'allow-preconfig': true}
  528. ##
  529. # @RTC_CHANGE:
  530. #
  531. # Emitted when the guest changes the RTC time.
  532. #
  533. # @offset: offset in seconds between base RTC clock (as specified by
  534. # -rtc base), and new RTC clock value
  535. #
  536. # @qom-path: path to the RTC object in the QOM tree
  537. #
  538. # .. note:: This event is rate-limited. It is not guaranteed that the
  539. # RTC in the system implements this event, or even that the system
  540. # has an RTC at all.
  541. #
  542. # Since: 0.13
  543. #
  544. # .. qmp-example::
  545. #
  546. # <- { "event": "RTC_CHANGE",
  547. # "data": { "offset": 78 },
  548. # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
  549. ##
  550. { 'event': 'RTC_CHANGE',
  551. 'data': { 'offset': 'int', 'qom-path': 'str' } }
  552. ##
  553. # @VFU_CLIENT_HANGUP:
  554. #
  555. # Emitted when the client of a TYPE_VFIO_USER_SERVER closes the
  556. # communication channel
  557. #
  558. # @vfu-id: ID of the TYPE_VFIO_USER_SERVER object. It is the last
  559. # component of @vfu-qom-path referenced below
  560. #
  561. # @vfu-qom-path: path to the TYPE_VFIO_USER_SERVER object in the QOM
  562. # tree
  563. #
  564. # @dev-id: ID of attached PCI device
  565. #
  566. # @dev-qom-path: path to attached PCI device in the QOM tree
  567. #
  568. # Since: 7.1
  569. #
  570. # .. qmp-example::
  571. #
  572. # <- { "event": "VFU_CLIENT_HANGUP",
  573. # "data": { "vfu-id": "vfu1",
  574. # "vfu-qom-path": "/objects/vfu1",
  575. # "dev-id": "sas1",
  576. # "dev-qom-path": "/machine/peripheral/sas1" },
  577. # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
  578. ##
  579. { 'event': 'VFU_CLIENT_HANGUP',
  580. 'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str',
  581. 'dev-id': 'str', 'dev-qom-path': 'str' } }