15daa6bfdSKevin Wolf# -*- Mode: Python -*- 25daa6bfdSKevin Wolf# vim: filetype=python 35daa6bfdSKevin Wolf 45daa6bfdSKevin Wolf## 55daa6bfdSKevin Wolf# == Block device exports 65daa6bfdSKevin Wolf## 75daa6bfdSKevin Wolf 85daa6bfdSKevin Wolf{ 'include': 'sockets.json' } 9e5fb29d5SVladimir Sementsov-Ogievskiy{ 'include': 'block-core.json' } 105daa6bfdSKevin Wolf 115daa6bfdSKevin Wolf## 125daa6bfdSKevin Wolf# @NbdServerOptions: 135daa6bfdSKevin Wolf# 145daa6bfdSKevin Wolf# Keep this type consistent with the nbd-server-start arguments. The only 155daa6bfdSKevin Wolf# intended difference is using SocketAddress instead of SocketAddressLegacy. 165daa6bfdSKevin Wolf# 175daa6bfdSKevin Wolf# @addr: Address on which to listen. 185daa6bfdSKevin Wolf# @tls-creds: ID of the TLS credentials object (since 2.6). 195daa6bfdSKevin Wolf# @tls-authz: ID of the QAuthZ authorization object used to validate 205daa6bfdSKevin Wolf# the client's x509 distinguished name. This object is 215daa6bfdSKevin Wolf# is only resolved at time of use, so can be deleted and 225daa6bfdSKevin Wolf# recreated on the fly while the NBD server is active. 235daa6bfdSKevin Wolf# If missing, it will default to denying access (since 4.0). 241c8222b0SKevin Wolf# @max-connections: The maximum number of connections to allow at the same 2558a6fdccSEric Blake# time, 0 for unlimited. Setting this to 1 also stops 2658a6fdccSEric Blake# the server from advertising multiple client support 2758a6fdccSEric Blake# (since 5.2; default: 0) 285daa6bfdSKevin Wolf# 295daa6bfdSKevin Wolf# Since: 4.2 305daa6bfdSKevin Wolf## 315daa6bfdSKevin Wolf{ 'struct': 'NbdServerOptions', 325daa6bfdSKevin Wolf 'data': { 'addr': 'SocketAddress', 335daa6bfdSKevin Wolf '*tls-creds': 'str', 341c8222b0SKevin Wolf '*tls-authz': 'str', 351c8222b0SKevin Wolf '*max-connections': 'uint32' } } 365daa6bfdSKevin Wolf 375daa6bfdSKevin Wolf## 385daa6bfdSKevin Wolf# @nbd-server-start: 395daa6bfdSKevin Wolf# 405daa6bfdSKevin Wolf# Start an NBD server listening on the given host and port. Block 415daa6bfdSKevin Wolf# devices can then be exported using @nbd-server-add. The NBD 425daa6bfdSKevin Wolf# server will present them as named exports; for example, another 435daa6bfdSKevin Wolf# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME". 445daa6bfdSKevin Wolf# 455daa6bfdSKevin Wolf# Keep this type consistent with the NbdServerOptions type. The only intended 465daa6bfdSKevin Wolf# difference is using SocketAddressLegacy instead of SocketAddress. 475daa6bfdSKevin Wolf# 485daa6bfdSKevin Wolf# @addr: Address on which to listen. 495daa6bfdSKevin Wolf# @tls-creds: ID of the TLS credentials object (since 2.6). 505daa6bfdSKevin Wolf# @tls-authz: ID of the QAuthZ authorization object used to validate 515daa6bfdSKevin Wolf# the client's x509 distinguished name. This object is 525daa6bfdSKevin Wolf# is only resolved at time of use, so can be deleted and 535daa6bfdSKevin Wolf# recreated on the fly while the NBD server is active. 545daa6bfdSKevin Wolf# If missing, it will default to denying access (since 4.0). 551c8222b0SKevin Wolf# @max-connections: The maximum number of connections to allow at the same 5658a6fdccSEric Blake# time, 0 for unlimited. Setting this to 1 also stops 5758a6fdccSEric Blake# the server from advertising multiple client support 5858a6fdccSEric Blake# (since 5.2; default: 0). 595daa6bfdSKevin Wolf# 605daa6bfdSKevin Wolf# Returns: error if the server is already running. 615daa6bfdSKevin Wolf# 629bc6e893SMarkus Armbruster# Since: 1.3 635daa6bfdSKevin Wolf## 645daa6bfdSKevin Wolf{ 'command': 'nbd-server-start', 655daa6bfdSKevin Wolf 'data': { 'addr': 'SocketAddressLegacy', 665daa6bfdSKevin Wolf '*tls-creds': 'str', 671c8222b0SKevin Wolf '*tls-authz': 'str', 68f55ba801SPaolo Bonzini '*max-connections': 'uint32' }, 69f55ba801SPaolo Bonzini 'allow-preconfig': true } 705daa6bfdSKevin Wolf 715daa6bfdSKevin Wolf## 72cbad81ceSEric Blake# @BlockExportOptionsNbdBase: 735daa6bfdSKevin Wolf# 74cbad81ceSEric Blake# An NBD block export (common options shared between nbd-server-add and 75cbad81ceSEric Blake# the NBD branch of block-export-add). 765daa6bfdSKevin Wolf# 775daa6bfdSKevin Wolf# @name: Export name. If unspecified, the @device parameter is used as the 785daa6bfdSKevin Wolf# export name. (Since 2.12) 795daa6bfdSKevin Wolf# 805daa6bfdSKevin Wolf# @description: Free-form description of the export, up to 4096 bytes. 815daa6bfdSKevin Wolf# (Since 5.0) 825daa6bfdSKevin Wolf# 835daa6bfdSKevin Wolf# Since: 5.0 845daa6bfdSKevin Wolf## 85cbad81ceSEric Blake{ 'struct': 'BlockExportOptionsNbdBase', 86cbad81ceSEric Blake 'data': { '*name': 'str', '*description': 'str' } } 87cbad81ceSEric Blake 88cbad81ceSEric Blake## 89cbad81ceSEric Blake# @BlockExportOptionsNbd: 90cbad81ceSEric Blake# 91cbad81ceSEric Blake# An NBD block export (distinct options used in the NBD branch of 92cbad81ceSEric Blake# block-export-add). 93cbad81ceSEric Blake# 94cbad81ceSEric Blake# @bitmaps: Also export each of the named dirty bitmaps reachable from 95cbad81ceSEric Blake# @device, so the NBD client can use NBD_OPT_SET_META_CONTEXT with 96cbad81ceSEric Blake# the metadata context name "qemu:dirty-bitmap:BITMAP" to inspect 97cbad81ceSEric Blake# each bitmap. 98e5fb29d5SVladimir Sementsov-Ogievskiy# Since 7.1 bitmap may be specified by node/name pair. 99cbad81ceSEric Blake# 100dbc7b014SEric Blake# @allocation-depth: Also export the allocation depth map for @device, so 101dbc7b014SEric Blake# the NBD client can use NBD_OPT_SET_META_CONTEXT with 102dbc7b014SEric Blake# the metadata context name "qemu:allocation-depth" to 103dbc7b014SEric Blake# inspect allocation details. (since 5.2) 104dbc7b014SEric Blake# 105cbad81ceSEric Blake# Since: 5.2 106cbad81ceSEric Blake## 107143ea767SKevin Wolf{ 'struct': 'BlockExportOptionsNbd', 108cbad81ceSEric Blake 'base': 'BlockExportOptionsNbdBase', 109e5fb29d5SVladimir Sementsov-Ogievskiy 'data': { '*bitmaps': ['BlockDirtyBitmapOrStr'], 110e5fb29d5SVladimir Sementsov-Ogievskiy '*allocation-depth': 'bool' } } 1115daa6bfdSKevin Wolf 1125daa6bfdSKevin Wolf## 11390fc91d5SStefan Hajnoczi# @BlockExportOptionsVhostUserBlk: 11490fc91d5SStefan Hajnoczi# 11590fc91d5SStefan Hajnoczi# A vhost-user-blk block export. 11690fc91d5SStefan Hajnoczi# 11790fc91d5SStefan Hajnoczi# @addr: The vhost-user socket on which to listen. Both 'unix' and 'fd' 11890fc91d5SStefan Hajnoczi# SocketAddress types are supported. Passed fds must be UNIX domain 11990fc91d5SStefan Hajnoczi# sockets. 12090fc91d5SStefan Hajnoczi# @logical-block-size: Logical block size in bytes. Defaults to 512 bytes. 121d9b495f9SStefan Hajnoczi# @num-queues: Number of request virtqueues. Must be greater than 0. Defaults 122d9b495f9SStefan Hajnoczi# to 1. 12390fc91d5SStefan Hajnoczi# 12490fc91d5SStefan Hajnoczi# Since: 5.2 12590fc91d5SStefan Hajnoczi## 12690fc91d5SStefan Hajnoczi{ 'struct': 'BlockExportOptionsVhostUserBlk', 127d9b495f9SStefan Hajnoczi 'data': { 'addr': 'SocketAddress', 128d9b495f9SStefan Hajnoczi '*logical-block-size': 'size', 129d9b495f9SStefan Hajnoczi '*num-queues': 'uint16'} } 13090fc91d5SStefan Hajnoczi 13190fc91d5SStefan Hajnoczi## 1328fc54f94SMax Reitz# @FuseExportAllowOther: 1338fc54f94SMax Reitz# 1348fc54f94SMax Reitz# Possible allow_other modes for FUSE exports. 1358fc54f94SMax Reitz# 1368fc54f94SMax Reitz# @off: Do not pass allow_other as a mount option. 1378fc54f94SMax Reitz# 1388fc54f94SMax Reitz# @on: Pass allow_other as a mount option. 1398fc54f94SMax Reitz# 1408fc54f94SMax Reitz# @auto: Try mounting with allow_other first, and if that fails, retry 1418fc54f94SMax Reitz# without allow_other. 1428fc54f94SMax Reitz# 1438fc54f94SMax Reitz# Since: 6.1 1448fc54f94SMax Reitz## 1458fc54f94SMax Reitz{ 'enum': 'FuseExportAllowOther', 1468fc54f94SMax Reitz 'data': ['off', 'on', 'auto'] } 1478fc54f94SMax Reitz 1488fc54f94SMax Reitz## 1490c9b70d5SMax Reitz# @BlockExportOptionsFuse: 1500c9b70d5SMax Reitz# 1510c9b70d5SMax Reitz# Options for exporting a block graph node on some (file) mountpoint 1520c9b70d5SMax Reitz# as a raw image. 1530c9b70d5SMax Reitz# 1540c9b70d5SMax Reitz# @mountpoint: Path on which to export the block device via FUSE. 1550c9b70d5SMax Reitz# This must point to an existing regular file. 1560c9b70d5SMax Reitz# 1574fba06d5SMax Reitz# @growable: Whether writes beyond the EOF should grow the block node 1584fba06d5SMax Reitz# accordingly. (default: false) 1594fba06d5SMax Reitz# 1608fc54f94SMax Reitz# @allow-other: If this is off, only qemu's user is allowed access to 1618fc54f94SMax Reitz# this export. That cannot be changed even with chmod or 1628fc54f94SMax Reitz# chown. 1638fc54f94SMax Reitz# Enabling this option will allow other users access to 1648fc54f94SMax Reitz# the export with the FUSE mount option "allow_other". 1658fc54f94SMax Reitz# Note that using allow_other as a non-root user requires 1668fc54f94SMax Reitz# user_allow_other to be enabled in the global fuse.conf 1678fc54f94SMax Reitz# configuration file. 1688fc54f94SMax Reitz# In auto mode (the default), the FUSE export driver will 1698fc54f94SMax Reitz# first attempt to mount the export with allow_other, and 1708fc54f94SMax Reitz# if that fails, try again without. 1718fc54f94SMax Reitz# (since 6.1; default: auto) 1728fc54f94SMax Reitz# 1730c9b70d5SMax Reitz# Since: 6.0 1740c9b70d5SMax Reitz## 1750c9b70d5SMax Reitz{ 'struct': 'BlockExportOptionsFuse', 1764fba06d5SMax Reitz 'data': { 'mountpoint': 'str', 1778fc54f94SMax Reitz '*growable': 'bool', 1788fc54f94SMax Reitz '*allow-other': 'FuseExportAllowOther' }, 1798a9f1e1dSMarc-André Lureau 'if': 'CONFIG_FUSE' } 1800c9b70d5SMax Reitz 1810c9b70d5SMax Reitz## 1822a2359b8SXie Yongji# @BlockExportOptionsVduseBlk: 1832a2359b8SXie Yongji# 1842a2359b8SXie Yongji# A vduse-blk block export. 1852a2359b8SXie Yongji# 1862a2359b8SXie Yongji# @num-queues: the number of virtqueues. Defaults to 1. 1872a2359b8SXie Yongji# @queue-size: the size of virtqueue. Defaults to 256. 1882a2359b8SXie Yongji# @logical-block-size: Logical block size in bytes. Range [512, PAGE_SIZE] 1892a2359b8SXie Yongji# and must be power of 2. Defaults to 512 bytes. 190*0862a087SXie Yongji# @serial: the serial number of virtio block device. Defaults to empty string. 1912a2359b8SXie Yongji# 1922a2359b8SXie Yongji# Since: 7.1 1932a2359b8SXie Yongji## 1942a2359b8SXie Yongji{ 'struct': 'BlockExportOptionsVduseBlk', 1952a2359b8SXie Yongji 'data': { '*num-queues': 'uint16', 1962a2359b8SXie Yongji '*queue-size': 'uint16', 197*0862a087SXie Yongji '*logical-block-size': 'size', 198*0862a087SXie Yongji '*serial': 'str' } } 1992a2359b8SXie Yongji 2002a2359b8SXie Yongji## 201b6076afcSKevin Wolf# @NbdServerAddOptions: 202b6076afcSKevin Wolf# 203cbad81ceSEric Blake# An NBD block export, per legacy nbd-server-add command. 204b6076afcSKevin Wolf# 205b6076afcSKevin Wolf# @device: The device name or node name of the node to be exported 206b6076afcSKevin Wolf# 20730dbc81dSKevin Wolf# @writable: Whether clients should be able to write to the device via the 20830dbc81dSKevin Wolf# NBD connection (default false). 20930dbc81dSKevin Wolf# 210cbad81ceSEric Blake# @bitmap: Also export a single dirty bitmap reachable from @device, so the 211cbad81ceSEric Blake# NBD client can use NBD_OPT_SET_META_CONTEXT with the metadata 212cbad81ceSEric Blake# context name "qemu:dirty-bitmap:BITMAP" to inspect the bitmap 213cbad81ceSEric Blake# (since 4.0). 214cbad81ceSEric Blake# 215b6076afcSKevin Wolf# Since: 5.0 216b6076afcSKevin Wolf## 217b6076afcSKevin Wolf{ 'struct': 'NbdServerAddOptions', 218cbad81ceSEric Blake 'base': 'BlockExportOptionsNbdBase', 21930dbc81dSKevin Wolf 'data': { 'device': 'str', 220cbad81ceSEric Blake '*writable': 'bool', '*bitmap': 'str' } } 221b6076afcSKevin Wolf 222b6076afcSKevin Wolf## 2235daa6bfdSKevin Wolf# @nbd-server-add: 2245daa6bfdSKevin Wolf# 2255daa6bfdSKevin Wolf# Export a block node to QEMU's embedded NBD server. 2265daa6bfdSKevin Wolf# 227d53be9ceSKevin Wolf# The export name will be used as the id for the resulting block export. 228d53be9ceSKevin Wolf# 229443127e8SKevin Wolf# Features: 230443127e8SKevin Wolf# @deprecated: This command is deprecated. Use @block-export-add instead. 231443127e8SKevin Wolf# 2325daa6bfdSKevin Wolf# Returns: error if the server is not running, or export with the same name 2335daa6bfdSKevin Wolf# already exists. 2345daa6bfdSKevin Wolf# 2359bc6e893SMarkus Armbruster# Since: 1.3 2365daa6bfdSKevin Wolf## 2375daa6bfdSKevin Wolf{ 'command': 'nbd-server-add', 238f55ba801SPaolo Bonzini 'data': 'NbdServerAddOptions', 'boxed': true, 'features': ['deprecated'], 239f55ba801SPaolo Bonzini 'allow-preconfig': true } 2405daa6bfdSKevin Wolf 2415daa6bfdSKevin Wolf## 2423c3bc462SKevin Wolf# @BlockExportRemoveMode: 2435daa6bfdSKevin Wolf# 2443c3bc462SKevin Wolf# Mode for removing a block export. 2455daa6bfdSKevin Wolf# 2465daa6bfdSKevin Wolf# @safe: Remove export if there are no existing connections, fail otherwise. 2475daa6bfdSKevin Wolf# 2485daa6bfdSKevin Wolf# @hard: Drop all connections immediately and remove export. 2495daa6bfdSKevin Wolf# 25097cd74f7SVictor Toso# TODO: Potential additional modes to be added in the future: 2515daa6bfdSKevin Wolf# 2525daa6bfdSKevin Wolf# hide: Just hide export from new clients, leave existing connections as is. 2535daa6bfdSKevin Wolf# Remove export after all clients are disconnected. 2545daa6bfdSKevin Wolf# 2555daa6bfdSKevin Wolf# soft: Hide export from new clients, answer with ESHUTDOWN for all further 2565daa6bfdSKevin Wolf# requests from existing clients. 2575daa6bfdSKevin Wolf# 2585daa6bfdSKevin Wolf# Since: 2.12 2595daa6bfdSKevin Wolf## 2603c3bc462SKevin Wolf{'enum': 'BlockExportRemoveMode', 'data': ['safe', 'hard']} 2615daa6bfdSKevin Wolf 2625daa6bfdSKevin Wolf## 2635daa6bfdSKevin Wolf# @nbd-server-remove: 2645daa6bfdSKevin Wolf# 2655daa6bfdSKevin Wolf# Remove NBD export by name. 2665daa6bfdSKevin Wolf# 2673c3bc462SKevin Wolf# @name: Block export id. 2685daa6bfdSKevin Wolf# 2693c3bc462SKevin Wolf# @mode: Mode of command operation. See @BlockExportRemoveMode description. 2705daa6bfdSKevin Wolf# Default is 'safe'. 2715daa6bfdSKevin Wolf# 272443127e8SKevin Wolf# Features: 273443127e8SKevin Wolf# @deprecated: This command is deprecated. Use @block-export-del instead. 274443127e8SKevin Wolf# 2755daa6bfdSKevin Wolf# Returns: error if 2765daa6bfdSKevin Wolf# - the server is not running 2775daa6bfdSKevin Wolf# - export is not found 2785daa6bfdSKevin Wolf# - mode is 'safe' and there are existing connections 2795daa6bfdSKevin Wolf# 2805daa6bfdSKevin Wolf# Since: 2.12 2815daa6bfdSKevin Wolf## 2825daa6bfdSKevin Wolf{ 'command': 'nbd-server-remove', 283443127e8SKevin Wolf 'data': {'name': 'str', '*mode': 'BlockExportRemoveMode'}, 284f55ba801SPaolo Bonzini 'features': ['deprecated'], 285f55ba801SPaolo Bonzini 'allow-preconfig': true } 2865daa6bfdSKevin Wolf 2875daa6bfdSKevin Wolf## 2885daa6bfdSKevin Wolf# @nbd-server-stop: 2895daa6bfdSKevin Wolf# 2905daa6bfdSKevin Wolf# Stop QEMU's embedded NBD server, and unregister all devices previously 2915daa6bfdSKevin Wolf# added via @nbd-server-add. 2925daa6bfdSKevin Wolf# 2939bc6e893SMarkus Armbruster# Since: 1.3 2945daa6bfdSKevin Wolf## 295f55ba801SPaolo Bonzini{ 'command': 'nbd-server-stop', 296f55ba801SPaolo Bonzini 'allow-preconfig': true } 2975daa6bfdSKevin Wolf 2985daa6bfdSKevin Wolf## 2995daa6bfdSKevin Wolf# @BlockExportType: 3005daa6bfdSKevin Wolf# 3015daa6bfdSKevin Wolf# An enumeration of block export types 3025daa6bfdSKevin Wolf# 3035daa6bfdSKevin Wolf# @nbd: NBD export 30490fc91d5SStefan Hajnoczi# @vhost-user-blk: vhost-user-blk export (since 5.2) 3050c9b70d5SMax Reitz# @fuse: FUSE export (since: 6.0) 3062a2359b8SXie Yongji# @vduse-blk: vduse-blk export (since 7.1) 3075daa6bfdSKevin Wolf# 3085daa6bfdSKevin Wolf# Since: 4.2 3095daa6bfdSKevin Wolf## 3105daa6bfdSKevin Wolf{ 'enum': 'BlockExportType', 311bb01ea73SPhilippe Mathieu-Daudé 'data': [ 'nbd', 3123a8fa0edSPhilippe Mathieu-Daude { 'name': 'vhost-user-blk', 3133a8fa0edSPhilippe Mathieu-Daude 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, 3142a2359b8SXie Yongji { 'name': 'fuse', 'if': 'CONFIG_FUSE' }, 3152a2359b8SXie Yongji { 'name': 'vduse-blk', 'if': 'CONFIG_VDUSE_BLK_EXPORT' } ] } 3165daa6bfdSKevin Wolf 3175daa6bfdSKevin Wolf## 318143ea767SKevin Wolf# @BlockExportOptions: 3195daa6bfdSKevin Wolf# 3205daa6bfdSKevin Wolf# Describes a block export, i.e. how single node should be exported on an 3215daa6bfdSKevin Wolf# external interface. 3225daa6bfdSKevin Wolf# 3232a2359b8SXie Yongji# @id: A unique identifier for the block export (across the host for vduse-blk 3242a2359b8SXie Yongji# export type or across all export types for other types) 325d53be9ceSKevin Wolf# 326b6076afcSKevin Wolf# @node-name: The node name of the block node to be exported (since: 5.2) 327b6076afcSKevin Wolf# 32830dbc81dSKevin Wolf# @writable: True if clients should be able to write to the export 32930dbc81dSKevin Wolf# (default false) 33030dbc81dSKevin Wolf# 331fefee85dSKevin Wolf# @writethrough: If true, caches are flushed after every write request to the 332fefee85dSKevin Wolf# export before completion is signalled. (since: 5.2; 333fefee85dSKevin Wolf# default: false) 334fefee85dSKevin Wolf# 335f51d23c8SStefan Hajnoczi# @iothread: The name of the iothread object where the export will run. The 336f51d23c8SStefan Hajnoczi# default is to use the thread currently associated with the 337f51d23c8SStefan Hajnoczi# block node. (since: 5.2) 338f51d23c8SStefan Hajnoczi# 339f51d23c8SStefan Hajnoczi# @fixed-iothread: True prevents the block node from being moved to another 340f51d23c8SStefan Hajnoczi# thread while the export is active. If true and @iothread is 341f51d23c8SStefan Hajnoczi# given, export creation fails if the block node cannot be 342f51d23c8SStefan Hajnoczi# moved to the iothread. The default is false. (since: 5.2) 343f51d23c8SStefan Hajnoczi# 3445daa6bfdSKevin Wolf# Since: 4.2 3455daa6bfdSKevin Wolf## 346143ea767SKevin Wolf{ 'union': 'BlockExportOptions', 347fefee85dSKevin Wolf 'base': { 'type': 'BlockExportType', 348d53be9ceSKevin Wolf 'id': 'str', 349f51d23c8SStefan Hajnoczi '*fixed-iothread': 'bool', 350f51d23c8SStefan Hajnoczi '*iothread': 'str', 351b6076afcSKevin Wolf 'node-name': 'str', 35230dbc81dSKevin Wolf '*writable': 'bool', 353fefee85dSKevin Wolf '*writethrough': 'bool' }, 3545daa6bfdSKevin Wolf 'discriminator': 'type', 3555daa6bfdSKevin Wolf 'data': { 35690fc91d5SStefan Hajnoczi 'nbd': 'BlockExportOptionsNbd', 357bb01ea73SPhilippe Mathieu-Daudé 'vhost-user-blk': { 'type': 'BlockExportOptionsVhostUserBlk', 358bb01ea73SPhilippe Mathieu-Daudé 'if': 'CONFIG_VHOST_USER_BLK_SERVER' }, 3590c9b70d5SMax Reitz 'fuse': { 'type': 'BlockExportOptionsFuse', 3602a2359b8SXie Yongji 'if': 'CONFIG_FUSE' }, 3612a2359b8SXie Yongji 'vduse-blk': { 'type': 'BlockExportOptionsVduseBlk', 3622a2359b8SXie Yongji 'if': 'CONFIG_VDUSE_BLK_EXPORT' } 3635daa6bfdSKevin Wolf } } 36456ee8626SKevin Wolf 36556ee8626SKevin Wolf## 36656ee8626SKevin Wolf# @block-export-add: 36756ee8626SKevin Wolf# 36856ee8626SKevin Wolf# Creates a new block export. 36956ee8626SKevin Wolf# 37056ee8626SKevin Wolf# Since: 5.2 37156ee8626SKevin Wolf## 37256ee8626SKevin Wolf{ 'command': 'block-export-add', 373f55ba801SPaolo Bonzini 'data': 'BlockExportOptions', 'boxed': true, 374f55ba801SPaolo Bonzini 'allow-preconfig': true } 3753c3bc462SKevin Wolf 3763c3bc462SKevin Wolf## 3773c3bc462SKevin Wolf# @block-export-del: 3783c3bc462SKevin Wolf# 3793c3bc462SKevin Wolf# Request to remove a block export. This drops the user's reference to the 3803c3bc462SKevin Wolf# export, but the export may still stay around after this command returns until 3813c3bc462SKevin Wolf# the shutdown of the export has completed. 3823c3bc462SKevin Wolf# 3833c3bc462SKevin Wolf# @id: Block export id. 3843c3bc462SKevin Wolf# 3853c3bc462SKevin Wolf# @mode: Mode of command operation. See @BlockExportRemoveMode description. 3863c3bc462SKevin Wolf# Default is 'safe'. 3873c3bc462SKevin Wolf# 3883c3bc462SKevin Wolf# Returns: Error if the export is not found or @mode is 'safe' and the export 3893c3bc462SKevin Wolf# is still in use (e.g. by existing client connections) 3903c3bc462SKevin Wolf# 3913c3bc462SKevin Wolf# Since: 5.2 3923c3bc462SKevin Wolf## 3933c3bc462SKevin Wolf{ 'command': 'block-export-del', 394f55ba801SPaolo Bonzini 'data': { 'id': 'str', '*mode': 'BlockExportRemoveMode' }, 395f55ba801SPaolo Bonzini 'allow-preconfig': true } 3961a9f7a80SKevin Wolf 3971a9f7a80SKevin Wolf## 3981a9f7a80SKevin Wolf# @BLOCK_EXPORT_DELETED: 3991a9f7a80SKevin Wolf# 4001a9f7a80SKevin Wolf# Emitted when a block export is removed and its id can be reused. 4011a9f7a80SKevin Wolf# 4021a9f7a80SKevin Wolf# @id: Block export id. 4031a9f7a80SKevin Wolf# 4041a9f7a80SKevin Wolf# Since: 5.2 4051a9f7a80SKevin Wolf## 4061a9f7a80SKevin Wolf{ 'event': 'BLOCK_EXPORT_DELETED', 4071a9f7a80SKevin Wolf 'data': { 'id': 'str' } } 4088cade320SKevin Wolf 4098cade320SKevin Wolf## 4108cade320SKevin Wolf# @BlockExportInfo: 4118cade320SKevin Wolf# 4128cade320SKevin Wolf# Information about a single block export. 4138cade320SKevin Wolf# 4148cade320SKevin Wolf# @id: The unique identifier for the block export 4158cade320SKevin Wolf# 4168cade320SKevin Wolf# @type: The block export type 4178cade320SKevin Wolf# 4188cade320SKevin Wolf# @node-name: The node name of the block node that is exported 4198cade320SKevin Wolf# 4208cade320SKevin Wolf# @shutting-down: True if the export is shutting down (e.g. after a 4218cade320SKevin Wolf# block-export-del command, but before the shutdown has 4228cade320SKevin Wolf# completed) 4238cade320SKevin Wolf# 4248cade320SKevin Wolf# Since: 5.2 4258cade320SKevin Wolf## 4268cade320SKevin Wolf{ 'struct': 'BlockExportInfo', 4278cade320SKevin Wolf 'data': { 'id': 'str', 4288cade320SKevin Wolf 'type': 'BlockExportType', 4298cade320SKevin Wolf 'node-name': 'str', 4308cade320SKevin Wolf 'shutting-down': 'bool' } } 4318cade320SKevin Wolf 4328cade320SKevin Wolf## 4338cade320SKevin Wolf# @query-block-exports: 4348cade320SKevin Wolf# 4358cade320SKevin Wolf# Returns: A list of BlockExportInfo describing all block exports 4368cade320SKevin Wolf# 4378cade320SKevin Wolf# Since: 5.2 4388cade320SKevin Wolf## 439f55ba801SPaolo Bonzini{ 'command': 'query-block-exports', 'returns': ['BlockExportInfo'], 440f55ba801SPaolo Bonzini 'allow-preconfig': true } 441