Patchwork qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema

login
register
mail settings
Submitter Michal Privoznik
Date Jan. 25, 2013, 1:27 p.m.
Message ID <ef9bb01f7a2cd566bcdc10f19dc0881818754c4e.1359120428.git.mprivozn@redhat.com>
Download mbox | patch
Permalink /patch/215673/
State New
Headers show

Comments

Michal Privoznik - Jan. 25, 2013, 1:27 p.m.
Currently, we are using 'tray_open' in QMP and 'tray-open' in
HMP. However, the QMP documentation was mistakenly using the
HMP version.
---
 qmp-commands.hx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Eric Blake - Jan. 25, 2013, 1:52 p.m.
On 01/25/2013 06:27 AM, Michal Privoznik wrote:
> Currently, we are using 'tray_open' in QMP and 'tray-open' in
> HMP. However, the QMP documentation was mistakenly using the
> HMP version.
> ---
>  qmp-commands.hx | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

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

> 
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index cbf1280..870ee54 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -1585,7 +1585,7 @@ Each json-object contain the following:
>           - Possible values: "unknown"
>  - "removable": true if the device is removable, false otherwise (json-bool)
>  - "locked": true if the device is locked, false otherwise (json-bool)
> -- "tray-open": only present if removable, true if the device has a tray,
> +- "tray_open": only present if removable, true if the device has a tray,
>                 and it is open (json-bool)
>  - "inserted": only present if the device is inserted, it is a json-object
>     containing the following:
>
Markus Armbruster - Jan. 25, 2013, 1:55 p.m.
Michal Privoznik <mprivozn@redhat.com> writes:

> Currently, we are using 'tray_open' in QMP and 'tray-open' in
> HMP. However, the QMP documentation was mistakenly using the
> HMP version.

Could you point me to where we're using "tray_open"?
Michal Privoznik - Jan. 25, 2013, 2:07 p.m.
On 25.01.2013 14:55, Markus Armbruster wrote:
> Michal Privoznik <mprivozn@redhat.com> writes:
> 
>> Currently, we are using 'tray_open' in QMP and 'tray-open' in
>> HMP. However, the QMP documentation was mistakenly using the
>> HMP version.
> 
> Could you point me to where we're using "tray_open"?
> 

qemu.git $ git grep -npC8 tray_open qapi-schema.json

qapi-schema.json-683-# @type: This field is returned only for compatibility reasons, it should
qapi-schema.json-684-#        not be used (always returns 'unknown')
qapi-schema.json-685-#
qapi-schema.json-686-# @removable: True if the device supports removable media.
qapi-schema.json-687-#
qapi-schema.json-688-# @locked: True if the guest has locked this device from having its media
qapi-schema.json-689-#          removed
qapi-schema.json-690-#
qapi-schema.json:691:# @tray_open: #optional True if the device has a tray and it is open
qapi-schema.json-692-#             (only present if removable is true)
qapi-schema.json-693-#
qapi-schema.json-694-# @dirty: #optional dirty bitmap information (only present if the dirty
qapi-schema.json-695-#         bitmap is enabled)
qapi-schema.json-696-#
qapi-schema.json-697-# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
qapi-schema.json-698-#             supports it and the VM is configured to stop on errors
qapi-schema.json-699-#
qapi-schema.json-700-# @inserted: #optional @BlockDeviceInfo describing the device if media is
qapi-schema.json-701-#            present
qapi-schema.json-702-#
qapi-schema.json-703-# Since:  0.14.0
qapi-schema.json-704-##
qapi-schema.json-705-{ 'type': 'BlockInfo',
qapi-schema.json-706-  'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
qapi-schema.json-707-           'locked': 'bool', '*inserted': 'BlockDeviceInfo',
qapi-schema.json:708:           '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
qapi-schema.json-709-           '*dirty': 'BlockDirtyInfo' } }
qapi-schema.json-710-
qapi-schema.json-711-##
qapi-schema.json-712-# @query-block:
qapi-schema.json-713-#
qapi-schema.json-714-# Get a list of BlockInfo for all virtual block devices.
qapi-schema.json-715-#
qapi-schema.json-716-# Returns: a list of @BlockInfo describing each virtual block device
Eric Blake - Jan. 25, 2013, 3:40 p.m.
On 01/25/2013 07:07 AM, Michal Privoznik wrote:
> On 25.01.2013 14:55, Markus Armbruster wrote:
>> Michal Privoznik <mprivozn@redhat.com> writes:
>>
>>> Currently, we are using 'tray_open' in QMP and 'tray-open' in
>>> HMP. However, the QMP documentation was mistakenly using the
>>> HMP version.
>>
>> Could you point me to where we're using "tray_open"?
>>
> 
> qemu.git $ git grep -npC8 tray_open qapi-schema.json
> 

