Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental

2015-12-14 Thread Markus Armbruster
Peter Maydell  writes:

> On 11 December 2015 at 15:43, Max Reitz  wrote:
>> On 2015-12-11 at 16:40, Peter Maydell wrote:
>>>
>>> On 11 December 2015 at 15:30, Eric Blake  wrote:

 On 12/11/2015 08:23 AM, Max Reitz wrote:
>
>
>   SQMP
> -blockdev-remove-medium
> +x-blockdev-remove-medium
>   --


 Formatting nit, but not worth holding this up (as it is really our last
 chance to get it in 2.5 before baking in something we'd be stuck with).
>>>
>>>
>>> You mean the length of the underline, right? I can fix that up
>>> as I apply it.
>>
>>
>> I'd appreciate that, thanks!
>
> Applied, thanks.

http://qemu-project.org/ChangeLog/2.5#Block_devices_and_tools updated
accordingly.



Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental

2015-12-11 Thread Peter Maydell
On 11 December 2015 at 15:43, Max Reitz  wrote:
> On 2015-12-11 at 16:40, Peter Maydell wrote:
>>
>> On 11 December 2015 at 15:30, Eric Blake  wrote:
>>>
>>> On 12/11/2015 08:23 AM, Max Reitz wrote:


   SQMP
 -blockdev-remove-medium
 +x-blockdev-remove-medium
   --
>>>
>>>
>>> Formatting nit, but not worth holding this up (as it is really our last
>>> chance to get it in 2.5 before baking in something we'd be stuck with).
>>
>>
>> You mean the length of the underline, right? I can fix that up
>> as I apply it.
>
>
> I'd appreciate that, thanks!

Applied, thanks.

-- PMM



Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental

2015-12-11 Thread Max Reitz

On 2015-12-11 at 16:40, Peter Maydell wrote:

On 11 December 2015 at 15:30, Eric Blake  wrote:

On 12/11/2015 08:23 AM, Max Reitz wrote:


  SQMP
-blockdev-remove-medium
+x-blockdev-remove-medium
  --


Formatting nit, but not worth holding this up (as it is really our last
chance to get it in 2.5 before baking in something we'd be stuck with).


You mean the length of the underline, right? I can fix that up
as I apply it.


I'd appreciate that, thanks!

Max



Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental

2015-12-11 Thread Peter Maydell
On 11 December 2015 at 15:30, Eric Blake  wrote:
> On 12/11/2015 08:23 AM, Max Reitz wrote:
>>
>>  SQMP
>> -blockdev-remove-medium
>> +x-blockdev-remove-medium
>>  --
>
> Formatting nit, but not worth holding this up (as it is really our last
> chance to get it in 2.5 before baking in something we'd be stuck with).

You mean the length of the underline, right? I can fix that up
as I apply it.

thanks
-- PMM



Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental

2015-12-11 Thread Eric Blake
On 12/11/2015 08:23 AM, Max Reitz wrote:
> While in the long term we want throttling to be its own block filter
> BDS, in the short term we want it to be part of the BB instead of a BDS;
> even in the long term we may want legacy throttling to be automatically
> tied to the BB.
> 
> blockdev-insert-medium and blockdev-remove-medium do not retain
> throttling information in the BB (deliberately so). Therefore, using
> them means tying this information to a BDS, which would break the model
> described above. (The same applies to other flags such as
> detect_zeroes.) We probably want to move this information to the BB or
> its own filter BDS before blockdev-{insert,remove}-medium can be
> considered completely stable.
> 
> Therefore, mark these functions experimental for the time being.
> 
> Suggested-by: Markus Armbruster 
> Signed-off-by: Max Reitz 
> Acked-by: Markus Armbruster 
> Acked-by: Kevin Wolf 
> ---

Reviewed-by: Eric Blake 


> +++ b/qmp-commands.hx
> @@ -4203,13 +4203,13 @@ Example:
>  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
>  --

Formatting nit, but not worth holding this up (as it is really our last
chance to get it in 2.5 before baking in something we'd be stuck with).

>  
>  SQMP
> -blockdev-insert-medium
> +x-blockdev-insert-medium
>  --

Ditto.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental

2015-12-11 Thread Max Reitz
While in the long term we want throttling to be its own block filter
BDS, in the short term we want it to be part of the BB instead of a BDS;
even in the long term we may want legacy throttling to be automatically
tied to the BB.

blockdev-insert-medium and blockdev-remove-medium do not retain
throttling information in the BB (deliberately so). Therefore, using
them means tying this information to a BDS, which would break the model
described above. (The same applies to other flags such as
detect_zeroes.) We probably want to move this information to the BB or
its own filter BDS before blockdev-{insert,remove}-medium can be
considered completely stable.

Therefore, mark these functions experimental for the time being.

Suggested-by: Markus Armbruster 
Signed-off-by: Max Reitz 
Acked-by: Markus Armbruster 
Acked-by: Kevin Wolf 
---
 blockdev.c | 10 +-
 qapi/block-core.json   | 18 --
 qmp-commands.hx| 24 +++-
 tests/qemu-iotests/118 | 20 ++--
 tests/qemu-iotests/139 |  2 +-
 5 files changed, 43 insertions(+), 31 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 313841b..80932e8 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2257,7 +2257,7 @@ void qmp_eject(const char *device, bool has_force, bool 
force, Error **errp)
 return;
 }
 
-qmp_blockdev_remove_medium(device, errp);
+qmp_x_blockdev_remove_medium(device, errp);
 }
 
 void qmp_block_passwd(bool has_device, const char *device,
@@ -2343,7 +2343,7 @@ void qmp_blockdev_close_tray(const char *device, Error 
**errp)
 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;
@@ -2430,8 +2430,8 @@ static void qmp_blockdev_insert_anon_medium(const char 
*device,
 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;
 
@@ -2520,7 +2520,7 @@ void qmp_blockdev_change_medium(const char *device, const 
char *filename,
 goto fail;
 }
 
-qmp_blockdev_remove_medium(device, &err);
+qmp_x_blockdev_remove_medium(device, &err);
 if (err) {
 error_propagate(errp, err);
 goto fail;
diff --git a/qapi/block-core.json b/qapi/block-core.json
index a07b13f..5a23165 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2081,7 +2081,7 @@
   '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
@@ -2089,27 +2089,33 @@
 #
 # 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'} }
 
@@ -2137,8 +2143,8 @@
 #
 # 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
 #
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 9d8b42f..b6e5e44 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -4203,13 +4203,13 @@ Example:
 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
-blo