block: Declare blockdev-add and blockdev-del supported
It's been a long journey, but here we are. The supported blockdev-add is not compatible to its experimental predecessors; bump all Since: tags to 2.9. x-blockdev-remove-medium, x-blockdev-insert-medium and x-blockdev-change need a bit more work, so leave them alone for now. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
		
							parent
							
								
									0491c22154
								
							
						
					
					
						commit
						79b7a77eda
					
				@ -2835,7 +2835,7 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    bs = bdrv_find_node(id);
 | 
					    bs = bdrv_find_node(id);
 | 
				
			||||||
    if (bs) {
 | 
					    if (bs) {
 | 
				
			||||||
        qmp_x_blockdev_del(id, &local_err);
 | 
					        qmp_blockdev_del(id, &local_err);
 | 
				
			||||||
        if (local_err) {
 | 
					        if (local_err) {
 | 
				
			||||||
            error_report_err(local_err);
 | 
					            error_report_err(local_err);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -3900,7 +3900,7 @@ fail:
 | 
				
			|||||||
    visit_free(v);
 | 
					    visit_free(v);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void qmp_x_blockdev_del(const char *node_name, Error **errp)
 | 
					void qmp_blockdev_del(const char *node_name, Error **errp)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    AioContext *aio_context;
 | 
					    AioContext *aio_context;
 | 
				
			||||||
    BlockDriverState *bs;
 | 
					    BlockDriverState *bs;
 | 
				
			||||||
 | 
				
			|||||||
@ -2053,7 +2053,7 @@
 | 
				
			|||||||
# @ignore:      Ignore the request
 | 
					# @ignore:      Ignore the request
 | 
				
			||||||
# @unmap:       Forward as an unmap request
 | 
					# @unmap:       Forward as an unmap request
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'BlockdevDiscardOptions',
 | 
					{ 'enum': 'BlockdevDiscardOptions',
 | 
				
			||||||
  'data': [ 'ignore', 'unmap' ] }
 | 
					  'data': [ 'ignore', 'unmap' ] }
 | 
				
			||||||
@ -2082,7 +2082,7 @@
 | 
				
			|||||||
# @threads:     Use qemu's thread pool
 | 
					# @threads:     Use qemu's thread pool
 | 
				
			||||||
# @native:      Use native AIO backend (only Linux and Windows)
 | 
					# @native:      Use native AIO backend (only Linux and Windows)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'BlockdevAioOptions',
 | 
					{ 'enum': 'BlockdevAioOptions',
 | 
				
			||||||
  'data': [ 'threads', 'native' ] }
 | 
					  'data': [ 'threads', 'native' ] }
 | 
				
			||||||
@ -2097,7 +2097,7 @@
 | 
				
			|||||||
# @no-flush:    ignore any flush requests for the device (default:
 | 
					# @no-flush:    ignore any flush requests for the device (default:
 | 
				
			||||||
#               false)
 | 
					#               false)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevCacheOptions',
 | 
					{ 'struct': 'BlockdevCacheOptions',
 | 
				
			||||||
  'data': { '*direct': 'bool',
 | 
					  'data': { '*direct': 'bool',
 | 
				
			||||||
@ -2108,18 +2108,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# Drivers that are supported in block device operations.
 | 
					# Drivers that are supported in block device operations.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# @host_device: Since 2.1
 | 
					# Since: 2.9
 | 
				
			||||||
# @host_cdrom: Since 2.1
 | 
					 | 
				
			||||||
# @gluster: Since 2.7
 | 
					 | 
				
			||||||
# @nbd: Since 2.8
 | 
					 | 
				
			||||||
# @nfs: Since 2.8
 | 
					 | 
				
			||||||
# @replication: Since 2.8
 | 
					 | 
				
			||||||
# @ssh: Since 2.8
 | 
					 | 
				
			||||||
# @iscsi: Since 2.9
 | 
					 | 
				
			||||||
# @rbd: Since 2.9
 | 
					 | 
				
			||||||
# @sheepdog: Since 2.9
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Since: 2.0
 | 
					 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'BlockdevDriver',
 | 
					{ 'enum': 'BlockdevDriver',
 | 
				
			||||||
  'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
 | 
					  'data': [ 'blkdebug', 'blkverify', 'bochs', 'cloop',
 | 
				
			||||||
@ -2137,7 +2126,7 @@
 | 
				
			|||||||
# @filename:    path to the image file
 | 
					# @filename:    path to the image file
 | 
				
			||||||
# @aio:         AIO backend (default: threads) (since: 2.8)
 | 
					# @aio:         AIO backend (default: threads) (since: 2.8)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsFile',
 | 
					{ 'struct': 'BlockdevOptionsFile',
 | 
				
			||||||
  'data': { 'filename': 'str',
 | 
					  'data': { 'filename': 'str',
 | 
				
			||||||
@ -2153,7 +2142,7 @@
 | 
				
			|||||||
#              requests. Default to zero which completes requests immediately.
 | 
					#              requests. Default to zero which completes requests immediately.
 | 
				
			||||||
#              (Since 2.4)
 | 
					#              (Since 2.4)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.2
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsNull',
 | 
					{ 'struct': 'BlockdevOptionsNull',
 | 
				
			||||||
  'data': { '*size': 'int', '*latency-ns': 'uint64' } }
 | 
					  'data': { '*size': 'int', '*latency-ns': 'uint64' } }
 | 
				
			||||||
@ -2173,7 +2162,7 @@
 | 
				
			|||||||
#               (since 2.4)
 | 
					#               (since 2.4)
 | 
				
			||||||
# @rw:          whether to allow write operations (default: false)
 | 
					# @rw:          whether to allow write operations (default: false)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsVVFAT',
 | 
					{ 'struct': 'BlockdevOptionsVVFAT',
 | 
				
			||||||
  'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
 | 
					  'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
 | 
				
			||||||
@ -2187,7 +2176,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @file:        reference to or definition of the data source block device
 | 
					# @file:        reference to or definition of the data source block device
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsGenericFormat',
 | 
					{ 'struct': 'BlockdevOptionsGenericFormat',
 | 
				
			||||||
  'data': { 'file': 'BlockdevRef' } }
 | 
					  'data': { 'file': 'BlockdevRef' } }
 | 
				
			||||||
@ -2201,7 +2190,7 @@
 | 
				
			|||||||
#              the decryption key (since 2.6). Mandatory except when
 | 
					#              the decryption key (since 2.6). Mandatory except when
 | 
				
			||||||
#              doing a metadata-only probe of the image.
 | 
					#              doing a metadata-only probe of the image.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.6
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsLUKS',
 | 
					{ 'struct': 'BlockdevOptionsLUKS',
 | 
				
			||||||
  'base': 'BlockdevOptionsGenericFormat',
 | 
					  'base': 'BlockdevOptionsGenericFormat',
 | 
				
			||||||
@ -2219,7 +2208,7 @@
 | 
				
			|||||||
#               allowed to pass an empty string here in order to disable the
 | 
					#               allowed to pass an empty string here in order to disable the
 | 
				
			||||||
#               default backing file.
 | 
					#               default backing file.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsGenericCOWFormat',
 | 
					{ 'struct': 'BlockdevOptionsGenericCOWFormat',
 | 
				
			||||||
  'base': 'BlockdevOptionsGenericFormat',
 | 
					  'base': 'BlockdevOptionsGenericFormat',
 | 
				
			||||||
@ -2240,7 +2229,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @all:         Perform all available overlap checks
 | 
					# @all:         Perform all available overlap checks
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.2
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'Qcow2OverlapCheckMode',
 | 
					{ 'enum': 'Qcow2OverlapCheckMode',
 | 
				
			||||||
  'data': [ 'none', 'constant', 'cached', 'all' ] }
 | 
					  'data': [ 'none', 'constant', 'cached', 'all' ] }
 | 
				
			||||||
@ -2255,7 +2244,7 @@
 | 
				
			|||||||
# @template: Specifies a template mode which can be adjusted using the other
 | 
					# @template: Specifies a template mode which can be adjusted using the other
 | 
				
			||||||
#            flags, defaults to 'cached'
 | 
					#            flags, defaults to 'cached'
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.2
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'Qcow2OverlapCheckFlags',
 | 
					{ 'struct': 'Qcow2OverlapCheckFlags',
 | 
				
			||||||
  'data': { '*template':       'Qcow2OverlapCheckMode',
 | 
					  'data': { '*template':       'Qcow2OverlapCheckMode',
 | 
				
			||||||
@ -2279,7 +2268,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @mode:    named mode which chooses a specific set of flags
 | 
					# @mode:    named mode which chooses a specific set of flags
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.2
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'alternate': 'Qcow2OverlapChecks',
 | 
					{ 'alternate': 'Qcow2OverlapChecks',
 | 
				
			||||||
  'data': { 'flags': 'Qcow2OverlapCheckFlags',
 | 
					  'data': { 'flags': 'Qcow2OverlapCheckFlags',
 | 
				
			||||||
@ -2320,7 +2309,7 @@
 | 
				
			|||||||
#                         caches. The interval is in seconds. The default value
 | 
					#                         caches. The interval is in seconds. The default value
 | 
				
			||||||
#                         is 0 and it disables this feature (since 2.5)
 | 
					#                         is 0 and it disables this feature (since 2.5)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsQcow2',
 | 
					{ 'struct': 'BlockdevOptionsQcow2',
 | 
				
			||||||
  'base': 'BlockdevOptionsGenericCOWFormat',
 | 
					  'base': 'BlockdevOptionsGenericCOWFormat',
 | 
				
			||||||
@ -2347,7 +2336,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# TODO: Expose the host_key_check option in QMP
 | 
					# TODO: Expose the host_key_check option in QMP
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsSsh',
 | 
					{ 'struct': 'BlockdevOptionsSsh',
 | 
				
			||||||
  'data': { 'server': 'InetSocketAddress',
 | 
					  'data': { 'server': 'InetSocketAddress',
 | 
				
			||||||
@ -2360,7 +2349,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# Trigger events supported by blkdebug.
 | 
					# Trigger events supported by blkdebug.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.0
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
 | 
					{ 'enum': 'BlkdebugEvent', 'prefix': 'BLKDBG',
 | 
				
			||||||
  'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
 | 
					  'data': [ 'l1_update', 'l1_grow_alloc_table', 'l1_grow_write_table',
 | 
				
			||||||
@ -2400,7 +2389,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @immediately: fail immediately; defaults to false
 | 
					# @immediately: fail immediately; defaults to false
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.0
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlkdebugInjectErrorOptions',
 | 
					{ 'struct': 'BlkdebugInjectErrorOptions',
 | 
				
			||||||
  'data': { 'event': 'BlkdebugEvent',
 | 
					  'data': { 'event': 'BlkdebugEvent',
 | 
				
			||||||
@ -2423,7 +2412,7 @@
 | 
				
			|||||||
# @new_state:   the state identifier blkdebug is supposed to assume if
 | 
					# @new_state:   the state identifier blkdebug is supposed to assume if
 | 
				
			||||||
#               this event is triggered
 | 
					#               this event is triggered
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.0
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlkdebugSetStateOptions',
 | 
					{ 'struct': 'BlkdebugSetStateOptions',
 | 
				
			||||||
  'data': { 'event': 'BlkdebugEvent',
 | 
					  'data': { 'event': 'BlkdebugEvent',
 | 
				
			||||||
@ -2446,7 +2435,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @set-state:       array of state-change descriptions
 | 
					# @set-state:       array of state-change descriptions
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.0
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsBlkdebug',
 | 
					{ 'struct': 'BlockdevOptionsBlkdebug',
 | 
				
			||||||
  'data': { 'image': 'BlockdevRef',
 | 
					  'data': { 'image': 'BlockdevRef',
 | 
				
			||||||
@ -2464,7 +2453,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @raw:     raw image used for verification
 | 
					# @raw:     raw image used for verification
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.0
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsBlkverify',
 | 
					{ 'struct': 'BlockdevOptionsBlkverify',
 | 
				
			||||||
  'data': { 'test': 'BlockdevRef',
 | 
					  'data': { 'test': 'BlockdevRef',
 | 
				
			||||||
@ -2479,7 +2468,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @fifo: read only from the first child that has not failed
 | 
					# @fifo: read only from the first child that has not failed
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.2
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
 | 
					{ 'enum': 'QuorumReadPattern', 'data': [ 'quorum', 'fifo' ] }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2501,7 +2490,7 @@
 | 
				
			|||||||
# @read-pattern: choose read pattern and set to quorum by default
 | 
					# @read-pattern: choose read pattern and set to quorum by default
 | 
				
			||||||
#                (Since 2.2)
 | 
					#                (Since 2.2)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.0
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsQuorum',
 | 
					{ 'struct': 'BlockdevOptionsQuorum',
 | 
				
			||||||
  'data': { '*blkverify': 'bool',
 | 
					  'data': { '*blkverify': 'bool',
 | 
				
			||||||
@ -2526,7 +2515,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @logfile:     libgfapi log file (default /dev/stderr) (Since 2.8)
 | 
					# @logfile:     libgfapi log file (default /dev/stderr) (Since 2.8)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsGluster',
 | 
					{ 'struct': 'BlockdevOptionsGluster',
 | 
				
			||||||
  'data': { 'volume': 'str',
 | 
					  'data': { 'volume': 'str',
 | 
				
			||||||
@ -2685,7 +2674,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @secondary: Secondary mode, receive the vm's state from primary QEMU.
 | 
					# @secondary: Secondary mode, receive the vm's state from primary QEMU.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
 | 
					{ 'enum' : 'ReplicationMode', 'data' : [ 'primary', 'secondary' ] }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -2700,7 +2689,7 @@
 | 
				
			|||||||
#          node who owns the replication node chain. Must not be given in
 | 
					#          node who owns the replication node chain. Must not be given in
 | 
				
			||||||
#          primary mode.
 | 
					#          primary mode.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsReplication',
 | 
					{ 'struct': 'BlockdevOptionsReplication',
 | 
				
			||||||
  'base': 'BlockdevOptionsGenericFormat',
 | 
					  'base': 'BlockdevOptionsGenericFormat',
 | 
				
			||||||
@ -2714,7 +2703,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @inet:        TCP transport
 | 
					# @inet:        TCP transport
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'enum': 'NFSTransport',
 | 
					{ 'enum': 'NFSTransport',
 | 
				
			||||||
  'data': [ 'inet' ] }
 | 
					  'data': [ 'inet' ] }
 | 
				
			||||||
@ -2728,7 +2717,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @host:        host address for NFS server
 | 
					# @host:        host address for NFS server
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'NFSServer',
 | 
					{ 'struct': 'NFSServer',
 | 
				
			||||||
  'data': { 'type': 'NFSTransport',
 | 
					  'data': { 'type': 'NFSTransport',
 | 
				
			||||||
@ -2763,7 +2752,7 @@
 | 
				
			|||||||
# @debug:                   set the NFS debug level (max 2) (defaults
 | 
					# @debug:                   set the NFS debug level (max 2) (defaults
 | 
				
			||||||
#                           to libnfs default)
 | 
					#                           to libnfs default)
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsNfs',
 | 
					{ 'struct': 'BlockdevOptionsNfs',
 | 
				
			||||||
  'data': { 'server': 'NFSServer',
 | 
					  'data': { 'server': 'NFSServer',
 | 
				
			||||||
@ -2782,7 +2771,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @filename:    path to the image file
 | 
					# @filename:    path to the image file
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsCurl',
 | 
					{ 'struct': 'BlockdevOptionsCurl',
 | 
				
			||||||
  'data': { 'filename': 'str' } }
 | 
					  'data': { 'filename': 'str' } }
 | 
				
			||||||
@ -2798,7 +2787,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @tls-creds:   TLS credentials ID
 | 
					# @tls-creds:   TLS credentials ID
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsNbd',
 | 
					{ 'struct': 'BlockdevOptionsNbd',
 | 
				
			||||||
  'data': { 'server': 'SocketAddress',
 | 
					  'data': { 'server': 'SocketAddress',
 | 
				
			||||||
@ -2813,7 +2802,7 @@
 | 
				
			|||||||
# @offset:      position where the block device starts
 | 
					# @offset:      position where the block device starts
 | 
				
			||||||
# @size:        the assumed size of the device
 | 
					# @size:        the assumed size of the device
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 2.8
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'struct': 'BlockdevOptionsRaw',
 | 
					{ 'struct': 'BlockdevOptionsRaw',
 | 
				
			||||||
  'base': 'BlockdevOptionsGenericFormat',
 | 
					  'base': 'BlockdevOptionsGenericFormat',
 | 
				
			||||||
@ -2837,7 +2826,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# Remaining options are determined by the block driver.
 | 
					# Remaining options are determined by the block driver.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'union': 'BlockdevOptions',
 | 
					{ 'union': 'BlockdevOptions',
 | 
				
			||||||
  'base': { 'driver': 'BlockdevDriver',
 | 
					  'base': { 'driver': 'BlockdevDriver',
 | 
				
			||||||
@ -2894,7 +2883,7 @@
 | 
				
			|||||||
#                   empty string means that no block device should be
 | 
					#                   empty string means that no block device should be
 | 
				
			||||||
#                   referenced.
 | 
					#                   referenced.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Since: 1.7
 | 
					# Since: 2.9
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'alternate': 'BlockdevRef',
 | 
					{ 'alternate': 'BlockdevRef',
 | 
				
			||||||
  'data': { 'definition': 'BlockdevOptions',
 | 
					  'data': { 'definition': 'BlockdevOptions',
 | 
				
			||||||
@ -2907,11 +2896,7 @@
 | 
				
			|||||||
# BlockBackend will be created; otherwise, @node-name is mandatory at the top
 | 
					# BlockBackend will be created; otherwise, @node-name is mandatory at the top
 | 
				
			||||||
# level and no BlockBackend will be created.
 | 
					# level and no BlockBackend will be created.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Note: This command is still a work in progress.  It doesn't support all
 | 
					# Since: 2.9
 | 
				
			||||||
# block drivers among other things.  Stay away from it unless you want
 | 
					 | 
				
			||||||
# to help with its development.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Since: 1.7
 | 
					 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Example:
 | 
					# Example:
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -2957,7 +2942,7 @@
 | 
				
			|||||||
{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
 | 
					{ 'command': 'blockdev-add', 'data': 'BlockdevOptions', 'boxed': true }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# @x-blockdev-del:
 | 
					# @blockdev-del:
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Deletes a block device that has been added using blockdev-add.
 | 
					# Deletes a block device that has been added using blockdev-add.
 | 
				
			||||||
# The command will fail if the node is attached to a device or is
 | 
					# The command will fail if the node is attached to a device or is
 | 
				
			||||||
@ -2965,11 +2950,7 @@
 | 
				
			|||||||
#
 | 
					#
 | 
				
			||||||
# @node-name: Name of the graph node to delete.
 | 
					# @node-name: Name of the graph node to delete.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Note: This command is still a work in progress and is considered
 | 
					# Since: 2.9
 | 
				
			||||||
# experimental. Stay away from it unless you want to help with its
 | 
					 | 
				
			||||||
# development.
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
# Since: 2.5
 | 
					 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Example:
 | 
					# Example:
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
@ -2985,13 +2966,13 @@
 | 
				
			|||||||
#    }
 | 
					#    }
 | 
				
			||||||
# <- { "return": {} }
 | 
					# <- { "return": {} }
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# -> { "execute": "x-blockdev-del",
 | 
					# -> { "execute": "blockdev-del",
 | 
				
			||||||
#      "arguments": { "node-name": "node0" }
 | 
					#      "arguments": { "node-name": "node0" }
 | 
				
			||||||
#    }
 | 
					#    }
 | 
				
			||||||
# <- { "return": {} }
 | 
					# <- { "return": {} }
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
{ 'command': 'x-blockdev-del', 'data': { 'node-name': 'str' } }
 | 
					{ 'command': 'blockdev-del', 'data': { 'node-name': 'str' } }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##
 | 
					##
 | 
				
			||||||
# @blockdev-open-tray:
 | 
					# @blockdev-open-tray:
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
#!/usr/bin/env python
 | 
					#!/usr/bin/env python
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Test cases for the QMP 'x-blockdev-del' command
 | 
					# Test cases for the QMP 'blockdev-del' command
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Copyright (C) 2015 Igalia, S.L.
 | 
					# Copyright (C) 2015 Igalia, S.L.
 | 
				
			||||||
# Author: Alberto Garcia <berto@igalia.com>
 | 
					# Author: Alberto Garcia <berto@igalia.com>
 | 
				
			||||||
@ -79,7 +79,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
 | 
				
			|||||||
    # Delete a BlockDriverState
 | 
					    # Delete a BlockDriverState
 | 
				
			||||||
    def delBlockDriverState(self, node, expect_error = False):
 | 
					    def delBlockDriverState(self, node, expect_error = False):
 | 
				
			||||||
        self.checkBlockDriverState(node)
 | 
					        self.checkBlockDriverState(node)
 | 
				
			||||||
        result = self.vm.qmp('x-blockdev-del', node_name = node)
 | 
					        result = self.vm.qmp('blockdev-del', node_name = node)
 | 
				
			||||||
        if expect_error:
 | 
					        if expect_error:
 | 
				
			||||||
            self.assert_qmp(result, 'error/class', 'GenericError')
 | 
					            self.assert_qmp(result, 'error/class', 'GenericError')
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
@ -173,7 +173,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
 | 
				
			|||||||
        self.wait_until_completed(id)
 | 
					        self.wait_until_completed(id)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Add a BlkDebug node
 | 
					    # Add a BlkDebug node
 | 
				
			||||||
    # Note that the purpose of this is to test the x-blockdev-del
 | 
					    # Note that the purpose of this is to test the blockdev-del
 | 
				
			||||||
    # sanity checks, not to create a usable blkdebug drive
 | 
					    # sanity checks, not to create a usable blkdebug drive
 | 
				
			||||||
    def addBlkDebug(self, debug, node):
 | 
					    def addBlkDebug(self, debug, node):
 | 
				
			||||||
        self.checkBlockDriverState(node, False)
 | 
					        self.checkBlockDriverState(node, False)
 | 
				
			||||||
@ -191,7 +191,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
 | 
				
			|||||||
        self.checkBlockDriverState(debug)
 | 
					        self.checkBlockDriverState(debug)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Add a BlkVerify node
 | 
					    # Add a BlkVerify node
 | 
				
			||||||
    # Note that the purpose of this is to test the x-blockdev-del
 | 
					    # Note that the purpose of this is to test the blockdev-del
 | 
				
			||||||
    # sanity checks, not to create a usable blkverify drive
 | 
					    # sanity checks, not to create a usable blkverify drive
 | 
				
			||||||
    def addBlkVerify(self, blkverify, test, raw):
 | 
					    def addBlkVerify(self, blkverify, test, raw):
 | 
				
			||||||
        self.checkBlockDriverState(test, False)
 | 
					        self.checkBlockDriverState(test, False)
 | 
				
			||||||
 | 
				
			|||||||
@ -65,7 +65,7 @@ test_blockjob()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # We want this to return an error because the block job is still running
 | 
					    # We want this to return an error because the block job is still running
 | 
				
			||||||
    _send_qemu_cmd $QEMU_HANDLE \
 | 
					    _send_qemu_cmd $QEMU_HANDLE \
 | 
				
			||||||
        "{'execute': 'x-blockdev-del',
 | 
					        "{'execute': 'blockdev-del',
 | 
				
			||||||
          'arguments': {'node-name': 'drv0'}}" \
 | 
					          'arguments': {'node-name': 'drv0'}}" \
 | 
				
			||||||
        'error' | _filter_generated_node_ids
 | 
					        'error' | _filter_generated_node_ids
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -75,7 +75,7 @@ test_blockjob()
 | 
				
			|||||||
        "$3"
 | 
					        "$3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    _send_qemu_cmd $QEMU_HANDLE \
 | 
					    _send_qemu_cmd $QEMU_HANDLE \
 | 
				
			||||||
        "{'execute': 'x-blockdev-del',
 | 
					        "{'execute': 'blockdev-del',
 | 
				
			||||||
          'arguments': {'node-name': 'drv0'}}" \
 | 
					          'arguments': {'node-name': 'drv0'}}" \
 | 
				
			||||||
        'return'
 | 
					        'return'
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -57,7 +57,7 @@ class NBDBlockdevAddBase(iotests.QMPTestCase):
 | 
				
			|||||||
                                                    filename)
 | 
					                                                    filename)
 | 
				
			||||||
                break
 | 
					                break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        result = self.vm.qmp('x-blockdev-del', node_name='nbd-blockdev')
 | 
					        result = self.vm.qmp('blockdev-del', node_name='nbd-blockdev')
 | 
				
			||||||
        self.assert_qmp(result, 'return', {})
 | 
					        self.assert_qmp(result, 'return', {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user