return;
}
- qmp_blockdev_remove_medium(device, errp);
+ qmp_x_blockdev_remove_medium(device, errp);
}
void qmp_block_passwd(bool has_device, const char *device,
blk_dev_change_media_cb(blk, true);
}
-void qmp_blockdev_remove_medium(const char *device, Error **errp)
+void qmp_x_blockdev_remove_medium(const char *device, Error **errp)
{
BlockBackend *blk;
BlockDriverState *bs;
QTAILQ_INSERT_TAIL(&bdrv_states, bs, device_list);
}
-void qmp_blockdev_insert_medium(const char *device, const char *node_name,
- Error **errp)
+void qmp_x_blockdev_insert_medium(const char *device, const char *node_name,
+ Error **errp)
{
BlockDriverState *bs;
goto fail;
}
- qmp_blockdev_remove_medium(device, &err);
+ qmp_x_blockdev_remove_medium(device, &err);
if (err) {
error_propagate(errp, err);
goto fail;
'data': { 'device': 'str' } }
##
-# @blockdev-remove-medium:
+# @x-blockdev-remove-medium:
#
# Removes a medium (a block driver state tree) from a block device. That block
# device's tray must currently be open (unless there is no attached guest
#
# If the tray is open and there is no medium inserted, this will be a no-op.
#
+# This command is still a work in progress and is considered experimental.
+# Stay away from it unless you want to help with its development.
+#
# @device: block device name
#
# Since: 2.5
##
-{ 'command': 'blockdev-remove-medium',
+{ 'command': 'x-blockdev-remove-medium',
'data': { 'device': 'str' } }
##
-# @blockdev-insert-medium:
+# @x-blockdev-insert-medium:
#
# Inserts a medium (a block driver state tree) into a block device. That block
# device's tray must currently be open (unless there is no attached guest
# device) and there must be no medium inserted already.
#
+# This command is still a work in progress and is considered experimental.
+# Stay away from it unless you want to help with its development.
+#
# @device: block device name
#
# @node-name: name of a node in the block driver state graph
#
# Since: 2.5
##
-{ 'command': 'blockdev-insert-medium',
+{ 'command': 'x-blockdev-insert-medium',
'data': { 'device': 'str',
'node-name': 'str'} }
#
# Changes the medium inserted into a block device by ejecting the current medium
# and loading a new image file which is inserted as the new medium (this command
-# combines blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium
-# and blockdev-close-tray).
+# combines blockdev-open-tray, x-blockdev-remove-medium,
+# x-blockdev-insert-medium and blockdev-close-tray).
#
# @device: block device name
#
EQMP
{
- .name = "blockdev-remove-medium",
+ .name = "x-blockdev-remove-medium",
.args_type = "device:s",
- .mhandler.cmd_new = qmp_marshal_blockdev_remove_medium,
+ .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium,
},
SQMP
-blockdev-remove-medium
-----------------------
+x-blockdev-remove-medium
+------------------------
Removes a medium (a block driver state tree) from a block device. That block
device's tray must currently be open (unless there is no attached guest device).
If the tray is open and there is no medium inserted, this will be a no-op.
+This command is still a work in progress and is considered experimental.
+Stay away from it unless you want to help with its development.
+
Arguments:
- "device": block device name (json-string)
Example:
--> { "execute": "blockdev-remove-medium",
+-> { "execute": "x-blockdev-remove-medium",
"arguments": { "device": "ide1-cd0" } }
<- { "error": { "class": "GenericError",
<- { "return": {} }
--> { "execute": "blockdev-remove-medium",
+-> { "execute": "x-blockdev-remove-medium",
"arguments": { "device": "ide1-cd0" } }
<- { "return": {} }
EQMP
{
- .name = "blockdev-insert-medium",
+ .name = "x-blockdev-insert-medium",
.args_type = "device:s,node-name:s",
- .mhandler.cmd_new = qmp_marshal_blockdev_insert_medium,
+ .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium,
},
SQMP
-blockdev-insert-medium
-----------------------
+x-blockdev-insert-medium
+------------------------
Inserts a medium (a block driver state tree) into a block device. That block
device's tray must currently be open (unless there is no attached guest device)
and there must be no medium inserted already.
+This command is still a work in progress and is considered experimental.
+Stay away from it unless you want to help with its development.
+
Arguments:
- "device": block device name (json-string)
<- { "return": {} }
--> { "execute": "blockdev-insert-medium",
+-> { "execute": "x-blockdev-insert-medium",
"arguments": { "device": "ide1-cd0",
"node-name": "node0" } }
else:
self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img)
- result = self.vm.qmp('blockdev-remove-medium', device='drive0')
+ result = self.vm.qmp('x-blockdev-remove-medium', device='drive0')
self.assert_qmp(result, 'return', {})
result = self.vm.qmp('query-block')
self.assert_qmp(result, 'return[0]/tray_open', True)
self.assert_qmp_absent(result, 'return[0]/inserted')
- result = self.vm.qmp('blockdev-insert-medium', device='drive0',
+ result = self.vm.qmp('x-blockdev-insert-medium', device='drive0',
node_name='new')
self.assert_qmp(result, 'return', {})
# Empty floppy drive
return
- result = self.vm.qmp('blockdev-remove-medium', device='drive0')
+ result = self.vm.qmp('x-blockdev-remove-medium', device='drive0')
self.assert_qmp(result, 'error/class', 'GenericError')
def test_insert_on_closed(self):
'driver': 'file'}})
self.assert_qmp(result, 'return', {})
- result = self.vm.qmp('blockdev-insert-medium', device='drive0',
+ result = self.vm.qmp('x-blockdev-insert-medium', device='drive0',
node_name='new')
self.assert_qmp(result, 'error/class', 'GenericError')
self.wait_for_open()
- result = self.vm.qmp('blockdev-insert-medium', device='drive0',
+ result = self.vm.qmp('x-blockdev-insert-medium', device='drive0',
node_name='new')
self.assert_qmp(result, 'error/class', 'GenericError')
self.wait_for_open()
- result = self.vm.qmp('blockdev-remove-medium', device='drive0')
+ result = self.vm.qmp('x-blockdev-remove-medium', device='drive0')
# Should be a no-op
self.assert_qmp(result, 'return', {})
self.assert_qmp(result, 'return[0]/inserted/ro', False)
self.assert_qmp(result, 'return[0]/inserted/image/filename', old_img)
- result = self.vm.qmp('blockdev-remove-medium', device='drive0')
+ result = self.vm.qmp('x-blockdev-remove-medium', device='drive0')
self.assert_qmp(result, 'return', {})
result = self.vm.qmp('query-block')
self.assert_qmp(result, 'return[0]/tray_open', True)
self.assert_qmp_absent(result, 'return[0]/inserted')
- result = self.vm.qmp('blockdev-insert-medium', device='drive0',
+ result = self.vm.qmp('x-blockdev-insert-medium', device='drive0',
node_name='new')
self.assert_qmp(result, 'return', {})
# For device-less BBs, calling blockdev-open-tray or blockdev-close-tray
# is not necessary
- result = self.vm.qmp('blockdev-remove-medium', device='drive0')
+ result = self.vm.qmp('x-blockdev-remove-medium', device='drive0')
self.assert_qmp(result, 'return', {})
result = self.vm.qmp('query-block')
'driver': 'file'}})
self.assert_qmp(result, 'return', {})
- result = self.vm.qmp('blockdev-insert-medium', device='drive0',
+ result = self.vm.qmp('x-blockdev-insert-medium', device='drive0',
node_name='node0')
self.assert_qmp(result, 'return', {})
def insertDrive(self, backend, node):
self.checkBlockBackend(backend, None)
self.checkBlockDriverState(node)
- result = self.vm.qmp('blockdev-insert-medium',
+ result = self.vm.qmp('x-blockdev-insert-medium',
device = backend, node_name = node)
self.assert_qmp(result, 'return', {})
self.checkBlockBackend(backend, node)