All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.5 0/1] blockdev: Mark {insert, remove}-medium experimental
@ 2015-12-11 15:23 Max Reitz
  2015-12-11 15:23 ` [Qemu-devel] [PATCH for-2.5 1/1] " Max Reitz
  0 siblings, 1 reply; 7+ messages in thread
From: Max Reitz @ 2015-12-11 15:23 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Kevin Wolf, Markus Armbruster, qemu-block, Max Reitz

Hello Peter,

After having talked about the current status of the block layer today,
Markus, Kevin and me agreed to mark the newly introduced QMP commands
blockdev-insert-medium and blockdev-remove-medium experimental after
all (due to possible interference of its current status with future
designs).

Can you please apply this patch directly?

I am sorry for the inconvencience.

Max


Max Reitz (1):
  blockdev: Mark {insert,remove}-medium experimental

 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(-)

-- 
2.5.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental
  2015-12-11 15:23 [Qemu-devel] [PATCH for-2.5 0/1] blockdev: Mark {insert, remove}-medium experimental Max Reitz
@ 2015-12-11 15:23 ` Max Reitz
  2015-12-11 15:30   ` Eric Blake
  0 siblings, 1 reply; 7+ messages in thread
From: Max Reitz @ 2015-12-11 15:23 UTC (permalink / raw)
  To: qemu-devel, Peter Maydell
  Cc: Kevin Wolf, Markus Armbruster, qemu-block, 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 <armbru@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
---
 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
-blockdev-remove-medium
+x-blockdev-remove-medium
 ----------------------
 
 Removes a medium (a block driver state tree) from a block device. That block
@@ -4217,13 +4217,16 @@ 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",
@@ -4240,7 +4243,7 @@ Example:
 
 <- { "return": {} }
 
--> { "execute": "blockdev-remove-medium",
+-> { "execute": "x-blockdev-remove-medium",
      "arguments": { "device": "ide1-cd0" } }
 
 <- { "return": {} }
@@ -4248,19 +4251,22 @@ Example:
 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)
@@ -4276,7 +4282,7 @@ Example:
 
 <- { "return": {} }
 
--> { "execute": "blockdev-insert-medium",
+-> { "execute": "x-blockdev-insert-medium",
      "arguments": { "device": "ide1-cd0",
                     "node-name": "node0" } }
 
diff --git a/tests/qemu-iotests/118 b/tests/qemu-iotests/118
index a2bcd54..114d0e2 100755
--- a/tests/qemu-iotests/118
+++ b/tests/qemu-iotests/118
@@ -208,14 +208,14 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
         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', {})
 
@@ -243,7 +243,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
             # 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):
@@ -258,7 +258,7 @@ class GeneralChangeTestsBaseClass(ChangeBaseClass):
                                                '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')
 
@@ -289,7 +289,7 @@ class TestInitiallyFilled(GeneralChangeTestsBaseClass):
 
         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')
 
@@ -311,7 +311,7 @@ class TestInitiallyEmpty(GeneralChangeTestsBaseClass):
 
         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', {})
 
@@ -604,14 +604,14 @@ class TestChangeReadOnly(ChangeBaseClass):
         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', {})
 
@@ -653,7 +653,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass):
 
         # 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')
@@ -666,7 +666,7 @@ class TestBlockJobsAfterCycle(ChangeBaseClass):
                                                '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', {})
 
diff --git a/tests/qemu-iotests/139 b/tests/qemu-iotests/139
index 42f78c7..a4b9694 100644
--- a/tests/qemu-iotests/139
+++ b/tests/qemu-iotests/139
@@ -174,7 +174,7 @@ class TestBlockdevDel(iotests.QMPTestCase):
     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)
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental
  2015-12-11 15:23 ` [Qemu-devel] [PATCH for-2.5 1/1] " Max Reitz
@ 2015-12-11 15:30   ` Eric Blake
  2015-12-11 15:40     ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Blake @ 2015-12-11 15:30 UTC (permalink / raw)
  To: Max Reitz, qemu-devel, Peter Maydell
  Cc: Kevin Wolf, Markus Armbruster, qemu-block

[-- Attachment #1: Type: text/plain, Size: 1912 bytes --]

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 <armbru@redhat.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> Acked-by: Markus Armbruster <armbru@redhat.com>
> Acked-by: Kevin Wolf <kwolf@redhat.com>
> ---

Reviewed-by: Eric Blake <eblake@redhat.com>


> +++ 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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental
  2015-12-11 15:30   ` Eric Blake
@ 2015-12-11 15:40     ` Peter Maydell
  2015-12-11 15:43       ` Max Reitz
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2015-12-11 15:40 UTC (permalink / raw)
  To: Eric Blake
  Cc: Kevin Wolf, Markus Armbruster, QEMU Developers, Qemu-block, Max Reitz

On 11 December 2015 at 15:30, Eric Blake <eblake@redhat.com> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental
  2015-12-11 15:40     ` Peter Maydell
@ 2015-12-11 15:43       ` Max Reitz
  2015-12-11 16:19         ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Max Reitz @ 2015-12-11 15:43 UTC (permalink / raw)
  To: Peter Maydell, Eric Blake
  Cc: Kevin Wolf, QEMU Developers, Qemu-block, Markus Armbruster

On 2015-12-11 at 16:40, Peter Maydell wrote:
> On 11 December 2015 at 15:30, Eric Blake <eblake@redhat.com> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental
  2015-12-11 15:43       ` Max Reitz
@ 2015-12-11 16:19         ` Peter Maydell
  2015-12-14 13:47           ` Markus Armbruster
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2015-12-11 16:19 UTC (permalink / raw)
  To: Max Reitz; +Cc: Kevin Wolf, QEMU Developers, Qemu-block, Markus Armbruster

On 11 December 2015 at 15:43, Max Reitz <mreitz@redhat.com> wrote:
> On 2015-12-11 at 16:40, Peter Maydell wrote:
>>
>> On 11 December 2015 at 15:30, Eric Blake <eblake@redhat.com> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5 1/1] blockdev: Mark {insert, remove}-medium experimental
  2015-12-11 16:19         ` Peter Maydell
@ 2015-12-14 13:47           ` Markus Armbruster
  0 siblings, 0 replies; 7+ messages in thread
From: Markus Armbruster @ 2015-12-14 13:47 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Kevin Wolf, QEMU Developers, Qemu-block, Max Reitz

Peter Maydell <peter.maydell@linaro.org> writes:

> On 11 December 2015 at 15:43, Max Reitz <mreitz@redhat.com> wrote:
>> On 2015-12-11 at 16:40, Peter Maydell wrote:
>>>
>>> On 11 December 2015 at 15:30, Eric Blake <eblake@redhat.com> 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-14 13:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-11 15:23 [Qemu-devel] [PATCH for-2.5 0/1] blockdev: Mark {insert, remove}-medium experimental Max Reitz
2015-12-11 15:23 ` [Qemu-devel] [PATCH for-2.5 1/1] " Max Reitz
2015-12-11 15:30   ` Eric Blake
2015-12-11 15:40     ` Peter Maydell
2015-12-11 15:43       ` Max Reitz
2015-12-11 16:19         ` Peter Maydell
2015-12-14 13:47           ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.