> qapi-schema.json-705-{ 'type': 'BlockInfo',
> qapi-schema.json-706-  'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
> qapi-schema.json-707-           'locked': 'bool', '*inserted': 'BlockDeviceInfo',
> qapi-schema.json:708:           '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
> qapi-schema.json-709-           '*dirty': 'BlockDirtyInfo' } }

And since existing qemu versions output tray_open, we would be breaking
API if we fixed the QMP to return tray-open (libvirt could cope with
that API break by checking both spellings, but that feels dirty).
Markus Armbruster - Jan. 25, 2013, 3:49 p.m.
Eric Blake <eblake@redhat.com> writes:

> On 01/25/2013 07:07 AM, Michal Privoznik wrote:
>> On 25.01.2013 14:55, Markus Armbruster wrote:
>>> Michal Privoznik <mprivozn@redhat.com> writes:
>>>
>>>> Currently, we are using 'tray_open' in QMP and 'tray-open' in
>>>> HMP. However, the QMP documentation was mistakenly using the
>>>> HMP version.
>>>
>>> Could you point me to where we're using "tray_open"?
>>>
>> 
>> qemu.git $ git grep -npC8 tray_open qapi-schema.json
>> 
>
>> qapi-schema.json-705-{ 'type': 'BlockInfo',
>> qapi-schema.json-706- 'data': {'device': 'str', 'type': 'str',
>> removable': 'bool',
>> qapi-schema.json-707- 'locked': 'bool', '*inserted':
>> BlockDeviceInfo',
>> qapi-schema.json:708: '*tray_open': 'bool', '*io-status':
>> BlockDeviceIoStatus',
>> qapi-schema.json-709-           '*dirty': 'BlockDirtyInfo' } }
>
> And since existing qemu versions output tray_open, we would be breaking
> API if we fixed the QMP to return tray-open (libvirt could cope with
> that API break by checking both spellings, but that feels dirty).

Breaking the API is out of the question.

We suck at consistency :(
Luiz Capitulino - Jan. 28, 2013, 1:22 p.m.
On Fri, 25 Jan 2013 14:27:11 +0100
Michal Privoznik <mprivozn@redhat.com> wrote:

> Currently, we are using 'tray_open' in QMP and 'tray-open' in
> HMP. However, the QMP documentation was mistakenly using the
> HMP version.

It's missing the s-o-b line.

> ---
>  qmp-commands.hx | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index cbf1280..870ee54 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -1585,7 +1585,7 @@ Each json-object contain the following:
>           - Possible values: "unknown"
>  - "removable": true if the device is removable, false otherwise (json-bool)
>  - "locked": true if the device is locked, false otherwise (json-bool)
> -- "tray-open": only present if removable, true if the device has a tray,
> +- "tray_open": only present if removable, true if the device has a tray,
>                 and it is open (json-bool)
>  - "inserted": only present if the device is inserted, it is a json-object
>     containing the following:
Anthony Liguori - Jan. 29, 2013, 3:46 p.m.
Hi,

Thank you for submitting your patch series.  checkpatch.pl has
detected that one or more of the patches in this series violate
the QEMU coding style.

If you believe this message was sent in error, please ignore it
or respond here with an explanation.

Otherwise, please correct the coding style issues and resubmit a
new version of the patch.

For more information about QEMU coding style, see:

http://git.qemu.org/?p=qemu.git;a=blob_plain;f=CODING_STYLE;hb=HEAD

Here is the output from checkpatch.pl:

Subject: qmp-commands.hx: s/tray-open/tray_open/ to match qapi schema
ERROR: Missing Signed-off-by: line(s)

total: 1 errors, 0 warnings, 8 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.



Regards,

Anthony Liguori

Patch

diff --git a/qmp-commands.hx b/qmp-commands.hx
index cbf1280..870ee54 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -1585,7 +1585,7 @@  Each json-object contain the following:
          - Possible values: "unknown"
 - "removable": true if the device is removable, false otherwise (json-bool)
 - "locked": true if the device is locked, false otherwise (json-bool)
-- "tray-open": only present if removable, true if the device has a tray,
+- "tray_open": only present if removable, true if the device has a tray,
                and it is open (json-bool)
 - "inserted": only present if the device is inserted, it is a json-object
    containing the following: