Statistics
| Branch: | Revision:

root / qapi-schema.json @ 8599ea4c

History | View | Annotate | Download (86.6 kB)

1
# -*- Mode: Python -*-
2
#
3
# QAPI Schema
4

    
5
##
6
# @ErrorClass
7
#
8
# QEMU error classes
9
#
10
# @GenericError: this is used for errors that don't require a specific error
11
#                class. This should be the default case for most errors
12
#
13
# @CommandNotFound: the requested command has not been found
14
#
15
# @DeviceEncrypted: the requested operation can't be fulfilled because the
16
#                   selected device is encrypted
17
#
18
# @DeviceNotActive: a device has failed to be become active
19
#
20
# @DeviceNotFound: the requested device has not been found
21
#
22
# @KVMMissingCap: the requested operation can't be fulfilled because a
23
#                 required KVM capability is missing
24
#
25
# Since: 1.2
26
##
27
{ 'enum': 'ErrorClass',
28
  'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
29
            'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
30

    
31
##
32
# @add_client
33
#
34
# Allow client connections for VNC, Spice and socket based
35
# character devices to be passed in to QEMU via SCM_RIGHTS.
36
#
37
# @protocol: protocol name. Valid names are "vnc", "spice" or the
38
#            name of a character device (eg. from -chardev id=XXXX)
39
#
40
# @fdname: file descriptor name previously passed via 'getfd' command
41
#
42
# @skipauth: #optional whether to skip authentication. Only applies
43
#            to "vnc" and "spice" protocols
44
#
45
# @tls: #optional whether to perform TLS. Only applies to the "spice"
46
#       protocol
47
#
48
# Returns: nothing on success.
49
#
50
# Since: 0.14.0
51
##
52
{ 'command': 'add_client',
53
  'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
54
            '*tls': 'bool' } }
55

    
56
##
57
# @NameInfo:
58
#
59
# Guest name information.
60
#
61
# @name: #optional The name of the guest
62
#
63
# Since 0.14.0
64
##
65
{ 'type': 'NameInfo', 'data': {'*name': 'str'} }
66

    
67
##
68
# @query-name:
69
#
70
# Return the name information of a guest.
71
#
72
# Returns: @NameInfo of the guest
73
#
74
# Since 0.14.0
75
##
76
{ 'command': 'query-name', 'returns': 'NameInfo' }
77

    
78
##
79
# @VersionInfo:
80
#
81
# A description of QEMU's version.
82
#
83
# @qemu.major:  The major version of QEMU
84
#
85
# @qemu.minor:  The minor version of QEMU
86
#
87
# @qemu.micro:  The micro version of QEMU.  By current convention, a micro
88
#               version of 50 signifies a development branch.  A micro version
89
#               greater than or equal to 90 signifies a release candidate for
90
#               the next minor version.  A micro version of less than 50
91
#               signifies a stable release.
92
#
93
# @package:     QEMU will always set this field to an empty string.  Downstream
94
#               versions of QEMU should set this to a non-empty string.  The
95
#               exact format depends on the downstream however it highly
96
#               recommended that a unique name is used.
97
#
98
# Since: 0.14.0
99
##
100
{ 'type': 'VersionInfo',
101
  'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
102
           'package': 'str'} }
103

    
104
##
105
# @query-version:
106
#
107
# Returns the current version of QEMU.
108
#
109
# Returns:  A @VersionInfo object describing the current version of QEMU.
110
#
111
# Since: 0.14.0
112
##
113
{ 'command': 'query-version', 'returns': 'VersionInfo' }
114

    
115
##
116
# @KvmInfo:
117
#
118
# Information about support for KVM acceleration
119
#
120
# @enabled: true if KVM acceleration is active
121
#
122
# @present: true if KVM acceleration is built into this executable
123
#
124
# Since: 0.14.0
125
##
126
{ 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
127

    
128
##
129
# @query-kvm:
130
#
131
# Returns information about KVM acceleration
132
#
133
# Returns: @KvmInfo
134
#
135
# Since: 0.14.0
136
##
137
{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
138

    
139
##
140
# @RunState
141
#
142
# An enumeration of VM run states.
143
#
144
# @debug: QEMU is running on a debugger
145
#
146
# @finish-migrate: guest is paused to finish the migration process
147
#
148
# @inmigrate: guest is paused waiting for an incoming migration.  Note
149
# that this state does not tell whether the machine will start at the
150
# end of the migration.  This depends on the command-line -S option and
151
# any invocation of 'stop' or 'cont' that has happened since QEMU was
152
# started.
153
#
154
# @internal-error: An internal error that prevents further guest execution
155
# has occurred
156
#
157
# @io-error: the last IOP has failed and the device is configured to pause
158
# on I/O errors
159
#
160
# @paused: guest has been paused via the 'stop' command
161
#
162
# @postmigrate: guest is paused following a successful 'migrate'
163
#
164
# @prelaunch: QEMU was started with -S and guest has not started
165
#
166
# @restore-vm: guest is paused to restore VM state
167
#
168
# @running: guest is actively running
169
#
170
# @save-vm: guest is paused to save the VM state
171
#
172
# @shutdown: guest is shut down (and -no-shutdown is in use)
173
#
174
# @suspended: guest is suspended (ACPI S3)
175
#
176
# @watchdog: the watchdog action is configured to pause and has been triggered
177
##
178
{ 'enum': 'RunState',
179
  'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
180
            'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
181
            'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
182

    
183
##
184
# @SnapshotInfo
185
#
186
# @id: unique snapshot id
187
#
188
# @name: user chosen name
189
#
190
# @vm-state-size: size of the VM state
191
#
192
# @date-sec: UTC date of the snapshot in seconds
193
#
194
# @date-nsec: fractional part in nano seconds to be used with date-sec
195
#
196
# @vm-clock-sec: VM clock relative to boot in seconds
197
#
198
# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
199
#
200
# Since: 1.3
201
#
202
##
203

    
204
{ 'type': 'SnapshotInfo',
205
  'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
206
            'date-sec': 'int', 'date-nsec': 'int',
207
            'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
208

    
209
##
210
# @ImageInfo:
211
#
212
# Information about a QEMU image file
213
#
214
# @filename: name of the image file
215
#
216
# @format: format of the image file
217
#
218
# @virtual-size: maximum capacity in bytes of the image
219
#
220
# @actual-size: #optional actual size on disk in bytes of the image
221
#
222
# @dirty-flag: #optional true if image is not cleanly closed
223
#
224
# @cluster-size: #optional size of a cluster in bytes
225
#
226
# @encrypted: #optional true if the image is encrypted
227
#
228
# @backing-filename: #optional name of the backing file
229
#
230
# @full-backing-filename: #optional full path of the backing file
231
#
232
# @backing-filename-format: #optional the format of the backing file
233
#
234
# @snapshots: #optional list of VM snapshots
235
#
236
# Since: 1.3
237
#
238
##
239

    
240
{ 'type': 'ImageInfo',
241
  'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
242
           '*actual-size': 'int', 'virtual-size': 'int',
243
           '*cluster-size': 'int', '*encrypted': 'bool',
244
           '*backing-filename': 'str', '*full-backing-filename': 'str',
245
           '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'] } }
246

    
247
##
248
# @ImageCheck:
249
#
250
# Information about a QEMU image file check
251
#
252
# @filename: name of the image file checked
253
#
254
# @format: format of the image file checked
255
#
256
# @check-errors: number of unexpected errors occurred during check
257
#
258
# @image-end-offset: #optional offset (in bytes) where the image ends, this
259
#                    field is present if the driver for the image format
260
#                    supports it
261
#
262
# @corruptions: #optional number of corruptions found during the check if any
263
#
264
# @leaks: #optional number of leaks found during the check if any
265
#
266
# @corruptions-fixed: #optional number of corruptions fixed during the check
267
#                     if any
268
#
269
# @leaks-fixed: #optional number of leaks fixed during the check if any
270
#
271
# @total-clusters: #optional total number of clusters, this field is present
272
#                  if the driver for the image format supports it
273
#
274
# @allocated-clusters: #optional total number of allocated clusters, this
275
#                      field is present if the driver for the image format
276
#                      supports it
277
#
278
# @fragmented-clusters: #optional total number of fragmented clusters, this
279
#                       field is present if the driver for the image format
280
#                       supports it
281
#
282
# Since: 1.4
283
#
284
##
285

    
286
{ 'type': 'ImageCheck',
287
  'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
288
           '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
289
           '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
290
           '*total-clusters': 'int', '*allocated-clusters': 'int',
291
           '*fragmented-clusters': 'int' } }
292

    
293
##
294
# @StatusInfo:
295
#
296
# Information about VCPU run state
297
#
298
# @running: true if all VCPUs are runnable, false if not runnable
299
#
300
# @singlestep: true if VCPUs are in single-step mode
301
#
302
# @status: the virtual machine @RunState
303
#
304
# Since:  0.14.0
305
#
306
# Notes: @singlestep is enabled through the GDB stub
307
##
308
{ 'type': 'StatusInfo',
309
  'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
310

    
311
##
312
# @query-status:
313
#
314
# Query the run status of all VCPUs
315
#
316
# Returns: @StatusInfo reflecting all VCPUs
317
#
318
# Since:  0.14.0
319
##
320
{ 'command': 'query-status', 'returns': 'StatusInfo' }
321

    
322
##
323
# @UuidInfo:
324
#
325
# Guest UUID information.
326
#
327
# @UUID: the UUID of the guest
328
#
329
# Since: 0.14.0
330
#
331
# Notes: If no UUID was specified for the guest, a null UUID is returned.
332
##
333
{ 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
334

    
335
##
336
# @query-uuid:
337
#
338
# Query the guest UUID information.
339
#
340
# Returns: The @UuidInfo for the guest
341
#
342
# Since 0.14.0
343
##
344
{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
345

    
346
##
347
# @ChardevInfo:
348
#
349
# Information about a character device.
350
#
351
# @label: the label of the character device
352
#
353
# @filename: the filename of the character device
354
#
355
# Notes: @filename is encoded using the QEMU command line character device
356
#        encoding.  See the QEMU man page for details.
357
#
358
# Since: 0.14.0
359
##
360
{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
361

    
362
##
363
# @query-chardev:
364
#
365
# Returns information about current character devices.
366
#
367
# Returns: a list of @ChardevInfo
368
#
369
# Since: 0.14.0
370
##
371
{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
372

    
373
##
374
# @DataFormat:
375
#
376
# An enumeration of data format.
377
#
378
# @utf8: Data is a UTF-8 string (RFC 3629)
379
#
380
# @base64: Data is Base64 encoded binary (RFC 3548)
381
#
382
# Since: 1.4
383
##
384
{ 'enum': 'DataFormat'
385
  'data': [ 'utf8', 'base64' ] }
386

    
387
##
388
# @ringbuf-write:
389
#
390
# Write to a ring buffer character device.
391
#
392
# @device: the ring buffer character device name
393
#
394
# @data: data to write
395
#
396
# @format: #optional data encoding (default 'utf8').
397
#          - base64: data must be base64 encoded text.  Its binary
398
#            decoding gets written.
399
#            Bug: invalid base64 is currently not rejected.
400
#            Whitespace *is* invalid.
401
#          - utf8: data's UTF-8 encoding is written
402
#          - data itself is always Unicode regardless of format, like
403
#            any other string.
404
#
405
# Returns: Nothing on success
406
#
407
# Since: 1.4
408
##
409
{ 'command': 'ringbuf-write',
410
  'data': {'device': 'str', 'data': 'str',
411
           '*format': 'DataFormat'} }
412

    
413
##
414
# @ringbuf-read:
415
#
416
# Read from a ring buffer character device.
417
#
418
# @device: the ring buffer character device name
419
#
420
# @size: how many bytes to read at most
421
#
422
# @format: #optional data encoding (default 'utf8').
423
#          - base64: the data read is returned in base64 encoding.
424
#          - utf8: the data read is interpreted as UTF-8.
425
#            Bug: can screw up when the buffer contains invalid UTF-8
426
#            sequences, NUL characters, after the ring buffer lost
427
#            data, and when reading stops because the size limit is
428
#            reached.
429
#          - The return value is always Unicode regardless of format,
430
#            like any other string.
431
#
432
# Returns: data read from the device
433
#
434
# Since: 1.4
435
##
436
{ 'command': 'ringbuf-read',
437
  'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
438
  'returns': 'str' }
439

    
440
##
441
# @CommandInfo:
442
#
443
# Information about a QMP command
444
#
445
# @name: The command name
446
#
447
# Since: 0.14.0
448
##
449
{ 'type': 'CommandInfo', 'data': {'name': 'str'} }
450

    
451
##
452
# @query-commands:
453
#
454
# Return a list of supported QMP commands by this server
455
#
456
# Returns: A list of @CommandInfo for all supported commands
457
#
458
# Since: 0.14.0
459
##
460
{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
461

    
462
##
463
# @EventInfo:
464
#
465
# Information about a QMP event
466
#
467
# @name: The event name
468
#
469
# Since: 1.2.0
470
##
471
{ 'type': 'EventInfo', 'data': {'name': 'str'} }
472

    
473
##
474
# @query-events:
475
#
476
# Return a list of supported QMP events by this server
477
#
478
# Returns: A list of @EventInfo for all supported events
479
#
480
# Since: 1.2.0
481
##
482
{ 'command': 'query-events', 'returns': ['EventInfo'] }
483

    
484
##
485
# @MigrationStats
486
#
487
# Detailed migration status.
488
#
489
# @transferred: amount of bytes already transferred to the target VM
490
#
491
# @remaining: amount of bytes remaining to be transferred to the target VM
492
#
493
# @total: total amount of bytes involved in the migration process
494
#
495
# @duplicate: number of duplicate pages (since 1.2)
496
#
497
# @normal : number of normal pages (since 1.2)
498
#
499
# @normal-bytes: number of normal bytes sent (since 1.2)
500
#
501
# @dirty-pages-rate: number of pages dirtied by second by the
502
#        guest (since 1.3)
503
#
504
# Since: 0.14.0
505
##
506
{ 'type': 'MigrationStats',
507
  'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
508
           'duplicate': 'int', 'normal': 'int', 'normal-bytes': 'int',
509
           'dirty-pages-rate' : 'int' } }
510

    
511
##
512
# @XBZRLECacheStats
513
#
514
# Detailed XBZRLE migration cache statistics
515
#
516
# @cache-size: XBZRLE cache size
517
#
518
# @bytes: amount of bytes already transferred to the target VM
519
#
520
# @pages: amount of pages transferred to the target VM
521
#
522
# @cache-miss: number of cache miss
523
#
524
# @overflow: number of overflows
525
#
526
# Since: 1.2
527
##
528
{ 'type': 'XBZRLECacheStats',
529
  'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
530
           'cache-miss': 'int', 'overflow': 'int' } }
531

    
532
##
533
# @MigrationInfo
534
#
535
# Information about current migration process.
536
#
537
# @status: #optional string describing the current migration status.
538
#          As of 0.14.0 this can be 'active', 'completed', 'failed' or
539
#          'cancelled'. If this field is not returned, no migration process
540
#          has been initiated
541
#
542
# @ram: #optional @MigrationStats containing detailed migration
543
#       status, only returned if status is 'active' or
544
#       'completed'. 'comppleted' (since 1.2)
545
#
546
# @disk: #optional @MigrationStats containing detailed disk migration
547
#        status, only returned if status is 'active' and it is a block
548
#        migration
549
#
550
# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
551
#                migration statistics, only returned if XBZRLE feature is on and
552
#                status is 'active' or 'completed' (since 1.2)
553
#
554
# @total-time: #optional total amount of milliseconds since migration started.
555
#        If migration has ended, it returns the total migration
556
#        time. (since 1.2)
557
#
558
# @downtime: #optional only present when migration finishes correctly
559
#        total downtime in milliseconds for the guest.
560
#        (since 1.3)
561
#
562
# @expected-downtime: #optional only present while migration is active
563
#        expected downtime in milliseconds for the guest in last walk
564
#        of the dirty bitmap. (since 1.3)
565
#
566
# Since: 0.14.0
567
##
568
{ 'type': 'MigrationInfo',
569
  'data': {'*status': 'str', '*ram': 'MigrationStats',
570
           '*disk': 'MigrationStats',
571
           '*xbzrle-cache': 'XBZRLECacheStats',
572
           '*total-time': 'int',
573
           '*expected-downtime': 'int',
574
           '*downtime': 'int'} }
575

    
576
##
577
# @query-migrate
578
#
579
# Returns information about current migration process.
580
#
581
# Returns: @MigrationInfo
582
#
583
# Since: 0.14.0
584
##
585
{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
586

    
587
##
588
# @MigrationCapability
589
#
590
# Migration capabilities enumeration
591
#
592
# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
593
#          This feature allows us to minimize migration traffic for certain work
594
#          loads, by sending compressed difference of the pages
595
#
596
# Since: 1.2
597
##
598
{ 'enum': 'MigrationCapability',
599
  'data': ['xbzrle'] }
600

    
601
##
602
# @MigrationCapabilityStatus
603
#
604
# Migration capability information
605
#
606
# @capability: capability enum
607
#
608
# @state: capability state bool
609
#
610
# Since: 1.2
611
##
612
{ 'type': 'MigrationCapabilityStatus',
613
  'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
614

    
615
##
616
# @migrate-set-capabilities
617
#
618
# Enable/Disable the following migration capabilities (like xbzrle)
619
#
620
# @capabilities: json array of capability modifications to make
621
#
622
# Since: 1.2
623
##
624
{ 'command': 'migrate-set-capabilities',
625
  'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
626

    
627
##
628
# @query-migrate-capabilities
629
#
630
# Returns information about the current migration capabilities status
631
#
632
# Returns: @MigrationCapabilitiesStatus
633
#
634
# Since: 1.2
635
##
636
{ 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
637

    
638
##
639
# @MouseInfo:
640
#
641
# Information about a mouse device.
642
#
643
# @name: the name of the mouse device
644
#
645
# @index: the index of the mouse device
646
#
647
# @current: true if this device is currently receiving mouse events
648
#
649
# @absolute: true if this device supports absolute coordinates as input
650
#
651
# Since: 0.14.0
652
##
653
{ 'type': 'MouseInfo',
654
  'data': {'name': 'str', 'index': 'int', 'current': 'bool',
655
           'absolute': 'bool'} }
656

    
657
##
658
# @query-mice:
659
#
660
# Returns information about each active mouse device
661
#
662
# Returns: a list of @MouseInfo for each device
663
#
664
# Since: 0.14.0
665
##
666
{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
667

    
668
##
669
# @CpuInfo:
670
#
671
# Information about a virtual CPU
672
#
673
# @CPU: the index of the virtual CPU
674
#
675
# @current: this only exists for backwards compatible and should be ignored
676
#
677
# @halted: true if the virtual CPU is in the halt state.  Halt usually refers
678
#          to a processor specific low power mode.
679
#
680
# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
681
#                pointer.
682
#                If the target is Sparc, this is the PC component of the
683
#                instruction pointer.
684
#
685
# @nip: #optional If the target is PPC, the instruction pointer
686
#
687
# @npc: #optional If the target is Sparc, the NPC component of the instruction
688
#                 pointer
689
#
690
# @PC: #optional If the target is MIPS, the instruction pointer
691
#
692
# @thread_id: ID of the underlying host thread
693
#
694
# Since: 0.14.0
695
#
696
# Notes: @halted is a transient state that changes frequently.  By the time the
697
#        data is sent to the client, the guest may no longer be halted.
698
##
699
{ 'type': 'CpuInfo',
700
  'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
701
           '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
702

    
703
##
704
# @query-cpus:
705
#
706
# Returns a list of information about each virtual CPU.
707
#
708
# Returns: a list of @CpuInfo for each virtual CPU
709
#
710
# Since: 0.14.0
711
##
712
{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
713

    
714
##
715
# @BlockDeviceInfo:
716
#
717
# Information about the backing device for a block device.
718
#
719
# @file: the filename of the backing device
720
#
721
# @ro: true if the backing device was open read-only
722
#
723
# @drv: the name of the block format used to open the backing device. As of
724
#       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
725
#       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
726
#       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
727
#       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
728
#
729
# @backing_file: #optional the name of the backing file (for copy-on-write)
730
#
731
# @backing_file_depth: number of files in the backing file chain (since: 1.2)
732
#
733
# @encrypted: true if the backing device is encrypted
734
#
735
# @encryption_key_missing: true if the backing device is encrypted but an
736
#                          valid encryption key is missing
737
#
738
# @bps: total throughput limit in bytes per second is specified
739
#
740
# @bps_rd: read throughput limit in bytes per second is specified
741
#
742
# @bps_wr: write throughput limit in bytes per second is specified
743
#
744
# @iops: total I/O operations per second is specified
745
#
746
# @iops_rd: read I/O operations per second is specified
747
#
748
# @iops_wr: write I/O operations per second is specified
749
#
750
# Since: 0.14.0
751
#
752
# Notes: This interface is only found in @BlockInfo.
753
##
754
{ 'type': 'BlockDeviceInfo',
755
  'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
756
            '*backing_file': 'str', 'backing_file_depth': 'int',
757
            'encrypted': 'bool', 'encryption_key_missing': 'bool',
758
            'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
759
            'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
760

    
761
##
762
# @BlockDeviceIoStatus:
763
#
764
# An enumeration of block device I/O status.
765
#
766
# @ok: The last I/O operation has succeeded
767
#
768
# @failed: The last I/O operation has failed
769
#
770
# @nospace: The last I/O operation has failed due to a no-space condition
771
#
772
# Since: 1.0
773
##
774
{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
775

    
776
##
777
# @BlockDirtyInfo:
778
#
779
# Block dirty bitmap information.
780
#
781
# @count: number of dirty bytes according to the dirty bitmap
782
#
783
# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
784
#
785
# Since: 1.3
786
##
787
{ 'type': 'BlockDirtyInfo',
788
  'data': {'count': 'int', 'granularity': 'int'} }
789

    
790
##
791
# @BlockInfo:
792
#
793
# Block device information.  This structure describes a virtual device and
794
# the backing device associated with it.
795
#
796
# @device: The device name associated with the virtual device.
797
#
798
# @type: This field is returned only for compatibility reasons, it should
799
#        not be used (always returns 'unknown')
800
#
801
# @removable: True if the device supports removable media.
802
#
803
# @locked: True if the guest has locked this device from having its media
804
#          removed
805
#
806
# @tray_open: #optional True if the device has a tray and it is open
807
#             (only present if removable is true)
808
#
809
# @dirty: #optional dirty bitmap information (only present if the dirty
810
#         bitmap is enabled)
811
#
812
# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
813
#             supports it and the VM is configured to stop on errors
814
#
815
# @inserted: #optional @BlockDeviceInfo describing the device if media is
816
#            present
817
#
818
# Since:  0.14.0
819
##
820
{ 'type': 'BlockInfo',
821
  'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
822
           'locked': 'bool', '*inserted': 'BlockDeviceInfo',
823
           '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
824
           '*dirty': 'BlockDirtyInfo' } }
825

    
826
##
827
# @query-block:
828
#
829
# Get a list of BlockInfo for all virtual block devices.
830
#
831
# Returns: a list of @BlockInfo describing each virtual block device
832
#
833
# Since: 0.14.0
834
##
835
{ 'command': 'query-block', 'returns': ['BlockInfo'] }
836

    
837
##
838
# @BlockDeviceStats:
839
#
840
# Statistics of a virtual block device or a block backing device.
841
#
842
# @rd_bytes:      The number of bytes read by the device.
843
#
844
# @wr_bytes:      The number of bytes written by the device.
845
#
846
# @rd_operations: The number of read operations performed by the device.
847
#
848
# @wr_operations: The number of write operations performed by the device.
849
#
850
# @flush_operations: The number of cache flush operations performed by the
851
#                    device (since 0.15.0)
852
#
853
# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
854
#                       (since 0.15.0).
855
#
856
# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
857
#
858
# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
859
#
860
# @wr_highest_offset: The offset after the greatest byte written to the
861
#                     device.  The intended use of this information is for
862
#                     growable sparse files (like qcow2) that are used on top
863
#                     of a physical device.
864
#
865
# Since: 0.14.0
866
##
867
{ 'type': 'BlockDeviceStats',
868
  'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
869
           'wr_operations': 'int', 'flush_operations': 'int',
870
           'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
871
           'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
872

    
873
##
874
# @BlockStats:
875
#
876
# Statistics of a virtual block device or a block backing device.
877
#
878
# @device: #optional If the stats are for a virtual block device, the name
879
#          corresponding to the virtual block device.
880
#
881
# @stats:  A @BlockDeviceStats for the device.
882
#
883
# @parent: #optional This may point to the backing block device if this is a
884
#          a virtual block device.  If it's a backing block, this will point
885
#          to the backing file is one is present.
886
#
887
# Since: 0.14.0
888
##
889
{ 'type': 'BlockStats',
890
  'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
891
           '*parent': 'BlockStats'} }
892

    
893
##
894
# @query-blockstats:
895
#
896
# Query the @BlockStats for all virtual block devices.
897
#
898
# Returns: A list of @BlockStats for each virtual block devices.
899
#
900
# Since: 0.14.0
901
##
902
{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
903

    
904
##
905
# @VncClientInfo:
906
#
907
# Information about a connected VNC client.
908
#
909
# @host: The host name of the client.  QEMU tries to resolve this to a DNS name
910
#        when possible.
911
#
912
# @family: 'ipv6' if the client is connected via IPv6 and TCP
913
#          'ipv4' if the client is connected via IPv4 and TCP
914
#          'unix' if the client is connected via a unix domain socket
915
#          'unknown' otherwise
916
#
917
# @service: The service name of the client's port.  This may depends on the
918
#           host system's service database so symbolic names should not be
919
#           relied on.
920
#
921
# @x509_dname: #optional If x509 authentication is in use, the Distinguished
922
#              Name of the client.
923
#
924
# @sasl_username: #optional If SASL authentication is in use, the SASL username
925
#                 used for authentication.
926
#
927
# Since: 0.14.0
928
##
929
{ 'type': 'VncClientInfo',
930
  'data': {'host': 'str', 'family': 'str', 'service': 'str',
931
           '*x509_dname': 'str', '*sasl_username': 'str'} }
932

    
933
##
934
# @VncInfo:
935
#
936
# Information about the VNC session.
937
#
938
# @enabled: true if the VNC server is enabled, false otherwise
939
#
940
# @host: #optional The hostname the VNC server is bound to.  This depends on
941
#        the name resolution on the host and may be an IP address.
942
#
943
# @family: #optional 'ipv6' if the host is listening for IPv6 connections
944
#                    'ipv4' if the host is listening for IPv4 connections
945
#                    'unix' if the host is listening on a unix domain socket
946
#                    'unknown' otherwise
947
#
948
# @service: #optional The service name of the server's port.  This may depends
949
#           on the host system's service database so symbolic names should not
950
#           be relied on.
951
#
952
# @auth: #optional the current authentication type used by the server
953
#        'none' if no authentication is being used
954
#        'vnc' if VNC authentication is being used
955
#        'vencrypt+plain' if VEncrypt is used with plain text authentication
956
#        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
957
#        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
958
#        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
959
#        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
960
#        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
961
#        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
962
#        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
963
#        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
964
#
965
# @clients: a list of @VncClientInfo of all currently connected clients
966
#
967
# Since: 0.14.0
968
##
969
{ 'type': 'VncInfo',
970
  'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
971
           '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
972

    
973
##
974
# @query-vnc:
975
#
976
# Returns information about the current VNC server
977
#
978
# Returns: @VncInfo
979
#
980
# Since: 0.14.0
981
##
982
{ 'command': 'query-vnc', 'returns': 'VncInfo' }
983

    
984
##
985
# @SpiceChannel
986
#
987
# Information about a SPICE client channel.
988
#
989
# @host: The host name of the client.  QEMU tries to resolve this to a DNS name
990
#        when possible.
991
#
992
# @family: 'ipv6' if the client is connected via IPv6 and TCP
993
#          'ipv4' if the client is connected via IPv4 and TCP
994
#          'unix' if the client is connected via a unix domain socket
995
#          'unknown' otherwise
996
#
997
# @port: The client's port number.
998
#
999
# @connection-id: SPICE connection id number.  All channels with the same id
1000
#                 belong to the same SPICE session.
1001
#
1002
# @connection-type: SPICE channel type number.  "1" is the main control
1003
#                   channel, filter for this one if you want to track spice
1004
#                   sessions only
1005
#
1006
# @channel-id: SPICE channel ID number.  Usually "0", might be different when
1007
#              multiple channels of the same type exist, such as multiple
1008
#              display channels in a multihead setup
1009
#
1010
# @tls: true if the channel is encrypted, false otherwise.
1011
#
1012
# Since: 0.14.0
1013
##
1014
{ 'type': 'SpiceChannel',
1015
  'data': {'host': 'str', 'family': 'str', 'port': 'str',
1016
           'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1017
           'tls': 'bool'} }
1018

    
1019
##
1020
# @SpiceQueryMouseMode
1021
#
1022
# An enumeration of Spice mouse states.
1023
#
1024
# @client: Mouse cursor position is determined by the client.
1025
#
1026
# @server: Mouse cursor position is determined by the server.
1027
#
1028
# @unknown: No information is available about mouse mode used by
1029
#           the spice server.
1030
#
1031
# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1032
#
1033
# Since: 1.1
1034
##
1035
{ 'enum': 'SpiceQueryMouseMode',
1036
  'data': [ 'client', 'server', 'unknown' ] }
1037

    
1038
##
1039
# @SpiceInfo
1040
#
1041
# Information about the SPICE session.
1042
#
1043
# @enabled: true if the SPICE server is enabled, false otherwise
1044
#
1045
# @migrated: true if the last guest migration completed and spice
1046
#            migration had completed as well. false otherwise.
1047
#
1048
# @host: #optional The hostname the SPICE server is bound to.  This depends on
1049
#        the name resolution on the host and may be an IP address.
1050
#
1051
# @port: #optional The SPICE server's port number.
1052
#
1053
# @compiled-version: #optional SPICE server version.
1054
#
1055
# @tls-port: #optional The SPICE server's TLS port number.
1056
#
1057
# @auth: #optional the current authentication type used by the server
1058
#        'none'  if no authentication is being used
1059
#        'spice' uses SASL or direct TLS authentication, depending on command
1060
#                line options
1061
#
1062
# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1063
#              be determined by the client or the server, or unknown if spice
1064
#              server doesn't provide this information.
1065
#
1066
#              Since: 1.1
1067
#
1068
# @channels: a list of @SpiceChannel for each active spice channel
1069
#
1070
# Since: 0.14.0
1071
##
1072
{ 'type': 'SpiceInfo',
1073
  'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1074
           '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1075
           'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1076

    
1077
##
1078
# @query-spice
1079
#
1080
# Returns information about the current SPICE server
1081
#
1082
# Returns: @SpiceInfo
1083
#
1084
# Since: 0.14.0
1085
##
1086
{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
1087

    
1088
##
1089
# @BalloonInfo:
1090
#
1091
# Information about the guest balloon device.
1092
#
1093
# @actual: the number of bytes the balloon currently contains
1094
#
1095
# Since: 0.14.0
1096
#
1097
##
1098
{ 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1099

    
1100
##
1101
# @query-balloon:
1102
#
1103
# Return information about the balloon device.
1104
#
1105
# Returns: @BalloonInfo on success
1106
#          If the balloon driver is enabled but not functional because the KVM
1107
#          kernel module cannot support it, KvmMissingCap
1108
#          If no balloon device is present, DeviceNotActive
1109
#
1110
# Since: 0.14.0
1111
##
1112
{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1113

    
1114
##
1115
# @PciMemoryRange:
1116
#
1117
# A PCI device memory region
1118
#
1119
# @base: the starting address (guest physical)
1120
#
1121
# @limit: the ending address (guest physical)
1122
#
1123
# Since: 0.14.0
1124
##
1125
{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1126

    
1127
##
1128
# @PciMemoryRegion
1129
#
1130
# Information about a PCI device I/O region.
1131
#
1132
# @bar: the index of the Base Address Register for this region
1133
#
1134
# @type: 'io' if the region is a PIO region
1135
#        'memory' if the region is a MMIO region
1136
#
1137
# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1138
#
1139
# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1140
#
1141
# Since: 0.14.0
1142
##
1143
{ 'type': 'PciMemoryRegion',
1144
  'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1145
           '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1146

    
1147
##
1148
# @PciBridgeInfo:
1149
#
1150
# Information about a PCI Bridge device
1151
#
1152
# @bus.number: primary bus interface number.  This should be the number of the
1153
#              bus the device resides on.
1154
#
1155
# @bus.secondary: secondary bus interface number.  This is the number of the
1156
#                 main bus for the bridge
1157
#
1158
# @bus.subordinate: This is the highest number bus that resides below the
1159
#                   bridge.
1160
#
1161
# @bus.io_range: The PIO range for all devices on this bridge
1162
#
1163
# @bus.memory_range: The MMIO range for all devices on this bridge
1164
#
1165
# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1166
#                          this bridge
1167
#
1168
# @devices: a list of @PciDeviceInfo for each device on this bridge
1169
#
1170
# Since: 0.14.0
1171
##
1172
{ 'type': 'PciBridgeInfo',
1173
  'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1174
                    'io_range': 'PciMemoryRange',
1175
                    'memory_range': 'PciMemoryRange',
1176
                    'prefetchable_range': 'PciMemoryRange' },
1177
           '*devices': ['PciDeviceInfo']} }
1178

    
1179
##
1180
# @PciDeviceInfo:
1181
#
1182
# Information about a PCI device
1183
#
1184
# @bus: the bus number of the device
1185
#
1186
# @slot: the slot the device is located in
1187
#
1188
# @function: the function of the slot used by the device
1189
#
1190
# @class_info.desc: #optional a string description of the device's class
1191
#
1192
# @class_info.class: the class code of the device
1193
#
1194
# @id.device: the PCI device id
1195
#
1196
# @id.vendor: the PCI vendor id
1197
#
1198
# @irq: #optional if an IRQ is assigned to the device, the IRQ number
1199
#
1200
# @qdev_id: the device name of the PCI device
1201
#
1202
# @pci_bridge: if the device is a PCI bridge, the bridge information
1203
#
1204
# @regions: a list of the PCI I/O regions associated with the device
1205
#
1206
# Notes: the contents of @class_info.desc are not stable and should only be
1207
#        treated as informational.
1208
#
1209
# Since: 0.14.0
1210
##
1211
{ 'type': 'PciDeviceInfo',
1212
  'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1213
           'class_info': {'*desc': 'str', 'class': 'int'},
1214
           'id': {'device': 'int', 'vendor': 'int'},
1215
           '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1216
           'regions': ['PciMemoryRegion']} }
1217

    
1218
##
1219
# @PciInfo:
1220
#
1221
# Information about a PCI bus
1222
#
1223
# @bus: the bus index
1224
#
1225
# @devices: a list of devices on this bus
1226
#
1227
# Since: 0.14.0
1228
##
1229
{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1230

    
1231
##
1232
# @query-pci:
1233
#
1234
# Return information about the PCI bus topology of the guest.
1235
#
1236
# Returns: a list of @PciInfo for each PCI bus
1237
#
1238
# Since: 0.14.0
1239
##
1240
{ 'command': 'query-pci', 'returns': ['PciInfo'] }
1241

    
1242
##
1243
# @BlockdevOnError:
1244
#
1245
# An enumeration of possible behaviors for errors on I/O operations.
1246
# The exact meaning depends on whether the I/O was initiated by a guest
1247
# or by a block job
1248
#
1249
# @report: for guest operations, report the error to the guest;
1250
#          for jobs, cancel the job
1251
#
1252
# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1253
#          or BLOCK_JOB_ERROR)
1254
#
1255
# @enospc: same as @stop on ENOSPC, same as @report otherwise.
1256
#
1257
# @stop: for guest operations, stop the virtual machine;
1258
#        for jobs, pause the job
1259
#
1260
# Since: 1.3
1261
##
1262
{ 'enum': 'BlockdevOnError',
1263
  'data': ['report', 'ignore', 'enospc', 'stop'] }
1264

    
1265
##
1266
# @MirrorSyncMode:
1267
#
1268
# An enumeration of possible behaviors for the initial synchronization
1269
# phase of storage mirroring.
1270
#
1271
# @top: copies data in the topmost image to the destination
1272
#
1273
# @full: copies data from all images to the destination
1274
#
1275
# @none: only copy data written from now on
1276
#
1277
# Since: 1.3
1278
##
1279
{ 'enum': 'MirrorSyncMode',
1280
  'data': ['top', 'full', 'none'] }
1281

    
1282
##
1283
# @BlockJobInfo:
1284
#
1285
# Information about a long-running block device operation.
1286
#
1287
# @type: the job type ('stream' for image streaming)
1288
#
1289
# @device: the block device name
1290
#
1291
# @len: the maximum progress value
1292
#
1293
# @busy: false if the job is known to be in a quiescent state, with
1294
#        no pending I/O.  Since 1.3.
1295
#
1296
# @paused: whether the job is paused or, if @busy is true, will
1297
#          pause itself as soon as possible.  Since 1.3.
1298
#
1299
# @offset: the current progress value
1300
#
1301
# @speed: the rate limit, bytes per second
1302
#
1303
# @io-status: the status of the job (since 1.3)
1304
#
1305
# Since: 1.1
1306
##
1307
{ 'type': 'BlockJobInfo',
1308
  'data': {'type': 'str', 'device': 'str', 'len': 'int',
1309
           'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1310
           'io-status': 'BlockDeviceIoStatus'} }
1311

    
1312
##
1313
# @query-block-jobs:
1314
#
1315
# Return information about long-running block device operations.
1316
#
1317
# Returns: a list of @BlockJobInfo for each active block job
1318
#
1319
# Since: 1.1
1320
##
1321
{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1322

    
1323
##
1324
# @quit:
1325
#
1326
# This command will cause the QEMU process to exit gracefully.  While every
1327
# attempt is made to send the QMP response before terminating, this is not
1328
# guaranteed.  When using this interface, a premature EOF would not be
1329
# unexpected.
1330
#
1331
# Since: 0.14.0
1332
##
1333
{ 'command': 'quit' }
1334

    
1335
##
1336
# @stop:
1337
#
1338
# Stop all guest VCPU execution.
1339
#
1340
# Since:  0.14.0
1341
#
1342
# Notes:  This function will succeed even if the guest is already in the stopped
1343
#         state.  In "inmigrate" state, it will ensure that the guest
1344
#         remains paused once migration finishes, as if the -S option was
1345
#         passed on the command line.
1346
##
1347
{ 'command': 'stop' }
1348

    
1349
##
1350
# @system_reset:
1351
#
1352
# Performs a hard reset of a guest.
1353
#
1354
# Since: 0.14.0
1355
##
1356
{ 'command': 'system_reset' }
1357

    
1358
##
1359
# @system_powerdown:
1360
#
1361
# Requests that a guest perform a powerdown operation.
1362
#
1363
# Since: 0.14.0
1364
#
1365
# Notes: A guest may or may not respond to this command.  This command
1366
#        returning does not indicate that a guest has accepted the request or
1367
#        that it has shut down.  Many guests will respond to this command by
1368
#        prompting the user in some way.
1369
##
1370
{ 'command': 'system_powerdown' }
1371

    
1372
##
1373
# @cpu:
1374
#
1375
# This command is a nop that is only provided for the purposes of compatibility.
1376
#
1377
# Since: 0.14.0
1378
#
1379
# Notes: Do not use this command.
1380
##
1381
{ 'command': 'cpu', 'data': {'index': 'int'} }
1382

    
1383
##
1384
# @memsave:
1385
#
1386
# Save a portion of guest memory to a file.
1387
#
1388
# @val: the virtual address of the guest to start from
1389
#
1390
# @size: the size of memory region to save
1391
#
1392
# @filename: the file to save the memory to as binary data
1393
#
1394
# @cpu-index: #optional the index of the virtual CPU to use for translating the
1395
#                       virtual address (defaults to CPU 0)
1396
#
1397
# Returns: Nothing on success
1398
#
1399
# Since: 0.14.0
1400
#
1401
# Notes: Errors were not reliably returned until 1.1
1402
##
1403
{ 'command': 'memsave',
1404
  'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1405

    
1406
##
1407
# @pmemsave:
1408
#
1409
# Save a portion of guest physical memory to a file.
1410
#
1411
# @val: the physical address of the guest to start from
1412
#
1413
# @size: the size of memory region to save
1414
#
1415
# @filename: the file to save the memory to as binary data
1416
#
1417
# Returns: Nothing on success
1418
#
1419
# Since: 0.14.0
1420
#
1421
# Notes: Errors were not reliably returned until 1.1
1422
##
1423
{ 'command': 'pmemsave',
1424
  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1425

    
1426
##
1427
# @cont:
1428
#
1429
# Resume guest VCPU execution.
1430
#
1431
# Since:  0.14.0
1432
#
1433
# Returns:  If successful, nothing
1434
#           If QEMU was started with an encrypted block device and a key has
1435
#              not yet been set, DeviceEncrypted.
1436
#
1437
# Notes:  This command will succeed if the guest is currently running.  It
1438
#         will also succeed if the guest is in the "inmigrate" state; in
1439
#         this case, the effect of the command is to make sure the guest
1440
#         starts once migration finishes, removing the effect of the -S
1441
#         command line option if it was passed.
1442
##
1443
{ 'command': 'cont' }
1444

    
1445
##
1446
# @system_wakeup:
1447
#
1448
# Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1449
#
1450
# Since:  1.1
1451
#
1452
# Returns:  nothing.
1453
##
1454
{ 'command': 'system_wakeup' }
1455

    
1456
##
1457
# @inject-nmi:
1458
#
1459
# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1460
#
1461
# Returns:  If successful, nothing
1462
#
1463
# Since:  0.14.0
1464
#
1465
# Notes: Only x86 Virtual Machines support this command.
1466
##
1467
{ 'command': 'inject-nmi' }
1468

    
1469
##
1470
# @set_link:
1471
#
1472
# Sets the link status of a virtual network adapter.
1473
#
1474
# @name: the device name of the virtual network adapter
1475
#
1476
# @up: true to set the link status to be up
1477
#
1478
# Returns: Nothing on success
1479
#          If @name is not a valid network device, DeviceNotFound
1480
#
1481
# Since: 0.14.0
1482
#
1483
# Notes: Not all network adapters support setting link status.  This command
1484
#        will succeed even if the network adapter does not support link status
1485
#        notification.
1486
##
1487
{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1488

    
1489
##
1490
# @block_passwd:
1491
#
1492
# This command sets the password of a block device that has not been open
1493
# with a password and requires one.
1494
#
1495
# The two cases where this can happen are a block device is created through
1496
# QEMU's initial command line or a block device is changed through the legacy
1497
# @change interface.
1498
#
1499
# In the event that the block device is created through the initial command
1500
# line, the VM will start in the stopped state regardless of whether '-S' is
1501
# used.  The intention is for a management tool to query the block devices to
1502
# determine which ones are encrypted, set the passwords with this command, and
1503
# then start the guest with the @cont command.
1504
#
1505
# @device:   the name of the device to set the password on
1506
#
1507
# @password: the password to use for the device
1508
#
1509
# Returns: nothing on success
1510
#          If @device is not a valid block device, DeviceNotFound
1511
#          If @device is not encrypted, DeviceNotEncrypted
1512
#
1513
# Notes:  Not all block formats support encryption and some that do are not
1514
#         able to validate that a password is correct.  Disk corruption may
1515
#         occur if an invalid password is specified.
1516
#
1517
# Since: 0.14.0
1518
##
1519
{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1520

    
1521
##
1522
# @balloon:
1523
#
1524
# Request the balloon driver to change its balloon size.
1525
#
1526
# @value: the target size of the balloon in bytes
1527
#
1528
# Returns: Nothing on success
1529
#          If the balloon driver is enabled but not functional because the KVM
1530
#            kernel module cannot support it, KvmMissingCap
1531
#          If no balloon device is present, DeviceNotActive
1532
#
1533
# Notes: This command just issues a request to the guest.  When it returns,
1534
#        the balloon size may not have changed.  A guest can change the balloon
1535
#        size independent of this command.
1536
#
1537
# Since: 0.14.0
1538
##
1539
{ 'command': 'balloon', 'data': {'value': 'int'} }
1540

    
1541
##
1542
# @block_resize
1543
#
1544
# Resize a block image while a guest is running.
1545
#
1546
# @device:  the name of the device to get the image resized
1547
#
1548
# @size:  new image size in bytes
1549
#
1550
# Returns: nothing on success
1551
#          If @device is not a valid block device, DeviceNotFound
1552
#
1553
# Since: 0.14.0
1554
##
1555
{ 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1556

    
1557
##
1558
# @NewImageMode
1559
#
1560
# An enumeration that tells QEMU how to set the backing file path in
1561
# a new image file.
1562
#
1563
# @existing: QEMU should look for an existing image file.
1564
#
1565
# @absolute-paths: QEMU should create a new image with absolute paths
1566
# for the backing file.
1567
#
1568
# Since: 1.1
1569
##
1570
{ 'enum': 'NewImageMode'
1571
  'data': [ 'existing', 'absolute-paths' ] }
1572

    
1573
##
1574
# @BlockdevSnapshot
1575
#
1576
# @device:  the name of the device to generate the snapshot from.
1577
#
1578
# @snapshot-file: the target of the new image. A new file will be created.
1579
#
1580
# @format: #optional the format of the snapshot image, default is 'qcow2'.
1581
#
1582
# @mode: #optional whether and how QEMU should create a new image, default is
1583
#        'absolute-paths'.
1584
##
1585
{ 'type': 'BlockdevSnapshot',
1586
  'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1587
            '*mode': 'NewImageMode' } }
1588

    
1589
##
1590
# @BlockdevAction
1591
#
1592
# A discriminated record of operations that can be performed with
1593
# @transaction.
1594
##
1595
{ 'union': 'BlockdevAction',
1596
  'data': {
1597
       'blockdev-snapshot-sync': 'BlockdevSnapshot',
1598
   } }
1599

    
1600
##
1601
# @transaction
1602
#
1603
# Atomically operate on a group of one or more block devices.  If
1604
# any operation fails, then the entire set of actions will be
1605
# abandoned and the appropriate error returned.  The only operation
1606
# supported is currently blockdev-snapshot-sync.
1607
#
1608
#  List of:
1609
#  @BlockdevAction: information needed for the device snapshot
1610
#
1611
# Returns: nothing on success
1612
#          If @device is not a valid block device, DeviceNotFound
1613
#
1614
# Note: The transaction aborts on the first failure.  Therefore, there will
1615
# be only one device or snapshot file returned in an error condition, and
1616
# subsequent actions will not have been attempted.
1617
#
1618
# Since 1.1
1619
##
1620
{ 'command': 'transaction',
1621
  'data': { 'actions': [ 'BlockdevAction' ] } }
1622

    
1623
##
1624
# @blockdev-snapshot-sync
1625
#
1626
# Generates a synchronous snapshot of a block device.
1627
#
1628
# @device:  the name of the device to generate the snapshot from.
1629
#
1630
# @snapshot-file: the target of the new image. If the file exists, or if it
1631
#                 is a device, the snapshot will be created in the existing
1632
#                 file/device. If does not exist, a new file will be created.
1633
#
1634
# @format: #optional the format of the snapshot image, default is 'qcow2'.
1635
#
1636
# @mode: #optional whether and how QEMU should create a new image, default is
1637
#        'absolute-paths'.
1638
#
1639
# Returns: nothing on success
1640
#          If @device is not a valid block device, DeviceNotFound
1641
#
1642
# Since 0.14.0
1643
##
1644
{ 'command': 'blockdev-snapshot-sync',
1645
  'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1646
            '*mode': 'NewImageMode'} }
1647

    
1648
##
1649
# @human-monitor-command:
1650
#
1651
# Execute a command on the human monitor and return the output.
1652
#
1653
# @command-line: the command to execute in the human monitor
1654
#
1655
# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1656
#
1657
# Returns: the output of the command as a string
1658
#
1659
# Since: 0.14.0
1660
#
1661
# Notes: This command only exists as a stop-gap.  It's use is highly
1662
#        discouraged.  The semantics of this command are not guaranteed.
1663
#
1664
#        Known limitations:
1665
#
1666
#        o This command is stateless, this means that commands that depend
1667
#          on state information (such as getfd) might not work
1668
#
1669
#       o Commands that prompt the user for data (eg. 'cont' when the block
1670
#         device is encrypted) don't currently work
1671
##
1672
{ 'command': 'human-monitor-command',
1673
  'data': {'command-line': 'str', '*cpu-index': 'int'},
1674
  'returns': 'str' }
1675

    
1676
##
1677
# @block-commit
1678
#
1679
# Live commit of data from overlay image nodes into backing nodes - i.e.,
1680
# writes data between 'top' and 'base' into 'base'.
1681
#
1682
# @device:  the name of the device
1683
#
1684
# @base:   #optional The file name of the backing image to write data into.
1685
#                    If not specified, this is the deepest backing image
1686
#
1687
# @top:              The file name of the backing image within the image chain,
1688
#                    which contains the topmost data to be committed down.
1689
#                    Note, the active layer as 'top' is currently unsupported.
1690
#
1691
#                    If top == base, that is an error.
1692
#
1693
#
1694
# @speed:  #optional the maximum speed, in bytes per second
1695
#
1696
# Returns: Nothing on success
1697
#          If commit or stream is already active on this device, DeviceInUse
1698
#          If @device does not exist, DeviceNotFound
1699
#          If image commit is not supported by this device, NotSupported
1700
#          If @base or @top is invalid, a generic error is returned
1701
#          If @top is the active layer, or omitted, a generic error is returned
1702
#          If @speed is invalid, InvalidParameter
1703
#
1704
# Since: 1.3
1705
#
1706
##
1707
{ 'command': 'block-commit',
1708
  'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1709
            '*speed': 'int' } }
1710

    
1711
##
1712
# @drive-mirror
1713
#
1714
# Start mirroring a block device's writes to a new destination.
1715
#
1716
# @device:  the name of the device whose writes should be mirrored.
1717
#
1718
# @target: the target of the new image. If the file exists, or if it
1719
#          is a device, the existing file/device will be used as the new
1720
#          destination.  If it does not exist, a new file will be created.
1721
#
1722
# @format: #optional the format of the new destination, default is to
1723
#          probe if @mode is 'existing', else the format of the source
1724
#
1725
# @mode: #optional whether and how QEMU should create a new image, default is
1726
#        'absolute-paths'.
1727
#
1728
# @speed:  #optional the maximum speed, in bytes per second
1729
#
1730
# @sync: what parts of the disk image should be copied to the destination
1731
#        (all the disk, only the sectors allocated in the topmost image, or
1732
#        only new I/O).
1733
#
1734
# @granularity: #optional granularity of the dirty bitmap, default is 64K
1735
#               if the image format doesn't have clusters, 4K if the clusters
1736
#               are smaller than that, else the cluster size.  Must be a
1737
#               power of 2 between 512 and 64M (since 1.4).
1738
#
1739
# @buf-size: #optional maximum amount of data in flight from source to
1740
#            target (since 1.4).
1741
#
1742
# @on-source-error: #optional the action to take on an error on the source,
1743
#                   default 'report'.  'stop' and 'enospc' can only be used
1744
#                   if the block device supports io-status (see BlockInfo).
1745
#
1746
# @on-target-error: #optional the action to take on an error on the target,
1747
#                   default 'report' (no limitations, since this applies to
1748
#                   a different block device than @device).
1749
#
1750
# Returns: nothing on success
1751
#          If @device is not a valid block device, DeviceNotFound
1752
#
1753
# Since 1.3
1754
##
1755
{ 'command': 'drive-mirror',
1756
  'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1757
            'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1758
            '*speed': 'int', '*granularity': 'uint32',
1759
            '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1760
            '*on-target-error': 'BlockdevOnError' } }
1761

    
1762
##
1763
# @migrate_cancel
1764
#
1765
# Cancel the current executing migration process.
1766
#
1767
# Returns: nothing on success
1768
#
1769
# Notes: This command succeeds even if there is no migration process running.
1770
#
1771
# Since: 0.14.0
1772
##
1773
{ 'command': 'migrate_cancel' }
1774

    
1775
##
1776
# @migrate_set_downtime
1777
#
1778
# Set maximum tolerated downtime for migration.
1779
#
1780
# @value: maximum downtime in seconds
1781
#
1782
# Returns: nothing on success
1783
#
1784
# Since: 0.14.0
1785
##
1786
{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1787

    
1788
##
1789
# @migrate_set_speed
1790
#
1791
# Set maximum speed for migration.
1792
#
1793
# @value: maximum speed in bytes.
1794
#
1795
# Returns: nothing on success
1796
#
1797
# Notes: A value lesser than zero will be automatically round up to zero.
1798
#
1799
# Since: 0.14.0
1800
##
1801
{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1802

    
1803
##
1804
# @migrate-set-cache-size
1805
#
1806
# Set XBZRLE cache size
1807
#
1808
# @value: cache size in bytes
1809
#
1810
# The size will be rounded down to the nearest power of 2.
1811
# The cache size can be modified before and during ongoing migration
1812
#
1813
# Returns: nothing on success
1814
#
1815
# Since: 1.2
1816
##
1817
{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1818

    
1819
##
1820
# @query-migrate-cache-size
1821
#
1822
# query XBZRLE cache size
1823
#
1824
# Returns: XBZRLE cache size in bytes
1825
#
1826
# Since: 1.2
1827
##
1828
{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
1829

    
1830
##
1831
# @ObjectPropertyInfo:
1832
#
1833
# @name: the name of the property
1834
#
1835
# @type: the type of the property.  This will typically come in one of four
1836
#        forms:
1837
#
1838
#        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1839
#           These types are mapped to the appropriate JSON type.
1840
#
1841
#        2) A legacy type in the form 'legacy<subtype>' where subtype is the
1842
#           legacy qdev typename.  These types are always treated as strings.
1843
#
1844
#        3) A child type in the form 'child<subtype>' where subtype is a qdev
1845
#           device type name.  Child properties create the composition tree.
1846
#
1847
#        4) A link type in the form 'link<subtype>' where subtype is a qdev
1848
#           device type name.  Link properties form the device model graph.
1849
#
1850
# Since: 1.2
1851
##
1852
{ 'type': 'ObjectPropertyInfo',
1853
  'data': { 'name': 'str', 'type': 'str' } }
1854

    
1855
##
1856
# @qom-list:
1857
#
1858
# This command will list any properties of a object given a path in the object
1859
# model.
1860
#
1861
# @path: the path within the object model.  See @qom-get for a description of
1862
#        this parameter.
1863
#
1864
# Returns: a list of @ObjectPropertyInfo that describe the properties of the
1865
#          object.
1866
#
1867
# Since: 1.2
1868
##
1869
{ 'command': 'qom-list',
1870
  'data': { 'path': 'str' },
1871
  'returns': [ 'ObjectPropertyInfo' ] }
1872

    
1873
##
1874
# @qom-get:
1875
#
1876
# This command will get a property from a object model path and return the
1877
# value.
1878
#
1879
# @path: The path within the object model.  There are two forms of supported
1880
#        paths--absolute and partial paths.
1881
#
1882
#        Absolute paths are derived from the root object and can follow child<>
1883
#        or link<> properties.  Since they can follow link<> properties, they
1884
#        can be arbitrarily long.  Absolute paths look like absolute filenames
1885
#        and are prefixed  with a leading slash.
1886
#
1887
#        Partial paths look like relative filenames.  They do not begin
1888
#        with a prefix.  The matching rules for partial paths are subtle but
1889
#        designed to make specifying objects easy.  At each level of the
1890
#        composition tree, the partial path is matched as an absolute path.
1891
#        The first match is not returned.  At least two matches are searched
1892
#        for.  A successful result is only returned if only one match is
1893
#        found.  If more than one match is found, a flag is return to
1894
#        indicate that the match was ambiguous.
1895
#
1896
# @property: The property name to read
1897
#
1898
# Returns: The property value.  The type depends on the property type.  legacy<>
1899
#          properties are returned as #str.  child<> and link<> properties are
1900
#          returns as #str pathnames.  All integer property types (u8, u16, etc)
1901
#          are returned as #int.
1902
#
1903
# Since: 1.2
1904
##
1905
{ 'command': 'qom-get',
1906
  'data': { 'path': 'str', 'property': 'str' },
1907
  'returns': 'visitor',
1908
  'gen': 'no' }
1909

    
1910
##
1911
# @qom-set:
1912
#
1913
# This command will set a property from a object model path.
1914
#
1915
# @path: see @qom-get for a description of this parameter
1916
#
1917
# @property: the property name to set
1918
#
1919
# @value: a value who's type is appropriate for the property type.  See @qom-get
1920
#         for a description of type mapping.
1921
#
1922
# Since: 1.2
1923
##
1924
{ 'command': 'qom-set',
1925
  'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1926
  'gen': 'no' }
1927

    
1928
##
1929
# @set_password:
1930
#
1931
# Sets the password of a remote display session.
1932
#
1933
# @protocol: `vnc' to modify the VNC server password
1934
#            `spice' to modify the Spice server password
1935
#
1936
# @password: the new password
1937
#
1938
# @connected: #optional how to handle existing clients when changing the
1939
#                       password.  If nothing is specified, defaults to `keep'
1940
#                       `fail' to fail the command if clients are connected
1941
#                       `disconnect' to disconnect existing clients
1942
#                       `keep' to maintain existing clients
1943
#
1944
# Returns: Nothing on success
1945
#          If Spice is not enabled, DeviceNotFound
1946
#
1947
# Since: 0.14.0
1948
##
1949
{ 'command': 'set_password',
1950
  'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
1951

    
1952
##
1953
# @expire_password:
1954
#
1955
# Expire the password of a remote display server.
1956
#
1957
# @protocol: the name of the remote display protocol `vnc' or `spice'
1958
#
1959
# @time: when to expire the password.
1960
#        `now' to expire the password immediately
1961
#        `never' to cancel password expiration
1962
#        `+INT' where INT is the number of seconds from now (integer)
1963
#        `INT' where INT is the absolute time in seconds
1964
#
1965
# Returns: Nothing on success
1966
#          If @protocol is `spice' and Spice is not active, DeviceNotFound
1967
#
1968
# Since: 0.14.0
1969
#
1970
# Notes: Time is relative to the server and currently there is no way to
1971
#        coordinate server time with client time.  It is not recommended to
1972
#        use the absolute time version of the @time parameter unless you're
1973
#        sure you are on the same machine as the QEMU instance.
1974
##
1975
{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
1976

    
1977
##
1978
# @eject:
1979
#
1980
# Ejects a device from a removable drive.
1981
#
1982
# @device:  The name of the device
1983
#
1984
# @force:   @optional If true, eject regardless of whether the drive is locked.
1985
#           If not specified, the default value is false.
1986
#
1987
# Returns:  Nothing on success
1988
#           If @device is not a valid block device, DeviceNotFound
1989
#
1990
# Notes:    Ejecting a device will no media results in success
1991
#
1992
# Since: 0.14.0
1993
##
1994
{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
1995

    
1996
##
1997
# @change-vnc-password:
1998
#
1999
# Change the VNC server password.
2000
#
2001
# @target:  the new password to use with VNC authentication
2002
#
2003
# Since: 1.1
2004
#
2005
# Notes:  An empty password in this command will set the password to the empty
2006
#         string.  Existing clients are unaffected by executing this command.
2007
##
2008
{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2009

    
2010
##
2011
# @change:
2012
#
2013
# This command is multiple commands multiplexed together.
2014
#
2015
# @device: This is normally the name of a block device but it may also be 'vnc'.
2016
#          when it's 'vnc', then sub command depends on @target
2017
#
2018
# @target: If @device is a block device, then this is the new filename.
2019
#          If @device is 'vnc', then if the value 'password' selects the vnc
2020
#          change password command.   Otherwise, this specifies a new server URI
2021
#          address to listen to for VNC connections.
2022
#
2023
# @arg:    If @device is a block device, then this is an optional format to open
2024
#          the device with.
2025
#          If @device is 'vnc' and @target is 'password', this is the new VNC
2026
#          password to set.  If this argument is an empty string, then no future
2027
#          logins will be allowed.
2028
#
2029
# Returns: Nothing on success.
2030
#          If @device is not a valid block device, DeviceNotFound
2031
#          If the new block device is encrypted, DeviceEncrypted.  Note that
2032
#          if this error is returned, the device has been opened successfully
2033
#          and an additional call to @block_passwd is required to set the
2034
#          device's password.  The behavior of reads and writes to the block
2035
#          device between when these calls are executed is undefined.
2036
#
2037
# Notes:  It is strongly recommended that this interface is not used especially
2038
#         for changing block devices.
2039
#
2040
# Since: 0.14.0
2041
##
2042
{ 'command': 'change',
2043
  'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2044

    
2045
##
2046
# @block_set_io_throttle:
2047
#
2048
# Change I/O throttle limits for a block drive.
2049
#
2050
# @device: The name of the device
2051
#
2052
# @bps: total throughput limit in bytes per second
2053
#
2054
# @bps_rd: read throughput limit in bytes per second
2055
#
2056
# @bps_wr: write throughput limit in bytes per second
2057
#
2058
# @iops: total I/O operations per second
2059
#
2060
# @ops_rd: read I/O operations per second
2061
#
2062
# @iops_wr: write I/O operations per second
2063
#
2064
# Returns: Nothing on success
2065
#          If @device is not a valid block device, DeviceNotFound
2066
#
2067
# Since: 1.1
2068
##
2069
{ 'command': 'block_set_io_throttle',
2070
  'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2071
            'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
2072

    
2073
##
2074
# @block-stream:
2075
#
2076
# Copy data from a backing file into a block device.
2077
#
2078
# The block streaming operation is performed in the background until the entire
2079
# backing file has been copied.  This command returns immediately once streaming
2080
# has started.  The status of ongoing block streaming operations can be checked
2081
# with query-block-jobs.  The operation can be stopped before it has completed
2082
# using the block-job-cancel command.
2083
#
2084
# If a base file is specified then sectors are not copied from that base file and
2085
# its backing chain.  When streaming completes the image file will have the base
2086
# file as its backing file.  This can be used to stream a subset of the backing
2087
# file chain instead of flattening the entire image.
2088
#
2089
# On successful completion the image file is updated to drop the backing file
2090
# and the BLOCK_JOB_COMPLETED event is emitted.
2091
#
2092
# @device: the device name
2093
#
2094
# @base:   #optional the common backing file name
2095
#
2096
# @speed:  #optional the maximum speed, in bytes per second
2097
#
2098
# @on-error: #optional the action to take on an error (default report).
2099
#            'stop' and 'enospc' can only be used if the block device
2100
#            supports io-status (see BlockInfo).  Since 1.3.
2101
#
2102
# Returns: Nothing on success
2103
#          If @device does not exist, DeviceNotFound
2104
#
2105
# Since: 1.1
2106
##
2107
{ 'command': 'block-stream',
2108
  'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2109
            '*on-error': 'BlockdevOnError' } }
2110

    
2111
##
2112
# @block-job-set-speed:
2113
#
2114
# Set maximum speed for a background block operation.
2115
#
2116
# This command can only be issued when there is an active block job.
2117
#
2118
# Throttling can be disabled by setting the speed to 0.
2119
#
2120
# @device: the device name
2121
#
2122
# @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2123
#          Defaults to 0.
2124
#
2125
# Returns: Nothing on success
2126
#          If no background operation is active on this device, DeviceNotActive
2127
#
2128
# Since: 1.1
2129
##
2130
{ 'command': 'block-job-set-speed',
2131
  'data': { 'device': 'str', 'speed': 'int' } }
2132

    
2133
##
2134
# @block-job-cancel:
2135
#
2136
# Stop an active background block operation.
2137
#
2138
# This command returns immediately after marking the active background block
2139
# operation for cancellation.  It is an error to call this command if no
2140
# operation is in progress.
2141
#
2142
# The operation will cancel as soon as possible and then emit the
2143
# BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2144
# enumerated using query-block-jobs.
2145
#
2146
# For streaming, the image file retains its backing file unless the streaming
2147
# operation happens to complete just as it is being cancelled.  A new streaming
2148
# operation can be started at a later time to finish copying all data from the
2149
# backing file.
2150
#
2151
# @device: the device name
2152
#
2153
# @force: #optional whether to allow cancellation of a paused job (default
2154
#         false).  Since 1.3.
2155
#
2156
# Returns: Nothing on success
2157
#          If no background operation is active on this device, DeviceNotActive
2158
#
2159
# Since: 1.1
2160
##
2161
{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2162

    
2163
##
2164
# @block-job-pause:
2165
#
2166
# Pause an active background block operation.
2167
#
2168
# This command returns immediately after marking the active background block
2169
# operation for pausing.  It is an error to call this command if no
2170
# operation is in progress.  Pausing an already paused job has no cumulative
2171
# effect; a single block-job-resume command will resume the job.
2172
#
2173
# The operation will pause as soon as possible.  No event is emitted when
2174
# the operation is actually paused.  Cancelling a paused job automatically
2175
# resumes it.
2176
#
2177
# @device: the device name
2178
#
2179
# Returns: Nothing on success
2180
#          If no background operation is active on this device, DeviceNotActive
2181
#
2182
# Since: 1.3
2183
##
2184
{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2185

    
2186
##
2187
# @block-job-resume:
2188
#
2189
# Resume an active background block operation.
2190
#
2191
# This command returns immediately after resuming a paused background block
2192
# operation.  It is an error to call this command if no operation is in
2193
# progress.  Resuming an already running job is not an error.
2194
#
2195
# This command also clears the error status of the job.
2196
#
2197
# @device: the device name
2198
#
2199
# Returns: Nothing on success
2200
#          If no background operation is active on this device, DeviceNotActive
2201
#
2202
# Since: 1.3
2203
##
2204
{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2205

    
2206
##
2207
# @block-job-complete:
2208
#
2209
# Manually trigger completion of an active background block operation.  This
2210
# is supported for drive mirroring, where it also switches the device to
2211
# write to the target path only.  The ability to complete is signaled with
2212
# a BLOCK_JOB_READY event.
2213
#
2214
# This command completes an active background block operation synchronously.
2215
# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2216
# is not defined.  Note that if an I/O error occurs during the processing of
2217
# this command: 1) the command itself will fail; 2) the error will be processed
2218
# according to the rerror/werror arguments that were specified when starting
2219
# the operation.
2220
#
2221
# A cancelled or paused job cannot be completed.
2222
#
2223
# @device: the device name
2224
#
2225
# Returns: Nothing on success
2226
#          If no background operation is active on this device, DeviceNotActive
2227
#
2228
# Since: 1.3
2229
##
2230
{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2231

    
2232
##
2233
# @ObjectTypeInfo:
2234
#
2235
# This structure describes a search result from @qom-list-types
2236
#
2237
# @name: the type name found in the search
2238
#
2239
# Since: 1.1
2240
#
2241
# Notes: This command is experimental and may change syntax in future releases.
2242
##
2243
{ 'type': 'ObjectTypeInfo',
2244
  'data': { 'name': 'str' } }
2245

    
2246
##
2247
# @qom-list-types:
2248
#
2249
# This command will return a list of types given search parameters
2250
#
2251
# @implements: if specified, only return types that implement this type name
2252
#
2253
# @abstract: if true, include abstract types in the results
2254
#
2255
# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2256
#
2257
# Since: 1.1
2258
##
2259
{ 'command': 'qom-list-types',
2260
  'data': { '*implements': 'str', '*abstract': 'bool' },
2261
  'returns': [ 'ObjectTypeInfo' ] }
2262

    
2263
##
2264
# @DevicePropertyInfo:
2265
#
2266
# Information about device properties.
2267
#
2268
# @name: the name of the property
2269
# @type: the typename of the property
2270
#
2271
# Since: 1.2
2272
##
2273
{ 'type': 'DevicePropertyInfo',
2274
  'data': { 'name': 'str', 'type': 'str' } }
2275

    
2276
##
2277
# @device-list-properties:
2278
#
2279
# List properties associated with a device.
2280
#
2281
# @typename: the type name of a device
2282
#
2283
# Returns: a list of DevicePropertyInfo describing a devices properties
2284
#
2285
# Since: 1.2
2286
##
2287
{ 'command': 'device-list-properties',
2288
  'data': { 'typename': 'str'},
2289
  'returns': [ 'DevicePropertyInfo' ] }
2290

    
2291
##
2292
# @migrate
2293
#
2294
# Migrates the current running guest to another Virtual Machine.
2295
#
2296
# @uri: the Uniform Resource Identifier of the destination VM
2297
#
2298
# @blk: #optional do block migration (full disk copy)
2299
#
2300
# @inc: #optional incremental disk copy migration
2301
#
2302
# @detach: this argument exists only for compatibility reasons and
2303
#          is ignored by QEMU
2304
#
2305
# Returns: nothing on success
2306
#
2307
# Since: 0.14.0
2308
##
2309
{ 'command': 'migrate',
2310
  'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2311

    
2312
# @xen-save-devices-state:
2313
#
2314
# Save the state of all devices to file. The RAM and the block devices
2315
# of the VM are not saved by this command.
2316
#
2317
# @filename: the file to save the state of the devices to as binary
2318
# data. See xen-save-devices-state.txt for a description of the binary
2319
# format.
2320
#
2321
# Returns: Nothing on success
2322
#
2323
# Since: 1.1
2324
##
2325
{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2326

    
2327
##
2328
# @xen-set-global-dirty-log
2329
#
2330
# Enable or disable the global dirty log mode.
2331
#
2332
# @enable: true to enable, false to disable.
2333
#
2334
# Returns: nothing
2335
#
2336
# Since: 1.3
2337
##
2338
{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2339

    
2340
##
2341
# @device_del:
2342
#
2343
# Remove a device from a guest
2344
#
2345
# @id: the name of the device
2346
#
2347
# Returns: Nothing on success
2348
#          If @id is not a valid device, DeviceNotFound
2349
#
2350
# Notes: When this command completes, the device may not be removed from the
2351
#        guest.  Hot removal is an operation that requires guest cooperation.
2352
#        This command merely requests that the guest begin the hot removal
2353
#        process.
2354
#
2355
# Since: 0.14.0
2356
##
2357
{ 'command': 'device_del', 'data': {'id': 'str'} }
2358

    
2359
##
2360
# @dump-guest-memory
2361
#
2362
# Dump guest's memory to vmcore. It is a synchronous operation that can take
2363
# very long depending on the amount of guest memory. This command is only
2364
# supported on i386 and x86_64.
2365
#
2366
# @paging: if true, do paging to get guest's memory mapping. This allows
2367
#          using gdb to process the core file.
2368
#
2369
#          IMPORTANT: this option can make QEMU allocate several gigabytes
2370
#                     of RAM. This can happen for a large guest, or a
2371
#                     malicious guest pretending to be large.
2372
#
2373
#          Also, paging=true has the following limitations:
2374
#
2375
#             1. The guest may be in a catastrophic state or can have corrupted
2376
#                memory, which cannot be trusted
2377
#             2. The guest can be in real-mode even if paging is enabled. For
2378
#                example, the guest uses ACPI to sleep, and ACPI sleep state
2379
#                goes in real-mode
2380
#
2381
# @protocol: the filename or file descriptor of the vmcore. The supported
2382
#            protocols are:
2383
#
2384
#            1. file: the protocol starts with "file:", and the following
2385
#               string is the file's path.
2386
#            2. fd: the protocol starts with "fd:", and the following string
2387
#               is the fd's name.
2388
#
2389
# @begin: #optional if specified, the starting physical address.
2390
#
2391
# @length: #optional if specified, the memory size, in bytes. If you don't
2392
#          want to dump all guest's memory, please specify the start @begin
2393
#          and @length
2394
#
2395
# Returns: nothing on success
2396
#
2397
# Since: 1.2
2398
##
2399
{ 'command': 'dump-guest-memory',
2400
  'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2401
            '*length': 'int' } }
2402

    
2403
##
2404
# @netdev_add:
2405
#
2406
# Add a network backend.
2407
#
2408
# @type: the type of network backend.  Current valid values are 'user', 'tap',
2409
#        'vde', 'socket', 'dump' and 'bridge'
2410
#
2411
# @id: the name of the new network backend
2412
#
2413
# @props: #optional a list of properties to be passed to the backend in
2414
#         the format 'name=value', like 'ifname=tap0,script=no'
2415
#
2416
# Notes: The semantics of @props is not well defined.  Future commands will be
2417
#        introduced that provide stronger typing for backend creation.
2418
#
2419
# Since: 0.14.0
2420
#
2421
# Returns: Nothing on success
2422
#          If @type is not a valid network backend, DeviceNotFound
2423
##
2424
{ 'command': 'netdev_add',
2425
  'data': {'type': 'str', 'id': 'str', '*props': '**'},
2426
  'gen': 'no' }
2427

    
2428
##
2429
# @netdev_del:
2430
#
2431
# Remove a network backend.
2432
#
2433
# @id: the name of the network backend to remove
2434
#
2435
# Returns: Nothing on success
2436
#          If @id is not a valid network backend, DeviceNotFound
2437
#
2438
# Since: 0.14.0
2439
##
2440
{ 'command': 'netdev_del', 'data': {'id': 'str'} }
2441

    
2442
##
2443
# @NetdevNoneOptions
2444
#
2445
# Use it alone to have zero network devices.
2446
#
2447
# Since 1.2
2448
##
2449
{ 'type': 'NetdevNoneOptions',
2450
  'data': { } }
2451

    
2452
##
2453
# @NetLegacyNicOptions
2454
#
2455
# Create a new Network Interface Card.
2456
#
2457
# @netdev: #optional id of -netdev to connect to
2458
#
2459
# @macaddr: #optional MAC address
2460
#
2461
# @model: #optional device model (e1000, rtl8139, virtio etc.)
2462
#
2463
# @addr: #optional PCI device address
2464
#
2465
# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2466
#
2467
# Since 1.2
2468
##
2469
{ 'type': 'NetLegacyNicOptions',
2470
  'data': {
2471
    '*netdev':  'str',
2472
    '*macaddr': 'str',
2473
    '*model':   'str',
2474
    '*addr':    'str',
2475
    '*vectors': 'uint32' } }
2476

    
2477
##
2478
# @String
2479
#
2480
# A fat type wrapping 'str', to be embedded in lists.
2481
#
2482
# Since 1.2
2483
##
2484
{ 'type': 'String',
2485
  'data': {
2486
    'str': 'str' } }
2487

    
2488
##
2489
# @NetdevUserOptions
2490
#
2491
# Use the user mode network stack which requires no administrator privilege to
2492
# run.
2493
#
2494
# @hostname: #optional client hostname reported by the builtin DHCP server
2495
#
2496
# @restrict: #optional isolate the guest from the host
2497
#
2498
# @ip: #optional legacy parameter, use net= instead
2499
#
2500
# @net: #optional IP address and optional netmask
2501
#
2502
# @host: #optional guest-visible address of the host
2503
#
2504
# @tftp: #optional root directory of the built-in TFTP server
2505
#
2506
# @bootfile: #optional BOOTP filename, for use with tftp=
2507
#
2508
# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2509
#             assign
2510
#
2511
# @dns: #optional guest-visible address of the virtual nameserver
2512
#
2513
# @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2514
#             to the guest
2515
#
2516
# @smb: #optional root directory of the built-in SMB server
2517
#
2518
# @smbserver: #optional IP address of the built-in SMB server
2519
#
2520
# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2521
#           endpoints
2522
#
2523
# @guestfwd: #optional forward guest TCP connections
2524
#
2525
# Since 1.2
2526
##
2527
{ 'type': 'NetdevUserOptions',
2528
  'data': {
2529
    '*hostname':  'str',
2530
    '*restrict':  'bool',
2531
    '*ip':        'str',
2532
    '*net':       'str',
2533
    '*host':      'str',
2534
    '*tftp':      'str',
2535
    '*bootfile':  'str',
2536
    '*dhcpstart': 'str',
2537
    '*dns':       'str',
2538
    '*dnssearch': ['String'],
2539
    '*smb':       'str',
2540
    '*smbserver': 'str',
2541
    '*hostfwd':   ['String'],
2542
    '*guestfwd':  ['String'] } }
2543

    
2544
##
2545
# @NetdevTapOptions
2546
#
2547
# Connect the host TAP network interface name to the VLAN.
2548
#
2549
# @ifname: #optional interface name
2550
#
2551
# @fd: #optional file descriptor of an already opened tap
2552
#
2553
# @fds: #optional multiple file descriptors of already opened multiqueue capable
2554
# tap
2555
#
2556
# @script: #optional script to initialize the interface
2557
#
2558
# @downscript: #optional script to shut down the interface
2559
#
2560
# @helper: #optional command to execute to configure bridge
2561
#
2562
# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2563
#
2564
# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2565
#
2566
# @vhost: #optional enable vhost-net network accelerator
2567
#
2568
# @vhostfd: #optional file descriptor of an already opened vhost net device
2569
#
2570
# @vhostfds: #optional file descriptors of multiple already opened vhost net
2571
# devices
2572
#
2573
# @vhostforce: #optional vhost on for non-MSIX virtio guests
2574
#
2575
# Since 1.2
2576
##
2577
{ 'type': 'NetdevTapOptions',
2578
  'data': {
2579
    '*ifname':     'str',
2580
    '*fd':         'str',
2581
    '*fds':        'str',
2582
    '*script':     'str',
2583
    '*downscript': 'str',
2584
    '*helper':     'str',
2585
    '*sndbuf':     'size',
2586
    '*vnet_hdr':   'bool',
2587
    '*vhost':      'bool',
2588
    '*vhostfd':    'str',
2589
    '*vhostfds':   'str',
2590
    '*vhostforce': 'bool',
2591
    '*queues':     'uint32'} }
2592

    
2593
##
2594
# @NetdevSocketOptions
2595
#
2596
# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2597
# socket connection.
2598
#
2599
# @fd: #optional file descriptor of an already opened socket
2600
#
2601
# @listen: #optional port number, and optional hostname, to listen on
2602
#
2603
# @connect: #optional port number, and optional hostname, to connect to
2604
#
2605
# @mcast: #optional UDP multicast address and port number
2606
#
2607
# @localaddr: #optional source address and port for multicast and udp packets
2608
#
2609
# @udp: #optional UDP unicast address and port number
2610
#
2611
# Since 1.2
2612
##
2613
{ 'type': 'NetdevSocketOptions',
2614
  'data': {
2615
    '*fd':        'str',
2616
    '*listen':    'str',
2617
    '*connect':   'str',
2618
    '*mcast':     'str',
2619
    '*localaddr': 'str',
2620
    '*udp':       'str' } }
2621

    
2622
##
2623
# @NetdevVdeOptions
2624
#
2625
# Connect the VLAN to a vde switch running on the host.
2626
#
2627
# @sock: #optional socket path
2628
#
2629
# @port: #optional port number
2630
#
2631
# @group: #optional group owner of socket
2632
#
2633
# @mode: #optional permissions for socket
2634
#
2635
# Since 1.2
2636
##
2637
{ 'type': 'NetdevVdeOptions',
2638
  'data': {
2639
    '*sock':  'str',
2640
    '*port':  'uint16',
2641
    '*group': 'str',
2642
    '*mode':  'uint16' } }
2643

    
2644
##
2645
# @NetdevDumpOptions
2646
#
2647
# Dump VLAN network traffic to a file.
2648
#
2649
# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2650
# suffixes.
2651
#
2652
# @file: #optional dump file path (default is qemu-vlan0.pcap)
2653
#
2654
# Since 1.2
2655
##
2656
{ 'type': 'NetdevDumpOptions',
2657
  'data': {
2658
    '*len':  'size',
2659
    '*file': 'str' } }
2660

    
2661
##
2662
# @NetdevBridgeOptions
2663
#
2664
# Connect a host TAP network interface to a host bridge device.
2665
#
2666
# @br: #optional bridge name
2667
#
2668
# @helper: #optional command to execute to configure bridge
2669
#
2670
# Since 1.2
2671
##
2672
{ 'type': 'NetdevBridgeOptions',
2673
  'data': {
2674
    '*br':     'str',
2675
    '*helper': 'str' } }
2676

    
2677
##
2678
# @NetdevHubPortOptions
2679
#
2680
# Connect two or more net clients through a software hub.
2681
#
2682
# @hubid: hub identifier number
2683
#
2684
# Since 1.2
2685
##
2686
{ 'type': 'NetdevHubPortOptions',
2687
  'data': {
2688
    'hubid':     'int32' } }
2689

    
2690
##
2691
# @NetClientOptions
2692
#
2693
# A discriminated record of network device traits.
2694
#
2695
# Since 1.2
2696
##
2697
{ 'union': 'NetClientOptions',
2698
  'data': {
2699
    'none':     'NetdevNoneOptions',
2700
    'nic':      'NetLegacyNicOptions',
2701
    'user':     'NetdevUserOptions',
2702
    'tap':      'NetdevTapOptions',
2703
    'socket':   'NetdevSocketOptions',
2704
    'vde':      'NetdevVdeOptions',
2705
    'dump':     'NetdevDumpOptions',
2706
    'bridge':   'NetdevBridgeOptions',
2707
    'hubport':  'NetdevHubPortOptions' } }
2708

    
2709
##
2710
# @NetLegacy
2711
#
2712
# Captures the configuration of a network device; legacy.
2713
#
2714
# @vlan: #optional vlan number
2715
#
2716
# @id: #optional identifier for monitor commands
2717
#
2718
# @name: #optional identifier for monitor commands, ignored if @id is present
2719
#
2720
# @opts: device type specific properties (legacy)
2721
#
2722
# Since 1.2
2723
##
2724
{ 'type': 'NetLegacy',
2725
  'data': {
2726
    '*vlan': 'int32',
2727
    '*id':   'str',
2728
    '*name': 'str',
2729
    'opts':  'NetClientOptions' } }
2730

    
2731
##
2732
# @Netdev
2733
#
2734
# Captures the configuration of a network device.
2735
#
2736
# @id: identifier for monitor commands.
2737
#
2738
# @opts: device type specific properties
2739
#
2740
# Since 1.2
2741
##
2742
{ 'type': 'Netdev',
2743
  'data': {
2744
    'id':   'str',
2745
    'opts': 'NetClientOptions' } }
2746

    
2747
##
2748
# @InetSocketAddress
2749
#
2750
# Captures a socket address or address range in the Internet namespace.
2751
#
2752
# @host: host part of the address
2753
#
2754
# @port: port part of the address, or lowest port if @to is present
2755
#
2756
# @to: highest port to try
2757
#
2758
# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
2759
#        #optional
2760
#
2761
# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
2762
#        #optional
2763
#
2764
# Since 1.3
2765
##
2766
{ 'type': 'InetSocketAddress',
2767
  'data': {
2768
    'host': 'str',
2769
    'port': 'str',
2770
    '*to': 'uint16',
2771
    '*ipv4': 'bool',
2772
    '*ipv6': 'bool' } }
2773

    
2774
##
2775
# @UnixSocketAddress
2776
#
2777
# Captures a socket address in the local ("Unix socket") namespace.
2778
#
2779
# @path: filesystem path to use
2780
#
2781
# Since 1.3
2782
##
2783
{ 'type': 'UnixSocketAddress',
2784
  'data': {
2785
    'path': 'str' } }
2786

    
2787
##
2788
# @SocketAddress
2789
#
2790
# Captures the address of a socket, which could also be a named file descriptor
2791
#
2792
# Since 1.3
2793
##
2794
{ 'union': 'SocketAddress',
2795
  'data': {
2796
    'inet': 'InetSocketAddress',
2797
    'unix': 'UnixSocketAddress',
2798
    'fd': 'String' } }
2799

    
2800
##
2801
# @getfd:
2802
#
2803
# Receive a file descriptor via SCM rights and assign it a name
2804
#
2805
# @fdname: file descriptor name
2806
#
2807
# Returns: Nothing on success
2808
#
2809
# Since: 0.14.0
2810
#
2811
# Notes: If @fdname already exists, the file descriptor assigned to
2812
#        it will be closed and replaced by the received file
2813
#        descriptor.
2814
#        The 'closefd' command can be used to explicitly close the
2815
#        file descriptor when it is no longer needed.
2816
##
2817
{ 'command': 'getfd', 'data': {'fdname': 'str'} }
2818

    
2819
##
2820
# @closefd:
2821
#
2822
# Close a file descriptor previously passed via SCM rights
2823
#
2824
# @fdname: file descriptor name
2825
#
2826
# Returns: Nothing on success
2827
#
2828
# Since: 0.14.0
2829
##
2830
{ 'command': 'closefd', 'data': {'fdname': 'str'} }
2831

    
2832
##
2833
# @MachineInfo:
2834
#
2835
# Information describing a machine.
2836
#
2837
# @name: the name of the machine
2838
#
2839
# @alias: #optional an alias for the machine name
2840
#
2841
# @default: #optional whether the machine is default
2842
#
2843
# Since: 1.2.0
2844
##
2845
{ 'type': 'MachineInfo',
2846
  'data': { 'name': 'str', '*alias': 'str',
2847
            '*is-default': 'bool' } }
2848

    
2849
##
2850
# @query-machines:
2851
#
2852
# Return a list of supported machines
2853
#
2854
# Returns: a list of MachineInfo
2855
#
2856
# Since: 1.2.0
2857
##
2858
{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
2859

    
2860
##
2861
# @CpuDefinitionInfo:
2862
#
2863
# Virtual CPU definition.
2864
#
2865
# @name: the name of the CPU definition
2866
#
2867
# Since: 1.2.0
2868
##
2869
{ 'type': 'CpuDefinitionInfo',
2870
  'data': { 'name': 'str' } }
2871

    
2872
##
2873
# @query-cpu-definitions:
2874
#
2875
# Return a list of supported virtual CPU definitions
2876
#
2877
# Returns: a list of CpuDefInfo
2878
#
2879
# Since: 1.2.0
2880
##
2881
{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2882

    
2883
# @AddfdInfo:
2884
#
2885
# Information about a file descriptor that was added to an fd set.
2886
#
2887
# @fdset-id: The ID of the fd set that @fd was added to.
2888
#
2889
# @fd: The file descriptor that was received via SCM rights and
2890
#      added to the fd set.
2891
#
2892
# Since: 1.2.0
2893
##
2894
{ 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2895

    
2896
##
2897
# @add-fd:
2898
#
2899
# Add a file descriptor, that was passed via SCM rights, to an fd set.
2900
#
2901
# @fdset-id: #optional The ID of the fd set to add the file descriptor to.
2902
#
2903
# @opaque: #optional A free-form string that can be used to describe the fd.
2904
#
2905
# Returns: @AddfdInfo on success
2906
#          If file descriptor was not received, FdNotSupplied
2907
#          If @fdset-id is a negative value, InvalidParameterValue
2908
#
2909
# Notes: The list of fd sets is shared by all monitor connections.
2910
#
2911
#        If @fdset-id is not specified, a new fd set will be created.
2912
#
2913
# Since: 1.2.0
2914
##
2915
{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2916
  'returns': 'AddfdInfo' }
2917

    
2918
##
2919
# @remove-fd:
2920
#
2921
# Remove a file descriptor from an fd set.
2922
#
2923
# @fdset-id: The ID of the fd set that the file descriptor belongs to.
2924
#
2925
# @fd: #optional The file descriptor that is to be removed.
2926
#
2927
# Returns: Nothing on success
2928
#          If @fdset-id or @fd is not found, FdNotFound
2929
#
2930
# Since: 1.2.0
2931
#
2932
# Notes: The list of fd sets is shared by all monitor connections.
2933
#
2934
#        If @fd is not specified, all file descriptors in @fdset-id
2935
#        will be removed.
2936
##
2937
{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2938

    
2939
##
2940
# @FdsetFdInfo:
2941
#
2942
# Information about a file descriptor that belongs to an fd set.
2943
#
2944
# @fd: The file descriptor value.
2945
#
2946
# @opaque: #optional A free-form string that can be used to describe the fd.
2947
#
2948
# Since: 1.2.0
2949
##
2950
{ 'type': 'FdsetFdInfo',
2951
  'data': {'fd': 'int', '*opaque': 'str'} }
2952

    
2953
##
2954
# @FdsetInfo:
2955
#
2956
# Information about an fd set.
2957
#
2958
# @fdset-id: The ID of the fd set.
2959
#
2960
# @fds: A list of file descriptors that belong to this fd set.
2961
#
2962
# Since: 1.2.0
2963
##
2964
{ 'type': 'FdsetInfo',
2965
  'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2966

    
2967
##
2968
# @query-fdsets:
2969
#
2970
# Return information describing all fd sets.
2971
#
2972
# Returns: A list of @FdsetInfo
2973
#
2974
# Since: 1.2.0
2975
#
2976
# Note: The list of fd sets is shared by all monitor connections.
2977
#
2978
##
2979
{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2980

    
2981
##
2982
# @TargetType
2983
#
2984
# Target CPU emulation type
2985
#
2986
# These parameters correspond to the softmmu binary CPU name that is currently
2987
# running.
2988
#
2989
# Since: 1.2.0
2990
##
2991
{ 'enum': 'TargetType',
2992
  'data': [ 'alpha', 'arm', 'cris', 'i386', 'lm32', 'm68k', 'microblazeel',
2993
            'microblaze', 'mips64el', 'mips64', 'mipsel', 'mips', 'or32',
2994
            'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb', 'sh4', 'sparc64',
2995
            'sparc', 'unicore32', 'x86_64', 'xtensaeb', 'xtensa' ] }
2996

    
2997
##
2998
# @TargetInfo:
2999
#
3000
# Information describing the QEMU target.
3001
#
3002
# @arch: the target architecture (eg "x86_64", "i386", etc)
3003
#
3004
# Since: 1.2.0
3005
##
3006
{ 'type': 'TargetInfo',
3007
  'data': { 'arch': 'TargetType' } }
3008

    
3009
##
3010
# @query-target:
3011
#
3012
# Return information about the target for this QEMU
3013
#
3014
# Returns: TargetInfo
3015
#
3016
# Since: 1.2.0
3017
##
3018
{ 'command': 'query-target', 'returns': 'TargetInfo' }
3019

    
3020
##
3021
# @QKeyCode:
3022
#
3023
# An enumeration of key name.
3024
#
3025
# This is used by the send-key command.
3026
#
3027
# Since: 1.3.0
3028
##
3029
{ 'enum': 'QKeyCode',
3030
  'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3031
            'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3032
            '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3033
            'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3034
            'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3035
            'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3036
            'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3037
            'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3038
            'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3039
            'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3040
            'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3041
            'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3042
            'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3043
            'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3044
             'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3045

    
3046
##
3047
# @KeyValue
3048
#
3049
# Represents a keyboard key.
3050
#
3051
# Since: 1.3.0
3052
##
3053
{ 'union': 'KeyValue',
3054
  'data': {
3055
    'number': 'int',
3056
    'qcode': 'QKeyCode' } }
3057

    
3058
##
3059
# @send-key:
3060
#
3061
# Send keys to guest.
3062
#
3063
# @keys: An array of @KeyValue elements. All @KeyValues in this array are
3064
#        simultaneously sent to the guest. A @KeyValue.number value is sent
3065
#        directly to the guest, while @KeyValue.qcode must be a valid
3066
#        @QKeyCode value
3067
#
3068
# @hold-time: #optional time to delay key up events, milliseconds. Defaults
3069
#             to 100
3070
#
3071
# Returns: Nothing on success
3072
#          If key is unknown or redundant, InvalidParameter
3073
#
3074
# Since: 1.3.0
3075
#
3076
##
3077
{ 'command': 'send-key',
3078
  'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3079

    
3080
##
3081
# @screendump:
3082
#
3083
# Write a PPM of the VGA screen to a file.
3084
#
3085
# @filename: the path of a new PPM file to store the image
3086
#
3087
# Returns: Nothing on success
3088
#
3089
# Since: 0.14.0
3090
##
3091
{ 'command': 'screendump', 'data': {'filename': 'str'} }
3092

    
3093
##
3094
# @nbd-server-start:
3095
#
3096
# Start an NBD server listening on the given host and port.  Block
3097
# devices can then be exported using @nbd-server-add.  The NBD
3098
# server will present them as named exports; for example, another
3099
# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3100
#
3101
# @addr: Address on which to listen.
3102
#
3103
# Returns: error if the server is already running.
3104
#
3105
# Since: 1.3.0
3106
##
3107
{ 'command': 'nbd-server-start',
3108
  'data': { 'addr': 'SocketAddress' } }
3109

    
3110
##
3111
# @nbd-server-add:
3112
#
3113
# Export a device to QEMU's embedded NBD server.
3114
#
3115
# @device: Block device to be exported
3116
#
3117
# @writable: Whether clients should be able to write to the device via the
3118
#     NBD connection (default false). #optional
3119
#
3120
# Returns: error if the device is already marked for export.
3121
#
3122
# Since: 1.3.0
3123
##
3124
{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3125

    
3126
##
3127
# @nbd-server-stop:
3128
#
3129
# Stop QEMU's embedded NBD server, and unregister all devices previously
3130
# added via @nbd-server-add.
3131
#
3132
# Since: 1.3.0
3133
##
3134
{ 'command': 'nbd-server-stop' }
3135

    
3136
##
3137
# @ChardevFile:
3138
#
3139
# Configuration info for file chardevs.
3140
#
3141
# @in:  #optional The name of the input file
3142
# @out: The name of the output file
3143
#
3144
# Since: 1.4
3145
##
3146
{ 'type': 'ChardevFile', 'data': { '*in' : 'str',
3147
                                   'out' : 'str' } }
3148

    
3149
##
3150
# @ChardevHostdev:
3151
#
3152
# Configuration info for device chardevs.
3153
#
3154
# @device: The name of the special file for the device,
3155
#          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3156
# @type: What kind of device this is.
3157
#
3158
# Since: 1.4
3159
##
3160
{ 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3161

    
3162
##
3163
# @ChardevSocket:
3164
#
3165
# Configuration info for socket chardevs.
3166
#
3167
# @addr: socket address to listen on (server=true)
3168
#        or connect to (server=false)
3169
# @server: #optional create server socket (default: true)
3170
# @wait: #optional wait for connect (not used for server
3171
#        sockets, default: false)
3172
# @nodelay: #optional set TCP_NODELAY socket option (default: false)
3173
# @telnet: #optional enable telnet protocol (default: false)
3174
#
3175
# Since: 1.4
3176
##
3177
{ 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3178
                                     '*server'  : 'bool',
3179
                                     '*wait'    : 'bool',
3180
                                     '*nodelay' : 'bool',
3181
                                     '*telnet'  : 'bool' } }
3182

    
3183
##
3184
# @ChardevBackend:
3185
#
3186
# Configuration info for the new chardev backend.
3187
#
3188
# Since: 1.4
3189
##
3190
{ 'type': 'ChardevDummy', 'data': { } }
3191

    
3192
{ 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3193
                                       'serial' : 'ChardevHostdev',
3194
                                       'parallel': 'ChardevHostdev',
3195
                                       'socket' : 'ChardevSocket',
3196
                                       'pty'    : 'ChardevDummy',
3197
                                       'null'   : 'ChardevDummy' } }
3198

    
3199
##
3200
# @ChardevReturn:
3201
#
3202
# Return info about the chardev backend just created.
3203
#
3204
# @pty: #optional name of the slave pseudoterminal device, present if
3205
#       and only if a chardev of type 'pty' was created
3206
#
3207
# Since: 1.4
3208
##
3209
{ 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3210

    
3211
##
3212
# @chardev-add:
3213
#
3214
# Add a character device backend
3215
#
3216
# @id: the chardev's ID, must be unique
3217
# @backend: backend type and parameters
3218
#
3219
# Returns: ChardevReturn.
3220
#
3221
# Since: 1.4
3222
##
3223
{ 'command': 'chardev-add', 'data': {'id'      : 'str',
3224
                                     'backend' : 'ChardevBackend' },
3225
  'returns': 'ChardevReturn' }
3226

    
3227
##
3228
# @chardev-remove:
3229
#
3230
# Remove a character device backend
3231
#
3232
# @id: the chardev's ID, must exist and not be in use
3233
#
3234
# Returns: Nothing on success
3235
#
3236
# Since: 1.4
3237
##
3238
{ 'command': 'chardev-remove', 'data': {'id': 'str'} }